PELF
- 4 Devlogs
- 5 Total hours
A file format and utility which produces a binary that can run natively on both Windows and Linux!
A file format and utility which produces a binary that can run natively on both Windows and Linux!
OK SO it turns out i had two bugs that went unnoticed
apparently, the windows version was writing the stub in a way that the linux shell couldnt read because for some STUPID reason, windows’ version of printf interperets ‘\n’ as \n\r
which of course sh couldn’t properly interpret so the windows version of the pelf tool just didnt work
luckily if you tell printf the file is binary then it wont mess it up
secondly, i was overwriting the output file without clearing it first so there was arbitrary data at the end of it when i was testing the windows bug
since the stub operates off of a tail command that extracts the last N bytes of the file to use as the linux program, if the file has extra data at the end than the program wont be cut out properly and thus cant run, even though sometimes it was only 14 bytes off
luckily i just fixed that by specifying that the file needs to be truncated to zero bytes upon opening
and with that the two bugs are done! everything should (hopefully) be working now
see below: me desperately recompiling the windows version as i have the output open in a hex editor
so uhh the only change i made is that the readme now specifies that you need write perms in the current directory and that took like a month or two :3
Finished up the README, compiled with optimizations, and uploaded the GitHub release so it’s now ready for shipping!
I accidentally coded until 3AM and did the whole project…
But it works! I need to test it some more and flesh out the README, but otherwise it’s mostly done! Still can’t believe I managed to fit that shell script under 60 bytes…