Live data from Hacker News

HelloAssembly: The smallest possible complete Windows application (2021)

github.com

31–40 of 53 posts

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#31

[flagged]

My how the overton window has moved. Some of violative conduct is standard practice now. > When consumers prepared to purchase a product, additional services and products including a $9.95 back-up disc and $4.95 ‘optional extended service’ plan appeared on the check-out form. The form also listed “one free year of updates” – selected by default – but the company was then authorized to automatically charge a consumer’…

But also things that are absolutely not okay:

> Inducing computer users to install software by misrepresenting that the user's computer is at risk for crashes or privacy and security invasions.

> Marketing its InternetShield software by means of a “free scan.”

> Using “buttons” in its advertisements that do not function as the user would expect them. For example, the X found in the corner of a window is normally associated with closing the window and should not open another ad. Installing software on a user’s computer that causes multiple pop-up advertisements when the user tries to close out of advertisements.

> Failing to provide a functional uninstall option for removing all software files.

> Failing to obtain a consumer’s explicit consent to purchase a product or a service.

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#32

Earlier quoted context omitted.

My how the overton window has moved. Some of violative conduct is standard practice now. > When consumers prepared to purchase a product, additional services and products including a $9.95 back-up disc and $4.95 ‘optional extended service’ plan appeared on the check-out form. The form also listed “one free year of updates” – selected by default – but the company was then authorized to automatically charge a consumer’…

But also things that are absolutely not okay: > Inducing computer users to install software by misrepresenting that the user's computer is at risk for crashes or privacy and security invasions. > Marketing its InternetShield software by means of a “free scan.” > Using “buttons” in its advertisements that do not function as the user would expect them. For example, the X found in the corner of a window is normally asso…

Yes I thought I accounted for that with my use of "some". I wasn't intending to downplay anything.

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#33
post #12

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 asse…

> 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.

no, you can also call ntdll (or even syscalls although those aren't stable), there's plenty of documentation on the internet

but also why would you, not much point except for very niche functionality

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#35

[flagged]

It's frustrating, because he does do some cool things. But I had to quit following him because of his constant yarning about how he grew up not rich and made millions from Microsoft, so young people now are stupid and lazy.

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#36
"smallest possible" is exactly one instruction; possibly 0xc3 [ret] or 0x90 [nop]; the problem lies in how you define "complete Windows application", because the answer really differs depending on if you want to make it ABI compliant. But there's nothing preventing you from creating a custom loader/executor that reads a pure binary file, maps it as exec and runs it.

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#38
post #36

"smallest possible" is exactly one instruction; possibly 0xc3 [ret] or 0x90 [nop]; the problem lies in how you define "complete Windows application", because the answer really differs depending on if you want to make it ABI compliant. But there's nothing preventing you from creating a custom loader/executor that reads a pure binary file, maps it as exec and runs it.

It should be an exe file you can double click and execute.

Re: HelloAssembly: The smallest possible complete Windows application (2021)

#39
post #12

Earlier quoted context omitted.

> 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.

no, you can also call ntdll (or even syscalls although those aren't stable), there's plenty of documentation on the internet but also why would you, not much point except for very niche functionality

> no, you can also call ntdll (or even syscalls although those aren't stable), there's plenty of documentation on the internet

I mean officially. Yes, you can find some on the internet, but nothing on the official MSDN.

> but also why would you, not much point except for very niche functionality

Exactly. Using system DLL API is backward and forward compatible, and just as standardized and well-documented as the POSIX API. I see no problem relying on it.

(Sidenote: as a bonus, MSDN is surprisingly good, understandable, well organized, lots of examples. I rarely say this, but well done MS, that's how a dev doc should be.)

Post reply on HN