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

Method push_call

g2all/700/module/chain.js:298–321  ·  view source on GitHub ↗
(func_addr, ...args)

Source from the content-addressed store, hash-verified

296 }
297
298 push_call(func_addr, ...args) {
299 if (args.length > 6) {
300 throw TypeError("push_call() does not support functions that have more than 6 arguments");
301 }
302
303 for (let i = 0; i < args.length; i++) {
304 this.push_gadget(argument_pops[i]);
305 this.push_value(args[i]);
306 }
307
308 // The address of our buffer seems to be always aligned to 8 bytes.
309 // SysV calling convention requires the stack is aligned to 16 bytes on
310 // function entry, so push an additional 8 bytes to pad the stack. We
311 // pushed a "ret" gadget for a noop.
312 if ((this.position & (0x10 - 1)) !== 0) {
313 this.push_gadget("ret");
314 }
315
316 if (typeof func_addr === "string") {
317 this.push_gadget(func_addr);
318 } else {
319 this.push_value(func_addr);
320 }
321 }
322
323 push_syscall(syscall_name, ...args) {
324 if (typeof syscall_name !== "string") {

Callers 11

push_syscallMethod · 0.95
do_callMethod · 0.95
race_oneFunction · 0.45
push_get_errnoMethod · 0.45
push_clear_errnoMethod · 0.45
push_get_errnoMethod · 0.45
push_clear_errnoMethod · 0.45
push_get_errnoMethod · 0.45
push_clear_errnoMethod · 0.45
push_get_errnoMethod · 0.45
push_clear_errnoMethod · 0.45

Calls 2

push_gadgetMethod · 0.95
push_valueMethod · 0.95

Tested by

no test coverage detected