2 ms·
Honestly, I think the emulator approach is a lot better -- you can do a lot more with JIT than trying to translate instructions AOT 1:1.
by Jasper_ 9y ago
Honestly, I think the emulator approach is a lot better -- you can do a lot more with JIT than trying to translate instructions AOT 1:1.
- bri3d 9y agoYeah - as evidenced by the NES story the other day, the elegance of AOT blows up completely as soon as there's any form of self-modifying code or even memory arithmetic tricks or jump tables. It's all possible to work around, but JIT is cleaner and more flexible in the long run.
- reificator 9y agoI'm fairly sure that the 360 specifically did not allow self modifying code. Makes it a good candidate for this approach.
- ZenoArrow 9y agoIn the case of self-modifying code, I wonder if the techniques behind profile-guided optimisation could work for decompilation: https://en.m.wikipedia.org/wiki/Profile-guided_optimization https://en.m.wikipedia.org/wiki/Profile-guided_optimization In other words, you create a JIT to run the executable, building a profile of the execution paths at runtime, and use that profile to guide a static decompilation process. That way it should be easier to identify the sections of self-modifying code, as well as model the behaviour of this code. The only difficulty I can see is how much time it might take to map out all the code paths, but in principal it's possible, and there may be some efficient approaches for doing so.