Jump to content

[Tutorial] How to get/convert any ARM Instruction to HEX!


94 posts in this topic

Recommended Posts

Updated (edited)

Updated method: https://armconverter.com/

[hr]

This will be able to convert nearly every instruction that you need the hex for. The only annoying thing is that the hex is formatted in the way where you would type it into GDB, but everything else is great! Here's how to do it:

 

Hidden Content

    Requirements: Darwin CC Tools (855), MobileTerminal, iFile

     

    1. In /var/mobile, in iFile, create a new document called "test.s".

    2. Open up that document. Correct formatting is crucial when you do this. Here is what to type in test.s:

    start: <enter>
    <the instruction you want to convert goes here> <enter>
    

    You must make sure that everything is lowercase, there are no spaces after the instruction, and that you tap enter after you are done entering in all of the instructions you want to convert.

     

    3. Save it, and go to MobileTerminal, and log in as root.

    4. Run this command:

    as -arch armv7 test.s -o test.o
    

    Then this one:

    otool -tV test.o
    

    Here is the output if you did it correctly: http://i.imgur.com/fZdz6in.jpg

     

    After all that, otool should disassemble test.o with the hex for the instruction you want. But for some reason the hex is backwards, so you have to "make it correct".

     

    For example, if you converted BX LR and otool gave you E12FFF1E, here is how you convert it:

     

    E1 2F FF 1E
    
    Your new hex would be:
    
    1E FF 2F E1
    
    See how I just reversed the order?
    

    Another example: VSUB.F32.F64

     

    The hex otool gave you: EC 43 2B 30
    
    New hex: 30 2B 43 EC
    
    Reversed.
    

 

Hope it helped :snoop:

Updated by Rook
Guest
This topic is now closed to further replies.
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines