diff options
| author | spv420 <unomilliono@gmail.com> | 2022-04-24 06:21:54 -0400 |
|---|---|---|
| committer | spv420 <unomilliono@gmail.com> | 2022-04-24 06:21:54 -0400 |
| commit | 8364663622bb5ff19e6eeba85f9a58f098b6b8f1 (patch) | |
| tree | 63ecfed0f3337032c3bf6ebb86bb85ac2248e12a | |
| parent | eab6e28c9e1b541c505e84ab64a148d6def984c9 (diff) | |
return val yay
| -rw-r--r-- | src/js/main.js | 6 | ||||
| -rw-r--r-- | src/js/primitives/call.js | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/js/main.js b/src/js/main.js index 683c96a..923a8fd 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -48,6 +48,10 @@ function main() { printf("*(uint32_t*)base = 0x%x\n", read_u32(base)); callnarg(sym_cache["printf"], sptr("Hello world! %x %x %x %x %x %x %x %x %x %x %x %x %x\n"), 0x420, 0x69, 0x1337, 0x13371337, 0xb1a7e17, 0x41424344); + callnarg(sym_cache["printf"], sptr("Hello world! %x %x %x %x %x %x %x %x %x %x %x %x %x\n"), 0x420, 0x69, 0x1337, 0x13371337, 0xb1a7e17, 0x41424344); + callnarg(sym_cache["printf"], sptr("Hello world! %x %x %x %x %x %x %x %x %x %x %x %x %x\n"), 0x420, 0x69, 0x1337, 0x13371337, 0xb1a7e17, 0x41424344); + callnarg(sym_cache["printf"], sptr("Hello world! %x %x %x %x %x %x %x %x %x %x %x %x %x\n"), 0x420, 0x69, 0x1337, 0x13371337, 0xb1a7e17, 0x41424344); + callnarg(sym_cache["printf"], sptr("Hello world! %x %x %x %x %x %x %x %x %x %x %x %x %x\n"), 0x420, 0x69, 0x1337, 0x13371337, 0xb1a7e17, 0x41424344); // var i = 0; // while (true) { @@ -56,5 +60,5 @@ function main() { // i++; // } - printf("still alive18\n"); + printf("still alive\n"); }; diff --git a/src/js/primitives/call.js b/src/js/primitives/call.js index 687e758..06c5a77 100644 --- a/src/js/primitives/call.js +++ b/src/js/primitives/call.js @@ -156,4 +156,13 @@ function callnarg() { calls4arg("thread_set_state", read_u32(th), ARM_THREAD_STATE, thread_state, ARM_THREAD_STATE_COUNT); calls4arg("thread_resume", read_u32(th), 0, 0, 0); + + while (true) { + write_u32(count, 0x1000); + calls4arg("thread_get_state", read_u32(th), ARM_THREAD_STATE, thread_state, count); + if ((read_u32(thread_state + (15 << 2)) - (0x23d751fc + dyld_shc_slide)) <= 8) { + return read_u32(thread_state); + } + calls4arg("usleep", 1000, 0, 0, 0); + } }
\ No newline at end of file |
