News for hackers. Stuff that matters.
Re:On self-modifying executables in Rust by mimimi31 on Friday January 28, 2022 @06:57PM (#30122201)
I think Cosmopolitan[1] is a beautiful example for self-modifying executables.

> Cosmopolitan Libc makes C a build-once run-anywhere language, like Java, except it doesn't need an interpreter or virtual machine. Instead, it reconfigures stock GCC and Clang to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS with the best possible performance and the tiniest footprint imaginable.

> Please note that your APE binary will assimilate itself as a conventional resident of your platform after the first run, so it can be fast and efficient for subsequent executions.

[1] https://github.com/jart/cosmopolitan

Re:On self-modifying executables in Rust by nicoburns on Friday January 28, 2022 @07:23PM (#30122378)
It's a technical hack to solve an organisation problem though. The correct solution is a standard format for fat binaries that's supported everywhere.
Re:On self-modifying executables in Rust by lostcolony on Friday January 28, 2022 @07:36PM (#30122457)
It's an achievable hack. Your "correct solution" is unachievable.
Re:On self-modifying executables in Rust by saagarjha on Saturday January 29, 2022 @04:15AM (#30124967)
APE is fundamentally broken on pretty much every platform that isn’t Linux because of baked-in ABI.