4 ms·
Hey, I resemble that project! Yeah, it ground to a halt due to fundamental differences in the way Linux and Windows binaries work. I'm actually now kind of sca
by david-given 12y ago
Hey, I resemble that project!
Yeah, it ground to a halt due to fundamental differences in the way Linux and Windows binaries work. I'm actually now kind of scared at how much working hackery LBW ended up containing: it'd dynamically patch the binary after trapping out at instructions manipulating things that Windows wouldn't allow access to.
(The LBW instruction patching code is here. It's entertainingly bonkers. http://sourceforge.net/p/lbw/code/ci/master/tree/src/ehandler.cc http://sourceforge.net/p/lbw/code/ci/master/tree/src/ehandle...)
Not all the horror was Windows, mind: Linux's interface to executables is barely documented and extremely fragile, involving passing a key-value table full of magic parameters on the stack after the argument and environment tables. And, of course, I'd have to replicate this otherwise glibc would crash out. (At least, I thought I did --- I cannot now find any of the actual code. Maybe I got rid of it?)
I eventually gave up because it was obviously not a tenable approach. Plus, it'd completely fail on 64-bit platforms. Dynamic recompilation is obviously a way more preferable approach. If I ever have to use Windows again, god forbid, I'm definitely checking this out.