4 ms·
Most file formats have a magic number at offset 0. The magic numbers for EXE ("MZ"), OS X (0xfeedface/0xfeedfacf) and Linux ("\x7fELF") are all different, so th
by nneonneo 6y ago
Most file formats have a magic number at offset 0. The magic numbers for EXE ("MZ"), OS X (0xfeedface/0xfeedfacf) and Linux ("\x7fELF") are all different, so they aren't compatible.
- viraptor 6y agoNot on windows, but that depends on the OS. On Linux the handlers are pluggable via binfmt (https://en.m.wikipedia.org/wiki/Binfmt_misc https://en.m.wikipedia.org/wiki/Binfmt_misc) and this allows for example wine and .net binaries to work transparently. (I'm not aware of it, but maybe there a similar system in windows)
- pwdisswordfish4 6y agoαcτµαlly pδrταblε εxεcµταblε https://news.ycombinator.com/item?id=24256883 https://news.ycombinator.com/item?id=24256883 https://justine.storage.googleapis.com/ape.html https://justine.storage.googleapis.com/ape.html
- wizzwizz4 6y agoThe PE magic number doesn't need to be at offset zero, which is why you can do this. Mach and ELF do need to be at offset zero, so you can't have something that's Mach and ELF at the same time. In theory, this is possible, if you can recover from COM executing the header.