diff options
| author | spv420 <spv@spv.sh> | 2022-07-31 23:28:57 -0400 |
|---|---|---|
| committer | spv420 <spv@spv.sh> | 2022-07-31 23:28:57 -0400 |
| commit | 919024c399a2affae5d9271a93a83fb6cd8e3986 (patch) | |
| tree | d832cc82f7337d95582b53fa8c470db45ff3e54e | |
| parent | 58236a8570beffe29810998c118bc3fd0548126f (diff) | |
ha get fucked
| -rw-r--r-- | src/stage4/lib/native_ptr.js | 32 | ||||
| -rw-r--r-- | src/stage4/main.js | 2 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/stage4/lib/native_ptr.js b/src/stage4/lib/native_ptr.js index 47d23ca..aa79130 100644 --- a/src/stage4/lib/native_ptr.js +++ b/src/stage4/lib/native_ptr.js @@ -126,6 +126,38 @@ function mach_msg_ool_ports_descriptor_t_obj_to_buf(obj) { return ret; } +function u32xn_to_u8xn(buf) { + var ret = new Uint8Array(buf.length * 4); + + for (var i = 0; i < buf.length; i++) { + var tmp = u32_to_u8x4(buf[i]); + ret[(i << 2) + 0] = tmp[0]; + ret[(i << 2) + 1] = tmp[1]; + ret[(i << 2) + 2] = tmp[2]; + ret[(i << 2) + 3] = tmp[3]; + } + + return ret; +} + +/* +typedef struct{ + mach_msg_bits_t msgh_bits; + mach_msg_size_t msgh_size; + mach_port_t msgh_remote_port; + mach_port_t msgh_local_port; + mach_port_name_t msgh_voucher_port; + mach_msg_id_t msgh_id; +} mach_msg_header_t; + */ +function mach_msg_header_t_buf_to_obj(buf) { + var ret = new Uint8Array(24); +} + +function Request_sp_buf_to_obj(buf) { + +} + var mach_msg_ool_ports_descriptor_t = native_ptr_type(12, mach_msg_ool_ports_descriptor_t_buf_to_obj, mach_msg_ool_ports_descriptor_t_obj_to_buf);
\ No newline at end of file diff --git a/src/stage4/main.js b/src/stage4/main.js index dc89835..b24f52b 100644 --- a/src/stage4/main.js +++ b/src/stage4/main.js @@ -55,6 +55,8 @@ function main() { sym_cache["JSContextGetGlobalObject"] = JSContextGetGlobalObject + dyld_shc_slide; prep_shit(); + p0laris_log("%s", prim_hexdump(u32xn_to_u8xn([0x41424344, 0x45464748, 0x494a4b4c, 0x4d4e4f50]))); + var init_port_set = new mach_msg_ool_ports_descriptor_t(4); var addy = init_port_set.addy; var init_port_set_obj = init_port_set.deref(); |
