As the title shows, I want to disassemble the ELF file, but I suffered a problem that I could not know which instruction is arm instruction and which is thumb instruction. Because the arm instruction is 32-bit, and the thumb instruction is 16-bit, the disassembling way is different. So how could I detect the thumb instruction from the hex instructions?
In an ELF file, there is actually a straightforward method - just look at the function addresses in the symbol table. Much like target addresses for interworking branches, the bottom bit of the symbol address indicates the relevant instruction set - clear for ARM functions, and set for Thumb functions (see section 4.5.3 of the ARM ELF ABI).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With