09/06/2026
I have now created a 64-bit Windows Assembly version of chastehex. The 64-bit edition doesn't behave differently from the 32-bit program, but it uses the 64-bit calling convention, which means I have a working example of how to open, close, and lseek the file pointer in 64-bit Windows system calls. These calls, combined with the read, write, and exit calls, make it possible to port over any of my Linux programs to Windows.
Keep in mind that I am referring to these system calls by their Linux names as opposed to their Windows API names. In the future, I hope to make a comparison chart for the differences between the Windows API and the Linux POSIX calls. These two calling conventions are NOT even close to being compatible with each other, but as far as what the functions do, they are pretty close.
I do still need to add better comments on both the 32-bit and 64-bit Windows chastehex programs, but all my tests have shown that there are no bugs when I use the program for what I made it for: hex editing files at any location from the command line.
I have even thought about making an interactive version of chastehex, although I question whether it would be worth the effort for a program that few people understand the purpose of. Perhaps not everybody is as obsessed with binary and hexadecimal as I am, but in any case, writing the program requires a lot of knowledge of Assembly. I feel more confident having achieved this much with the Windows API, even though I did it only for the personal satisfaction of breaking past the previous limits of my understanding of Windows Assembly programming. Linux programming will still be my main priority, but I didn't want to let myself be defeated by Windows.
Windows does have a ridiculous set of system calls, and the process of linking with the kernel32.dll file was the biggest pain. I have examples that work, but I can't claim to have a full understanding of how it grabs these functions from the DLL file. Linux did not require such madness, and I have no plans to do much in Windows, but sometimes it is fun while I still have one working machine with Windows for now. I will probably replace it with Linux at some point, but there is no need to rush since my other PC is still doing fine with Debian.