Closed 2over12 closed 1 year ago
There's an additional issue here in how we compute the patch expressions for sleigh files. We assume we can compute the address of inst_next
given the value in PC, but we do it using inst_last, in reality regardless of the instruction size this should be -4 on thumb and -8 on arm which requires determining what mode, this will require another macro
replacing all context reg references with a known constant is too naive, we need to just assign the entry value then lift the register like normal. A better way to do this is to allocate the local context reg as a pointer, store the assumed constant, then lift
Should really integrate TestLifting.cpp from ARM and PPC but Im pressed for time at the moment.
Since we group preffix suffix instructions using the current instruction size to work out the mode was buggy https://github.com/lifting-bits/remill/blob/b677387f6f7507193ddd4e3c9a2ec8bc2da94fc0/lib/Arch/Sleigh/Thumb2Arch.cpp#L48
instead this passes down the decoding context to figure out where PC should be