Pages: [1] 2
Author Topic: Reversing Siemens MSS60/MSS65 Ida Pro  (Read 24552 times)
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« on: November 05, 2015, 01:12:55 PM »

Hi Guys,

I have been working on a pet project to reverse the MSS60/MSS65 Siemens ecu binaries (both have MPC563 inside).

Unfortunately i do not have a2l or functions rahmen for either of them just some partial read ols project for mss65 (ign and inj) that was floating around the net, therefore my information is based on datasheet reading, looking at other peoples partial/full BDM/Obd reads, the stock BMW (0pa/0da) files for mss65 and reducing/deducting with some common sense (might have applied it badly Wink )

According to my research the memory map of mss60/65 should look like this:

MSS65 ignition:

ROM/Flash sections:
  • boot: 0-0xffff (has checksum) also seems to have VIN and some other diffs to mss65 injection bootloader
  • application code: 0x10000-0x6db8e
  • calibration code: 0x70000-0x7ffff (has checksum)
  • application code: 0x450000-0x4a5580 (has checksum which covers total application area)

RAM sections:
  • BCC_DECRAM: 0x2f8000-0x2f8800
  • CALRAM: 0x3f8000-0x400000

I split and combined some binaries and was able to get (almost) a full set imported into Ida, i am however not sure about what section might be missing? It seems other similar ecu's (like msd80) deployed some shadowing of ROM and/or EEPROM in SRAM.  

I followed the following procedure in case anyone would like to replicate:

Step 1 : Open ida and press work on your own
setp 2 : Drag and drop mssXX boot binary -> mss65_ign_boot-0x0-0xffff.bin
step 3 : click select PowerPc big-endian (ppc) cpu
step 4 : Set button
Step 5 : Click processor options
step 6 : Click and enter toc & Sda Address
    Toc address : 0x5c9ff0
    Sda address : 0x7ffff0
    Mmio base: 0x0   
step 7 : Click ok and ok
Step 8 : On the memory organization window insert ram and rom values
    Ram : 0x2f8000 Size : 0x800 (BCC_DECRAM)
    Rom : 0x000000 Size : 0x80000
    Loading address : 0x000000 size : 0x10000
Step 9 : Choose device name: mpc5xx, Press ok and ok
Step 10: Click on file -> Load file -> load additional binary -> mss65_ign_appl-0x10000-0x6db8e.bin
Step 11: Insert Load segment : 0x0 (in paragraphs)
      Loading offset : 0x10000
      File offset in bytes : 0x0
      Number of bytes : 0x0 (max load)
Step 12: Click on file -> Load file -> load additional binary -> mss65_ign_calibr-0x7000-0x7ffff.bin
Step 13: Insert Load segment : 0x0 (in paragraphs)
      Loading offset : 0x70000
      File offset in bytes : 0x0
      Number of bytes : 0x0 (max load)
Step 14: Click on file -> Load file -> load additional binary -> mss65_ign_appl-0x450000-0x4a5580.bin
Step 15: Insert Load segment : 0x45000 (in paragraphs)
      Loading offset : 0x0
      File offset in bytes : 0x0
      Number of bytes : 0x0 (max load)
Step 16: Add another segment RAM (CALRAM):
    Ram : 0x3f8000 - end 0x400000
step 17: Reanalyze program

I have attached my mss65_ign_total_wip.idb hopefully you guys can point out what i have missed.

I am currently unsure about the addresses of:
  • Toc address : 0x5c9ff0
  • Sda address : 0x7ffff0
  • Mmio base: 0x0

I would be very thankful if some Ida master could tell me if i am on the right track or if not educate me (and the group) on how todo it better.
Thanks in advance for any feedback you can provide,

Best regards, Dave
« Last Edit: November 14, 2015, 03:33:02 AM by Dave205t » Logged
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #1 on: November 14, 2015, 03:46:04 AM »

Progress updates from my side, so far so good:

* my spare test ecu mss60 arrived for on bench testing, huuray!
* wrote a program to dump both MPC563 (ignition and injection) processors memories (internal and external flash)
* corrected the memory segments a bit in Ida, located and analyzed all checksum related code and wrote a program to correct those in all sections

Todo:

* disable EWS on the bench ecu to have full functionality
* extend my mss6x flash reader to also be able to write back the changes (without increasing flash counter)
* should be able to solve both after some more code analysis.

Best regards, Dave
Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #2 on: December 06, 2015, 10:30:59 PM »

Progress updates from my side, so far so good:

* my spare test ecu mss60 arrived for on bench testing, huuray!
* wrote a program to dump both MPC563 (ignition and injection) processors memories (internal and external flash)
* corrected the memory segments a bit in Ida, located and analyzed all checksum related code and wrote a program to correct those in all sections

Todo:

