Everyone. My name is Stephen. Recently I got a rub to change mach-o’s architecture from ‘arm7’ to ‘arm64’. Is there anyone who did this job before. It would be a great pleasure to hear any suggestions from any u guys. How can I map the two instruction sets, and run successfully the old program in a new machine?
Thank you for your reply. I got the idea to translate, but I found it is a little hard to combine the two engines to target the job. Do I need to read the sources more carefully and write something based on them, or is there any possible less time consuming way to make them work?
Yep. It’s so hard and time-consuming that there are no publicly available tools for now, afaik. It’s gonna take you ridiculous amount of time to achieve this. So why don’t you just use armv7 on arm64 ,it’s backward compatible
First you gonna need a MachO parser to extract __TEXT,__text, then throw everything inside CSE, rewrite assembly-> calculate arm64 instructions and write the new instruction back->Patch MachO headers.
A more convenient approach to this is PROBABLY by using LLVM.
Convert assembly to LLVM-IR (also quite an effort), probably will have to SSA-ify it, and use LLVM to re-compile
tl;dr: this is ridiculous, you should probably just ignore it
EDIT:
These are only for your reference, the general idea should work however I’m 99.99% sure you’ll run into various issues, and that’s exactly why I call this “job” bullshit
Thank you for your reply. No means to offend, but I just wanna to update the binary, since I have put considerable time into solving this problem. If it possible, then later, maybe translating it into other architectures is also possible.