Reputation: 448
I have a old game running on a 32-bit EXE and couple of DLLs. I would like to convert it to 64-bit in order to allocate more memory space. Is it possible to convert it to 64-bit without the source code? And how much work would that takes?
Upvotes: 0
Views: 480
Reputation: 21319
Aside from decompiling a binary to C or C++ using the usual tools, it appears what you are indeed looking for is code-lifting. There are tools like McSema, anvill/remill and several more that will assist in converting the machine code to LLVM-IR. Here's an example with visuals.
Technically — if this is done well and there are no issues — you could feed that back to LLVM to emit code for the desired target. Linking that into a binary may still be an intricate task, however.
Now, this sounds easier than it probably ends up being, because in the past — without the duality or 32-bit and 64-bit — much software was written without regard to issues that would only become obvious when trying to port the code. These issues are likely to be present in whatever old 32-bit code you have at hand and they will likely require manual adjustments by you.
PS: other terms to look for are recompilation and static recompilation. PPS: this question and subsequent ones may be better suited for RE.SE
Upvotes: 1
Reputation: 1613
If the game executable is not encrypted, it is possible to decompile it into assembler code. Some tools like IDA even have plugins to decompile into C.
However, even if you succeed in doing that, said code would not compile without extensive manual fixing (machine decompilation is still far from perfect).
Next obstacle would be the sheer size — between half a million and perhaps ten million lines would be a reasonable estimate for a typical AAA title. For older games you would be lucky if you end up with less than ten thousand lines.
Furthermore, you would still have to change all pointer arithmetic in the code and all game data structures to use 64-bit values which means also editing all resource files which are directly deserialized into memory structures.
Impossible to do? Probably not if you have the required knowledge of reverse engineering and a lot of free time on your hands.
It would be a monumental undertaking and there would be no guarantee that it would work correctly if at all.
Upvotes: 1