16 lines
415 B
Plaintext

extern kernel32 {
VirtualAlloc(address int, length int, flags int, protection int)
VirtualFree(address *any, length int, type int) -> bool
}
const mem {
decommit 0x4000
}
mmap(address int, length int, protection int, flags int) -> *any {
return kernel32.VirtualAlloc(address, length, flags, protection)
}
munmap(address *any, length int) -> int {
return kernel32.VirtualFree(address, length, mem.decommit)
}