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.
- Linux: "./snake.com: line 20: lzma: command not found". Installing the xz package makes it work (already had XWayland enabled so X11 worked, but may be needed if you have a strict Wayland session).
- Windows: As either .com or renaming to .exe I get "The application was unable to start correctly (0xc0000005). Click OK to close the application." Not sure how to make this one work, it's definitely not AV related though (I have that stripped in this sandbox VM).
Edit: Got it working in all 3 now. On Windows I still had DEP enabled on all programs to test some apps earlier, turning that back off allowed it to launch.
Hmm, Windows 11 25H2 here as well. Redbean works so there must be something about this particular approach combined with some unknown setting on my install.
If you mean lzma it wasn't immediately apparent to me it was a binary requirement, but inspecting the hex dump at the end + the message is how I figured out it was. I wonder how much space you lose dropping lzma and doing some other method as "tail -c+4294 $0|head -c 5061|lzma -dc>/tmp/a;chmod +x /tmp/a;(/tmp/a&rm /tmp/a);exit" would be more universal and the linux portion isn't all that big.
If you mean the .html rename or whatever my Windows problem was, I must be missing it. Edit: Windows was DEP.
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?)
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 opened up.
The ability to load .html files over the file:// protocol is a powerful, often neglected feature. In practice, it means you can double-click an HTML file and it runs an app in your browser instantly.
Now I wonder when the first polyglot file was published. I kinda just assumed they'd been around forever. EICAR.COM comes to mind as a COM/plaintext polyglot
sure but they have a blog and a webserver that's serving html. just put the .html version there so i dont have to download anything or mess about too much. just want to click and see it
I think you can use something similar to get the entire page contents as a blob, but I never tested with binary data in actual browsers. Perhaps even patch it to avoid the initial windows error.
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.
For me:
- Browser: works after renaming to .html
- Linux: "./snake.com: line 20: lzma: command not found". Installing the xz package makes it work (already had XWayland enabled so X11 worked, but may be needed if you have a strict Wayland session).
- Windows: As either .com or renaming to .exe I get "The application was unable to start correctly (0xc0000005). Click OK to close the application." Not sure how to make this one work, it's definitely not AV related though (I have that stripped in this sandbox VM).
Edit: Got it working in all 3 now. On Windows I still had DEP enabled on all programs to test some apps earlier, turning that back off allowed it to launch.
Works for me on Windows 11
Hmm, Windows 11 25H2 here as well. Redbean works so there must be something about this particular approach combined with some unknown setting on my install.
Edit: Got it working, was DEP.
If I ran it with just
... then it would try to use Mono to launch it: But, running it explicitly with Bash works: Pretty nifty but doesn't work out of the box on any Linux, at least :p Running Debian 13.> ... then it would try to use Mono to launch it:
That's because of the binfmt handler that Mono installs which matches the PE header.
its written in the post
If you mean lzma it wasn't immediately apparent to me it was a binary requirement, but inspecting the hex dump at the end + the message is how I figured out it was. I wonder how much space you lose dropping lzma and doing some other method as "tail -c+4294 $0|head -c 5061|lzma -dc>/tmp/a;chmod +x /tmp/a;(/tmp/a&rm /tmp/a);exit" would be more universal and the linux portion isn't all that big.
If you mean the .html rename or whatever my Windows problem was, I must be missing it. Edit: Windows was DEP.
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?)
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.
The source code is available as well: https://github.com/jaromil/kkrieger-werkkzeug3
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 opened up.
The ability to load .html files over the file:// protocol is a powerful, often neglected feature. In practice, it means you can double-click an HTML file and it runs an app in your browser instantly.
Sadly a lot of browser features are inaccessible from non-https contexts.
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.
One of the interesting things about Polyglot is that nobody did it any sooner. It would have been feasible a decade ago or two ago.
Now I wonder when the first polyglot file was published. I kinda just assumed they'd been around forever. EICAR.COM comes to mind as a COM/plaintext polyglot
https://js13kgames.com/
Wonder why they don't give a demo/link to the browser version
It's the same file, you just rename it to end in '.html'
sure but they have a blog and a webserver that's serving html. just put the .html version there so i dont have to download anything or mess about too much. just want to click and see it
Very clever!
Quite cool.
You could distribute it as `.html` only, and use JS to offer a local download link to itself in the correct extension. A polyglot installer, of sorts.
For example, this gist is an HTML that, when opened, offers a download zip of its DOM in whatever state it currently is:
https://gist.github.com/alganet/c904acb57282402fc0bd724f1eeb...
I think you can use something similar to get the entire page contents as a blob, but I never tested with binary data in actual browsers. Perhaps even patch it to avoid the initial windows error.
Can't you do that with a language model in less than one paragraph of instructions? Seems like overkill.
I sincerely hope this type of comment isn't going to become commonplace in the future. Especially when it's someone's hobby project or labour of love.