Pages: [1]
Author Topic: How are maps referenced in code?  (Read 9209 times)
zibbo
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 12


« on: June 30, 2011, 02:57:08 AM »

Hi everybody,

For example I have ECU (http://nefariousmotorsports.com/forum/index.php/topic,744.msg6306.html#msg6306) and XDF (http://nefariousmotorsports.com/forum/index.php/topic,430.msg2912.html#msg2912) files that look like match each other, but when I load the binary to IDA it doesn't show me any references to maps defined in the XDF file. Can anybody make at leasst a hint of where to start looking at to track a reference from a known map to a code that uses it?

Thanks in advance.
« Last Edit: June 30, 2011, 03:37:52 AM by zibbo » Logged
ArgDub
Full Member
***

Karma: +60/-1
Offline Offline

Posts: 202


« Reply #1 on: June 30, 2011, 08:27:17 AM »

I'm not immersed in this stuff, but I think you should read about the DPP addressing mechanism.

While I'm here, with the dpp1 set at 0x205 the highest addressed position would be 0x817FFF, I'm right? If so, what addressing mode is used for the maps beyond 0x817FFF position?
Logged
zibbo
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 12


« Reply #2 on: July 01, 2011, 03:48:13 AM »

DPP addressing mechanism is only a programmatic way to refer to some data, there are other way of doing so as well, e.g. using EXTP, EXTS etc, in fact you can just change a DPP register need, access data, then restore DPP.

I have found some info here http://motronic.ws/maptable3.htm, but not sure it is applicable to mored ECUs, I just couldn't replicate it. If at least someone could say if this is true for modern ECUs or note, that would be a huge help.

Thanks.
Logged
gremlin
Hero Member
*****

Karma: +196/-9
Offline Offline

Posts: 653


« Reply #3 on: July 01, 2011, 04:50:11 AM »

ME7 ECUs using various methods to referencing maps.
Direct, index tables e.t.c
Below is direct (page number + offset) reference example:

seg002:0087CB8A                 mov     word_A3E2, r4
seg002:0087CB8E                 jnb     word_FDA8.8, loc_87CBA6 ; knock flag
seg002:0087CB92                 mov     r12, #33EEh      ; LDRXNZK 16x1 81F3EEseg002:0087CB96                 mov     r13, #207h      ; addr of map descriptor
seg002:0087CB9A                 mov     r14, RPM_16bit  ; rpm
seg002:0087CB9E                 calls   82h, Map2D_16bit
seg002:0087CBA2                 mov     r9, r4
seg002:0087CBA4                 jmpr    cc_UC, loc_87CBB8
seg002:0087CBA6 ; ---------------------------------------------------------------------------
seg002:0087CBA6
seg002:0087CBA6 loc_87CBA6:                             ; CODE XREF: sub_87CB6A+24j
seg002:0087CBA6                 mov     r12, #33ACh      ; LDRXN 16x1 81F3ACseg002:0087CBAA                 mov     r13, #207h      ; addr of map descriptor
seg002:0087CBAE                 mov     r14, RPM_16bit  ; rpm
seg002:0087CBB2                 calls   82h, Map2D_16bit
seg002:0087CBB6                 mov     r9, r4
seg002:0087CBB8
seg002:0087CBB8 loc_87CBB8:                             ; CODE XREF: sub_87CB6A+3Aj
seg002:0087CBB8                 movbz   r4, byte_8ACE

 
Logged
ArgDub
Full Member
***

Karma: +60/-1
Offline Offline

Posts: 202


« Reply #4 on: July 01, 2011, 06:16:19 PM »

so, you calculate: map_page as (MAP_ADDRESS / PAGE_SIZE) and map_offset as (MAP_ADDRESS % PAGE_SIZE), rigth? If map_page equals 204h or 205h then dpp0 or dpp1 is used respectively. When the page isn't dpp0 or dpp1, indirect addressing is used?

You named a function Map2D_16bit, is there a function for every type of map? like single_8, single_16, ... , Map2D_8bit, Map2D_16bit.
« Last Edit: July 02, 2011, 12:58:11 AM by ArgDub » Logged
zibbo
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 12


« Reply #5 on: July 03, 2011, 08:27:09 AM »

Thanks, Gremlin! It made me think that in order to find all maps I need just to disassemble everything and understood every line of code! If I start right now hope I will be done by next year Wink
Logged
gremlin
Hero Member
*****

Karma: +196/-9
Offline Offline

Posts: 653


« Reply #6 on: July 03, 2011, 09:43:45 AM »

Thanks, Gremlin! It made me think that in order to find all maps I need just to disassemble everything and understood every line of code! If I start right now hope I will be done by next year Wink

Who say that knowing all is easy as 1,2,3.... ??  Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.017 seconds with 17 queries. (Pretty URLs adds 0s, 0q)