Mapping code vs. data areas
Use a commented disassembly to help navigate the new binary
At this point we have an initial symbol file (ECU.sym
) and need to start looking at a reference disassembly to guide us. Luckily we have the famous E391/E392 disassembly by Christian/christi999@hotmail.com to use as an example!
Remember our symbol file so far
Getting back to our partial disassembly, let's take a look where we hit the data area earlier and see if we can sort things out a little, as there is still a bunch of code to be uncovered.
Since the addresses are shifted around we can't just go to the same line in the commented E391/E392 listing. Instead we can poke around a bit. Lets use the last operation before RTS
and see if we can find anything familiar. Copy the bytes D7 EE
from line E0D8
and do a text search in the commented listing. Only one match! What great luck.
Look at that! On line E520
we have the match, and around it all the bytes match up! First lets change the place holder label moredata
to the actual table name. In our symbol file we change data E0DB moredata
to:
Re-run the disassembler and it is labeled properly! If we look in the commented listing file, we see there are two more small data tables before returning to code. Match the bytes from the commented listing file. Update the symbol file as necessary, add the following lines:
Result:
Getting back to code
Since we know where t_obdInjMask
ends we can resume code disassembly after it. Add to the symbol file:
Running it again we get a bunch of new code! However we have landed on another invalid OP code. After some more byte sleuthing we find another small data area t_errCodeShift
followed immediately by L_heartBeat
. Update the symbol file accordingly:
Rinse and repeat a final time
Finally the disassembler ends with the vector table and we should have all the code and data areas mapped!
Last updated
Was this helpful?