From 499fe8aec8591a47bfefd16ec0ed589a4dcd9137 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 16 Aug 2024 12:49:17 +0200 Subject: [PATCH] Improved documentation --- README.md | 2 +- lib/sys/sys_windows.q | 7 +++++++ src/exe/pe/pe.md | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 12736ec..91aedf2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ go build ## Usage -Build a Linux x86-64 ELF executable from `examples/hello` and run it: +Build an executable from `examples/hello` and run it: ```shell ./q run examples/hello diff --git a/lib/sys/sys_windows.q b/lib/sys/sys_windows.q index 105b33d..575bb00 100644 --- a/lib/sys/sys_windows.q +++ b/lib/sys/sys_windows.q @@ -1,7 +1,14 @@ 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 } exit(_ Int) { + // ExitProcess(code) return } \ No newline at end of file diff --git a/src/exe/pe/pe.md b/src/exe/pe/pe.md index 3d92799..8db558c 100644 --- a/src/exe/pe/pe.md +++ b/src/exe/pe/pe.md @@ -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 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 - https://learn.microsoft.com/en-us/windows/win32/debug/pe-format