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
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.