logoalt Hacker News

delta_p_delta_xtoday at 12:35 PM2 repliesview on HN

Interesting to bypass CRT and work directly against the Windows API. That said, these rely on USER.32.DLL and KERNEL32.DLL to do the majority of the heavy lifting.

It's a bit like 'smallest hello world in assembly' but the code is just setting up the calling convention and then passing the zero-terminated character string into `write`. Cool, but that could be done a bit more straightforwardly in C, too. A lot of assembly (including in the linked repository) is book-keeping for the platform's calling convention.


Replies

skrellmtoday at 12:46 PM

> That said, these rely on USER.32.DLL and KERNEL32.DLL to do the majority of the heavy lifting.

Since the low-level Windows kernel API is undocumented and non-public, using these system DLLs is your only option on Windows.

It's just like linking against libc.so on any POSIX systems.

show 1 reply
munchlertoday at 1:04 PM

It’s a minimal Windows app, so the whole idea is to rely on Windows DLLs as much as possible.

show 1 reply