improvements I made to the arm.w32 module
updated module can be downloaded here: arm.w32
this module is for IDA 4.60 SP1.
since I added several macro instructions, it may not be back or forward compatible
with real arm.w32 versions from datarescue.com.
ana.cpp
- tried to add call to construct_macro to ana_thumb, but this causes a hang in the ida kernel.
- construct_macro now also works (in theory) for thumb instructions
ARM_mov
+ ARM_orr
or ARM_lsl
now also generate ARM_movl
ARM_mvn
now also generates a ARM_movl
-> result can now correctly be used as FP offset.
- instruction type of construct_macro result is changed from ARM_mov to ARM_movl
- added '
ARM_swbkpt
' for wince debugger break 0xe6000010 opcode
- in ldrh_common: changed referenced data from dt_dword to dt_word.
MOV LR,PC + MOV PC, ...
now generates a 'CALL ...
' instruction
emu.cpp
- added helper functions: is_sub_rn_sp, is_stmfdsp, isregopnd
- trace_sp: both add and sub are now handled by the same code.
- trace_sp: besides sp=sp+-#imm, now also MOV/LDR Rx,val + sp=sp+-Rx
are processed.
- trace_sp: detect varargs STMFD, and don't do add_stkpnt for it.
- find_ldr_value: movl is now also recognized ->
MOV R12, #0x100 |
ORR R12, R12, #0x4 | -> | MOVL R12, #0x104 |
SUB SP, R12 | | SUB SP, R12 |
- better jumptable tests, now checks if bound is < or <=
- also more types of jumptables are detected.
- create_func_frame now recognizes many more types of stackframes.
- fixed ARM_push and ARM_pop: SP was offset in the wrong direction.
- ARM_ldr was incorrectly assumed to always be dword.
- added test for T reg in is_jump_func, to distinguish between thumb and arm mode.
- shouldn't emu() return cmd.size? insteadof '1'?
- is_sp_based, now traces back to see if the register was loaded from SP.
- framepointer setup "ADD FP, SP, #imm" is no longer converted to stackvar.
- arm_get_frame_retsize now always returns 0.
- added detection for thumb aligns, may not work, have not seen an affect from this.
- added 'is_thumb_glue' to get_glue_target. may not work, have not really seen an effect from this.
ins.cpp, ins.hpp
- added SWBKPT mnemonic for Windows CE debugger trap instruction.
out.cpp
- comments are generated for targets of jumptables.
- in outop, case o_mem, added support to display halfword with ldr Rx,=0x1234
reg.cpp
- notification handler ph.setsgr, will incorrectly assume
a thumb 'BL' instruction to be code32, but just checking it's code size.