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

Method push_call

g2all/900/module/chain.js:301–326  ·  view source on GitHub ↗
(func_addr, ...args)

Source from the content-addressed store, hash-verified

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

Callers 7

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

Calls 2

push_gadgetMethod · 0.95
push_valueMethod · 0.95

Tested by

no test coverage detected