Implemented function pointers as parameters
This commit is contained in:
@ -2,18 +2,18 @@ import mem
|
||||
import sys
|
||||
|
||||
main() {
|
||||
start()
|
||||
start()
|
||||
start()
|
||||
start(thread)
|
||||
start(thread)
|
||||
start(thread)
|
||||
thread()
|
||||
}
|
||||
|
||||
start() {
|
||||
start(func Pointer) {
|
||||
size := 4096
|
||||
stack := mem.alloc(size)
|
||||
pointer := stack + size - 8
|
||||
store(pointer, 8, thread)
|
||||
sys.clone(0x100 | 0x200 | 0x400 | 0x800 | 0x8000 | 0x10000 | 0x80000000, pointer)
|
||||
rip := stack + size - 8
|
||||
store(rip, 8, func)
|
||||
sys.clone(0x100|0x200|0x400|0x800|0x8000|0x10000|0x80000000, rip)
|
||||
}
|
||||
|
||||
thread() {
|
||||
|
Reference in New Issue
Block a user