Live data from Hacker News

αcτµαlly pδrταblε εxεcµταblε

justine.storage.googleapis.com

11–20 of 309 posts

Re: αcτµαlly pδrταblε εxεcµταblε

#12
Can someone eli5 how this works? I sort of get that you can create one big binary file with all the necessary file headers for each platform and the actual x86 code being shared, but what about stuff like syscalls? The post also lost me when it started mentioning the need for shell scripts and emulators.

Re: αcτµαlly pδrταblε εxεcµταblε

#14
Is hosting web URLs at storage.googleapis.com a thing? After finding a persistent phishing campaign using it, I ended up restricting it from being loaded in the web browser in my environment. (Embedded images from it, like on blog.google, still work.)

This is the first time I've seen a legitimate website with one of these URLs.

Re: αcτµαlly pδrταblε εxεcµταblε

#15

Can someone eli5 how this works? I sort of get that you can create one big binary file with all the necessary file headers for each platform and the actual x86 code being shared, but what about stuff like syscalls? The post also lost me when it started mentioning the need for shell scripts and emulators.

He talks about it a bit as the "magic numbers". You can see the big table: https://github.com/jart/cosmopolitan/blob/c91b3c50068224929c...

I guess there's also syscall emulation stubs for Windows but since he only supports "stdio and sockets" maybe not.

Re: αcτµαlly pδrταblε εxεcµταblε

#16
I believe that scripts without a shebang line cannot be executed by execve. They will only run if the shell sees them before the kernel does. It's an annoying limitation of this approach and it wasn't clear to me whether this technique includes a workaround for this. Also the push for code signing everywhere is going to make this harder in the future as well. (I heard a rumor that the workaround to run unsigned executables on macOS no longer works when running on Apple Silicon.) Otherwise, I love it!

My approach was slightly different; I created a polyglot script header you can paste at the beginning of a C source file to make it essentially a C script which is just-in-time compiled when it is executed. Works on Windows, Linux, and Mac as long as a C compiler is installed. https://gist.github.com/jdarpinian/6860ddfd92b5b458a20ab6055...

Re: αcτµαlly pδrταblε εxεcµταblε

#17

Can someone eli5 how this works? I sort of get that you can create one big binary file with all the necessary file headers for each platform and the actual x86 code being shared, but what about stuff like syscalls? The post also lost me when it started mentioning the need for shell scripts and emulators.

You can read more in the libc source. The readme gives an overview.

https://github.com/jart/cosmopolitan/tree/master/libc

Re: αcτµαlly pδrταblε εxεcµταblε

#19

Can someone eli5 how this works? I sort of get that you can create one big binary file with all the necessary file headers for each platform and the actual x86 code being shared, but what about stuff like syscalls? The post also lost me when it started mentioning the need for shell scripts and emulators.

He talks about it a bit as the "magic numbers". You can see the big table: https://github.com/jart/cosmopolitan/blob/c91b3c50068224929c... I guess there's also syscall emulation stubs for Windows but since he only supports "stdio and sockets" maybe not.

The author is a "she": https://en.wikipedia.org/wiki/Justine_Tunney
Post reply on HN