Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That was awesome, but they skipped over the crucial part I'm most interested in: how the heck did they rewrite and reroute the incompatible system calls and libc functions? That's probably the hardest task of it all.

How would you go about it in the first place?

EDIT: ah, their coffsyrup tool (https://github.com/taviso/123elf/blob/main/coffsyrup.c) with help from objdump (it's more powerful that I gave it credit for) does the relocation and patching. I would have loved to read more into that part of the process.



Outside of patching, it's not that hard, it's just structure conversion at that point.

The coff tool is harder than the rewritten functions.


But where does that structure conversion code go? Into a support dynamically linked library?


Most likely, you compile the support functions into another .o, and statically link it with the modified 123.o.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: