3 ms·
Can we use this to port arbitrary closed-source x86-64 binaries to a different platform (e.g. WebAssembly)?
by amelius 10y ago
Can we use this to port arbitrary closed-source x86-64 binaries to a different platform (e.g. WebAssembly)?
- dguaraglia 10y agoDecompiling isn't the hard part, it's providing all of the infrastructure the code depends on.
- amelius 10y agoWhat happens if you also decompile (and recompile) that infrastructure?
- dguaraglia 10y agoYou'll eventually hit a roadblock. It's turtles all the way down. If you translate libraries your program depends on, then you'll hit the OS API. If you manage to translate the OS, you'll have to emulate all the hardware below it. Technically it's not impossible, I guess someone could create something that translates all I/O operations into something that reads from the browser storage and renders to the screen, but the amount of work would be pretty insane. It's been done for smaller machines already, just look at any of the JavaScript based emulators like JSNES and so on.
- ceronman 10y agoStatic recompilation is not possible, even for simpler CPUs like the 6502 (NES, Apple I, etc). There are parts of the program that you will never know until you actually run it. Forget about a complex x86-64 program. Apart from that, the complexity of all the system calls made by the program is also a huge challenge as those not always have an equivalent in the new system and are really hard to match at such a low level. It is, however, not impossible. Emulators such as Dolphin do that, also combined with dynamic recompilation.