https://weblog.west-wind.com/posts/2008/Apr/26/Variable-Scoping-in-Anonymous-Delegates-in-C
zaterdag 29 juli 2023
zondag 16 juli 2023
Executable formaten .com, .exe en PE(32+)
Als je het DOS tijdperk hebt meegemaakt, dan heb je 3 executable formats voorbij zien komen, namelijk:
.com -> maximaal 64 kb groot en bevatte geen header informatie.
.exe -> DOS MZ executables. Vanaf DOS 2.0.
.exe -> PE (PE32+). Vanaf Windows NT 3.1 is dit formaat gebruikt. Windows 95 en verder ondersteunde dit formaat ook.
https://en.wikipedia.org/wiki/COM_file
https://en.wikipedia.org/wiki/DOS_MZ_executable
https://en.wikipedia.org/wiki/Portable_Executable
De 64-bit variant van PE heet PE32+, wat een verwarrende naam is.
Verwarrend is ook de x64 fastcall calling convention, die een stack eist die 16 bytes aligned is.
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention
Als je vreemde sections in FASM gedefinieerd ziet worden, zoals .idata, dan is dat vanwege het PE formaat.
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-idata-section
Learning x86-64 assembly: https://gpfault.net/posts/asm-tut-0.txt.html
https://sonictk.github.io/asm_tutorial/#windows:thewindowtothehardware/themicrosoftx64callingconvention