Live data from Hacker News

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

iczelia.net

31–40 of 93 posts

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#31

Semi-related: Windows EXE files are runnable in DOS (at least when DOS was a thing, so for Windows 3.1x or 9x), but most of the time the DOS part just prints "This program requires Microsoft Windows." and exits. An exception is regedit.exe, that one can use to import registry values even in DOS. (Huh, although, how does it do that without using Windows API?)

> An exception is regedit.exe

This might have changed at some point. I was curious about the latter part of your question on how it made changes without the Windows API (I assumed it used an older DOS API), but my `regedit.exe` _does_ have the `This program cannot be run in DOS mode.` DOS stub in it.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#32
post #24

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

Zelda 1 was 128 kB, for those wondering, and that's without any compression. Double that for the sequel.

That honestly doesn't seem too bad. Zelda 1 is relatively large but it reuses a lot of assets and honestly probably doesn't have that much text. (More than a Mario but way less than a Dragon Warrior.)

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#33
I extracted the linux executable and was surprised to find that both readelf and objdump choke on it despite it loading and running correctly. Some investigation reveals that the name of the dynamic linker was shoved into the "unused" fields in the PT_DYNAMIC header entry to save space:

  Program Headers:
    Type           Offset             VirtAddr           PhysAddr
                   FileSiz            MemSiz              Flags  Align
    INTERP         0x0000000000000088 0x0000000000010088 0x0000000000010088
                   0x000000000000001c 0x000000000000001c         0x0
        [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
    DYNAMIC        0x00000000000000e0 0x00000000000100e0 0x6c2f343662696c2f  
Two questions:

1. Was this done manually or is there a tool you're using which does this? I see other size-reduction tricks in here as well.

2. Does anybody know of a tool for examining executables which doesn't crap out on binaries like this?

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#34
post #23

I love the idea of applications which exist in one file which you can run anywhere. I've been working towards this with my serverless platform; you can build complex data-driven apps with just one .html file and mostly declarative HTML markup (thanks to web-components which are loaded from a remote server). With modern browser features, you don't need a bundling system. Once you do away with it; a whole universe is o…

Sadly a lot of browser features are inaccessible from non-https contexts.

or you could use something like caddy (https reverse-proxy, local cert), and have a dedicated ws running in the background that serves your files

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#36
post #5

Not cross-platform, but I'm reminded of the kkrieger game for Windows which was a 96k FPS game that looked visually impressive for the time. https://web.archive.org/web/20100304155706/http://www.thepro...

From that link: Still works on modern PCs! Was able to DL and launch.

Not out of the box, though. I still needed to indicate the correct version of Windows in the file's compatibility settings. Windows XP SP3 worked like a charm.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#39
post #30
post #26

Earlier quoted context omitted.

Don't most (all?) browsers consider file:// and localhost to be secure for the sake of enabling those features? https://developer.mozilla.org/en-US/docs/Web/Security/Defens...

Unfortunately, no. CORS will block this on Chrome and Firefox. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/COR... The security risk : https://www.mozilla.org/en-US/security/advisories/mfsa2019-2... You need a local webserver. Or bundle everything in one html file.

[deleted]

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#40

I extracted the linux executable and was surprised to find that both readelf and objdump choke on it despite it loading and running correctly. Some investigation reveals that the name of the dynamic linker was shoved into the "unused" fields in the PT_DYNAMIC header entry to save space: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align INTERP 0x0000000000000088 0x0000000000010088 0x00000000000…

Choke how? Both work fine here
Post reply on HN