// HACKER NEWS — CYBERSECURITY
HelloAssembly The smallest possible complete Windows application
The smallest possible complete Windows application.
From the episode "Hello, Assembly! Retrocoding the World's Smallest Windows App in x86 ASM" on Dave's Garage:
And the follow-up episode "C vs ASM: Making the World's SMALLEST Windows App":
The goal of this project is to make the smallest possible application, without compression, that has the following features:
Please keep it readable and explain what you're doing in the comments! And the smaller, the better!
The optimizations embedded in the current code in the Lasse directory, and those applied by Crinkler in general (if used) are rather aggressive, and seem to resemble strategies applied by certain types of malware. Because of this, your virus scanner may flag the executables you build out of the source code as "suspected malware". That can make it impossible to start them, or your virus scanner can even put them in quarantine. Depending on the antivirus solution you use, you may be able to whitelist/exclude the executables to restore them and get them to work (this is known to happen with F-Secure SAFE). It's also possible that you have to temporarily disable your virus scanner altogether (which has been observed with Microsoft Defender).
If your virus scanner intervenes when you try to run the executables that come out of this repository's source code, and you don't feel comfortable with (partly) disabling your virus scanner, then don't do it. We do understand and we really won't hold it against you. :)
The code in the Lasse directory can be built with plain MASM32 11.0, which can be obtained from a number of sources. Build instructions using it are:
Crinkler is a compressing linker for Windows, specifically targeted towards executables with a size of just a few kilobytes. A copy of the tool is included in this repository in the Crinkler directory. It can also be acquired from its GitHub repository.
Crinkler requires the Windows SDK to be installed. Best (i.e. smallest) results have been achieved with version 10.0.20348.0 of the Windows 10 SDK. It, and other versions can be downloaded from the Windows SDK archive page on the Microsoft website.