1
Programming / Detecting a jump table in ARM(Need some C help)
« on: February 04, 2013, 04:04:05 pm »
Hello!
I need to check for
LSL Rx, Rx, Rx
LDR Rx, offset
ADD Rx, Rx, Rx
LDR Rx,[Rx]
MOV PC, rX
The code I have to check is
//Code checks backwards.
if (!((get_word(ea) & 0x4680) &&// MOV PC, rX
(get_word(ea-2) & 0x6800) &&//LDR Rx,[Rx]
(get_word(ea-4) & 0x1800) &&//ADD Rx, Rx, Rx
(get_word(ea-6) & 0x4800) &&//LDR Rx, offset
(get_word(ea-8)&~0x38) == 0x0080))//LSL Rx, Rx, Rx
return 0;
If anyone could be of assistance I will be extremely grateful.
I need to check for
LSL Rx, Rx, Rx
LDR Rx, offset
ADD Rx, Rx, Rx
LDR Rx,[Rx]
MOV PC, rX
The code I have to check is
//Code checks backwards.
if (!((get_word(ea) & 0x4680) &&// MOV PC, rX
(get_word(ea-2) & 0x6800) &&//LDR Rx,[Rx]
(get_word(ea-4) & 0x1800) &&//ADD Rx, Rx, Rx
(get_word(ea-6) & 0x4800) &&//LDR Rx, offset
(get_word(ea-8)&~0x38) == 0x0080))//LSL Rx, Rx, Rx
return 0;
If anyone could be of assistance I will be extremely grateful.