From d7cf3795b6da29a8ec7a6b7fc1245b70ff9d3dca Mon Sep 17 00:00:00 2001 From: spv Date: Fri, 22 Apr 2022 15:57:02 -0400 Subject: stuff --- js/call.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/call.js') diff --git a/js/call.js b/js/call.js index 382222c..8c5ad44 100644 --- a/js/call.js +++ b/js/call.js @@ -2,6 +2,7 @@ var reserve_addr = 0x1a0000; var gettimeofday_addy = 0x34d63d3c; var slide = 0x0; var base = 0x0; +//var slid = 0x0; function get_dyld_shc_slide() { return read_u32((slide << 12) + reserve_addr + 20); @@ -45,3 +46,13 @@ function call4arg(addy, r0, r1, r2, r3) { return (parseInt(Int64.fromDouble(ret)) & 0xffffffff) >>> 0; } + +/* + * call with symbol + */ +function calls4arg(sym, r0, r1, r2, r3) { + var dlsym_addy = read_u32(0x1a0000 + 24 + slid); + var shc_slide = read_u32(0x1a0000 + 20 + slid); + var addy = call4arg(dlsym_addy + shc_slide, 0xfffffffe, sptr(sym), 0, 0); + return call4arg(addy, r0, r1, r2, r3); +} -- cgit v1.2.3