alexhude / uEmu

Tiny cute emulator plugin for IDA based on unicorn.
1.11k stars 177 forks source link

ARM emulator does not support thumb mode #6

Closed wbokslag closed 6 years ago

wbokslag commented 6 years ago

Hi,

Thanks for your great plugin, it's very useful. However, it does not properly emulate ARM in thumb mode. In order to fix this, the following line should be added to the start of step_thread_main()

if get_arch()[0:3] == "arm" and GetReg(self.pc, "T"):
    self.pc |= 1

Possibly, it would be a good idea to store get_arch() in a class variable, as it is now frequently computed while it is a constant value. This negatively impacts emulation speed.

Kind regards,

Wouter

alexhude commented 6 years ago

Yep, I know, and it is not that simple, there are some corner cases. I am working on update.