* disable EWS on the bench ecu to have full functionality
* extend my mss6x flash reader to also be able to write back the changes (without increasing flash counter)
* should be able to solve both after some more code analysis.

Best regards, Dave

Well done, and thanks for sharing!
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #3 on: December 13, 2015, 04:16:15 AM »

Well done, and thanks for sharing!
Thanks!

Some more updates:

* my checksum program was missing RSA/md5 signature correction functionality after some head scratching am now able to verify and correct those.
* untangled the seed/key algorithm, have auth level 3 access for all seeds on both mss60 and mss65.
* updated IDA ppc.cfg with a specific configuration for the mpc563 covering all the peripherals, memory mapped io registers and peripheral ram buffers (in separate sections) also auto adds some common Reset and ISR entry points.

Still working on disabling EWS so i can do some more tests on bench, if anyone has any information on hints on this how to proceed i would be very grateful. Untangled a great deal of the ppc asm but have so far not been able to pinpoint the EWS related bit.

Best regards, Dave



Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #4 on: December 13, 2015, 05:32:25 AM »

Thanks!

Some more updates:

* my checksum program was missing RSA/md5 signature correction functionality after some head scratching am now able to verify and correct those.
* untangled the seed/key algorithm, have auth level 3 access for all seeds on both mss60 and mss65.
* updated IDA ppc.cfg with a specific configuration for the mpc563 covering all the peripherals, memory mapped io registers and peripheral ram buffers (in separate sections) also auto adds some common Reset and ISR entry points.

Still working on disabling EWS so i can do some more tests on bench, if anyone has any information on hints on this how to proceed i would be very grateful. Untangled a great deal of the ppc asm but have so far not been able to pinpoint the EWS related bit.

Best regards, Dave






Applause mate, how did you figure out the TOC?  I'll take a look but does R13 stuff line up?

RSA can you expand on that as this will of interest?
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #5 on: December 13, 2015, 05:33:38 AM »

Meh can't open IDB, which version do you use?
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #6 on: December 13, 2015, 06:02:24 AM »

Meh can't open IDB, which version do you use?
I'm using some cracked version: Version 6.6.141224 (32-bit) simply cannot afford the real thing, this is merely a hobby for me.

Best regards, Dave
Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #7 on: December 13, 2015, 06:36:21 AM »

ok you have pm
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #8 on: December 13, 2015, 07:05:13 AM »

I don't see any TOC instructions slightly different CPU to MED9/ME9? where is it set?

Edit:  TOC looks messed up
« Last Edit: December 13, 2015, 07:08:12 AM by dream3R » Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #9 on: December 13, 2015, 07:14:13 AM »

I don't see any TOC instructions slightly different CPU to MED9/ME9? where is it set?
Edit:  TOC looks messed up
I have not looked into the SDA and TOC setup any more, they are still setup improperly. Any hints from your side on how to set them up ?
Edit: So far have not needed to have them absolutely correct to find all the current references (RAM/ROM).
« Last Edit: December 13, 2015, 07:16:56 AM by Dave205t » Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #10 on: December 13, 2015, 07:25:20 AM »

I think the binary is incomplete as you mentioned.  I'll try and find something.

RE RSA where did you find that about?

Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #11 on: December 13, 2015, 07:30:43 AM »

RE RSA where did you find that about?
Do you mean the RSA signatures blocks themselves or the code the calculate/check (take care it is split over a zillion subroutines) ? It was a lot of work to figure everything out (since i only had the disasm to work with).
Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #12 on: December 13, 2015, 07:31:29 AM »

TDo you mean the RSA signatures blocks themselves or the code the calculate/check (take care it is split over a zillion subroutines) ? It was a lot of work to figure everything out (since i only had the disasm to work with).


The latter, the code, I've been there to lol
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Dave205t
Newbie
*

Karma: +3/-0
Offline Offline

Posts: 11


« Reply #13 on: December 13, 2015, 07:45:54 AM »

The latter, the code, I've been there to lol
PM sent.
Logged
dream3R
Hero Member
*****

Karma: +18/-8
Offline Offline

Posts: 1194


« Reply #14 on: December 13, 2015, 08:02:26 AM »

I got hold of a bin and believe the TOC to be 0x78280
Logged



How to work out values from an A2L Smiley

http://nefariousmotorsports.com/forum/index.php?topic=5525.msg52371#msg52371


Starting Rev's http://nefariousmotorsports.com/forum/index.php?topic=5397.msg51169#msg51169

noobs read this before asking http://nefariousmotorsports.com/forum/index.php?topic=9014.0title=


ORGORIGINAL 05 5120 creator for Volvo
ORIGINAL Datalogger (Freeware) Author
ORGINAL finder of the 'extra' torque' limits
I don't have ME7.01 A2L I just use ID
Pages: [1] 2
  Print  
 
Jump to:  

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