News for hackers. Stuff that matters.
Re:αcτµαlly pδrταblε εxεcµταblε by krackers on Sunday August 23, 2020 @11:03PM (#24257218)
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ε by tbodt on Monday August 24, 2020 @01:43AM (#24257809)
It turns out to be impossible to create a file that is simultaneously a valid ELF and Windows PE. The solution to this is to make a file that is simultaneously a valid PE and shell script, and have the shell script overwrite the start of the file with an ELF header and re-exec itself.
Re:αcτµαlly pδrταblε εxεcµταblε by StavrosK on Monday August 24, 2020 @05:58AM (#24259084)
That means you can't copy the executable after executing once and have it run on Windows, correct?
Re:αcτµαlly pδrταblε εxεcµταblε by shandor on Monday August 24, 2020 @06:54AM (#24259397)
Probably the rewriting is only done on the program loaded into RAM?
Re:αcτµαlly pδrταblε εxεcµταblε by yjftsjthsd-h on Monday August 24, 2020 @09:45AM (#24260565)
No, there's a discussion upthread about running on Darwin that specifically says you have to run as `bash ./foo` first time and `./foo` thereafter because it overwrites on disk.
Re:αcτµαlly pδrταblε εxεcµταblε by StavrosK on Monday August 24, 2020 @06:55AM (#24259407)
Hmm, possibly, though that wouldn't really make sense, why not just execute itself at that point?
Re:αcτµαlly pδrταblε εxεcµταblε by krackers on Monday August 24, 2020 @02:36AM (#24258033)
Ah thank you. And I presume the qemu part is optional, used only when the target platform is non x86?
Re:αcτµαlly pδrταblε εxεcµταblε by ChrisSD on Sunday August 23, 2020 @11:16PM (#24257264)
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ε by Mathnerd314 on Sunday August 23, 2020 @11:14PM (#24257255)
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ε by reallyeli on Sunday August 23, 2020 @11:24PM (#24257289)
Re:αcτµαlly pδrταblε εxεcµταblε by Rebelgecko on Sunday August 23, 2020 @11:39PM (#24257353)
"Tunney has described Occupy Wall Street as a far-left movement.[13] Her former comrades have described her as a technocratic fascist.[14]"

Wow, although I'm not familiar with her, this wiki article seems a bit melodramatic

Re:αcτµαlly pδrταblε εxεcµταblε by jessaustin on Sunday August 23, 2020 @11:50PM (#24257398)
How on earth has that article met the "notability" threshold?
Re:αcτµαlly pδrταblε εxεcµταblε by mlindner on Monday August 24, 2020 @07:24AM (#24259586)
Well she owns/owned the Occupy Wallstreet twitter account.
Re:αcτµαlly pδrταblε εxεcµταblε by cringepirate on Sunday August 23, 2020 @11:57PM (#24257419)
I remember this person, she was on Gavin McInnes podcast quite a while ago. Here is the interview:

https://www.dailymotion.com/video/x2ke4nq

Re:αcτµαlly pδrταblε εxεcµταblε by mlindner on Monday August 24, 2020 @06:23AM (#24259208)
Listening to her talk, she seems a pretty standard run of the mill Libertarian with a blend of technocrat.
Re:αcτµαlly pδrταblε εxεcµταblε by userbinator on Monday August 24, 2020 @12:29AM (#24257524)
Reading that page, and this HN article, reminds me of a classic phrase: "There is a fine line between genius and insanity."
Re:αcτµαlly pδrταblε εxεcµταblε by GoblinSlayer on Monday August 24, 2020 @06:44AM (#24259332)
>technocratic fascist

>zealous googler

At this rate GPL2 will stand for Google Public License.