16 lines
415 B
Plaintext
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)
|
|
} |