Improved documentation
This commit is contained in:
parent
141ec1158d
commit
499fe8aec8
@ -18,7 +18,7 @@ go build
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Build a Linux x86-64 ELF executable from `examples/hello` and run it:
|
Build an executable from `examples/hello` and run it:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./q run examples/hello
|
./q run examples/hello
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
write(_ Int, _ Pointer, _ Int) -> Int {
|
write(_ Int, _ Pointer, _ Int) -> Int {
|
||||||
|
// WriteFile(fd, buffer, length, out numberOfBytesWritten, out overlapped)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
mmap(_ Int, _ Int, _ Int, _ Int) -> Pointer {
|
||||||
|
// VirtualAlloc(address, length, flags, protection)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(_ Int) {
|
exit(_ Int) {
|
||||||
|
// ExitProcess(code)
|
||||||
return
|
return
|
||||||
}
|
}
|
@ -13,6 +13,8 @@ importing a few core functions from "kernel32.dll".
|
|||||||
The section where the DLL function pointers are stored does not need to be marked as writable.
|
The section where the DLL function pointers are stored does not need to be marked as writable.
|
||||||
The Windows executable loader resolves the pointers before they are loaded into memory.
|
The Windows executable loader resolves the pointers before they are loaded into memory.
|
||||||
|
|
||||||
|
The stack must be 16 byte aligned before a DLL function is called.
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
- https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
|
- https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
|
||||||
|
Loading…
Reference in New Issue
Block a user