cracking the ecu....
#241
Hmm entry points...
ok well there's plenty of denso tags in hex.
05800
36 30 45 30 46 37 30 30-20 20 20 20 20 20 20 20 "60E0F700 "
20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 " "
05 01 25 43 6F 70 72 2E-44 45 4E 53 4F 32 30 30 "%Copr.DENSO200"
07320
070670
willing to bet it's near one of them.
honestly i know jack about sh. I'm assuming all the jumps for r1,r2 etc.. are for it.
ok well there's plenty of denso tags in hex.
05800
36 30 45 30 46 37 30 30-20 20 20 20 20 20 20 20 "60E0F700 "
20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 " "
05 01 25 43 6F 70 72 2E-44 45 4E 53 4F 32 30 30 "%Copr.DENSO200"
v` v8Copyrigh"
74 20 31 39 39 39 20 48-69 74 61 63 68 69 2C 4C "t 1999 Hitachi,L"
74 64 2E 48 69 74 61 63-68 69 20 56 65 68 69 63 "td.Hitachi Vehic"
6C 65 20 4F 70 65 72 61-74 69 6E 67 20 53 79 73 "le Operating Sys"
74 65 6D 20 66 6F 72 20-53 48 2D 32 20 4F 70 65 "tem for SH-2 Ope"
72 61 74 69 6E 67 20 53-79 73 74 65 6D 2C 20 50 "rating System, P"
72 6F 64 75 63 74 20 56-65 72 73 69 6F 6E 20 56 "roduct Version V"
32 2E 31 41 20 31 39 39-39 48 69 74 61 63 68 69 "2.1A 1999Hitachi"
20 56 65 68 69 63 6C 65-20 4F 70 65 72 61 74 69 " Vehicle Operati"
6E 67 20 53 79 73 74 65-6D 20 66 6F 72 20 53 48 "ng System for SH"
2D 32 20 4F 70 65 72 61-74 69 6E 67 20 53 79 73 "-2 Operating Sys"
74 65 6D 2C 20 50 72 69-76 61 74 65 20 56 65 72 "tem, Private Ver"
73 69 6F 6E 20 56 32 2E-31 41 2E 30 30 20 31 39 "sion V2.1A.00 19"
39 39 FF FF 2F 56 4F 22-7F FC 2F 86 2F 96 2F A6 "99 /VO"n/å/û/ª"
74 20 31 39 39 39 20 48-69 74 61 63 68 69 2C 4C "t 1999 Hitachi,L"
74 64 2E 48 69 74 61 63-68 69 20 56 65 68 69 63 "td.Hitachi Vehic"
6C 65 20 4F 70 65 72 61-74 69 6E 67 20 53 79 73 "le Operating Sys"
74 65 6D 20 66 6F 72 20-53 48 2D 32 20 4F 70 65 "tem for SH-2 Ope"
72 61 74 69 6E 67 20 53-79 73 74 65 6D 2C 20 50 "rating System, P"
72 6F 64 75 63 74 20 56-65 72 73 69 6F 6E 20 56 "roduct Version V"
32 2E 31 41 20 31 39 39-39 48 69 74 61 63 68 69 "2.1A 1999Hitachi"
20 56 65 68 69 63 6C 65-20 4F 70 65 72 61 74 69 " Vehicle Operati"
6E 67 20 53 79 73 74 65-6D 20 66 6F 72 20 53 48 "ng System for SH"
2D 32 20 4F 70 65 72 61-74 69 6E 67 20 53 79 73 "-2 Operating Sys"
74 65 6D 2C 20 50 72 69-76 61 74 65 20 56 65 72 "tem, Private Ver"
73 69 6F 6E 20 56 32 2E-31 41 2E 30 30 20 31 39 "sion V2.1A.00 19"
39 39 FF FF 2F 56 4F 22-7F FC 2F 86 2F 96 2F A6 "99 /VO"n/å/û/ª"
070670
4E 33 5A 32 45 42 49 57-2E 5A 30 35 00 00 00 00 "N3Z2EBIW.Z05...."
0C 36 30 45 30 46 37 30-30 20 20 20 20 20 20 20 "60E0F700 "
20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 " "
20 05 01 25 43 6F 70 72-2E 44 45 4E 53 4F 32 30 " %Copr.DENSO20"
30 30 53 53 57 2D 4E 33-5A 32 45 50 30 30 30 2E "00SSW-N3Z2EP000."
48 45 58 00 00 00 00 00-00 00 00 30 46 37 30 30 "HEX........0F700"
0C 36 30 45 30 46 37 30-30 20 20 20 20 20 20 20 "60E0F700 "
20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 " "
20 05 01 25 43 6F 70 72-2E 44 45 4E 53 4F 32 30 " %Copr.DENSO20"
30 30 53 53 57 2D 4E 33-5A 32 45 50 30 30 30 2E "00SSW-N3Z2EP000."
48 45 58 00 00 00 00 00-00 00 00 30 46 37 30 30 "HEX........0F700"
honestly i know jack about sh. I'm assuming all the jumps for r1,r2 etc.. are for it.
#242
Is this title ok?
Originally Posted by Aseras
Hmm entry points...
ok well there's plenty of denso tags in hex.
05800
07320
070670
willing to bet it's near one of them.
honestly i know jack about sh. I'm assuming all the jumps for r1,r2 etc.. are for it.
ok well there's plenty of denso tags in hex.
05800
07320
070670
willing to bet it's near one of them.
honestly i know jack about sh. I'm assuming all the jumps for r1,r2 etc.. are for it.
With IDA, you will need to manually go through those and mark the identified text as data; in this case, string. It will nicely auto detect and define the string variable and lock the segment down so that it will not treat it as codes. The other data are the map location which I've identified in some previous posts, mark those as either individual data or define them as array, etc. Once you have all that, you are eliminating invalid codes. This will take time, but it will be fun to play around.
The nice thing about IDA is it will automatic analyze and nicely display the result from your manual analyzing point. Just have to identify one segment at a time... once you found the segment that doesn't make sense (such as code collision with data) you can eliminate that. Its also have a very nice UI where you can navigate your codes and tracing the flow of codes execution.
I have a chance to play around with the Demo version of IDA pro, so I know its potential. Thus figuring the rest of the ROM image will be time consuming and requires lots of patience.
#244
Is this title ok?
Originally Posted by zoom44
could the flash file name- sw-N3Z(1 or 2)E(R or S etc)000 be the code or check sum in some way?
Last edited by seikx8; 06-17-2006 at 02:05 AM.
#245
Is this title ok?
To give some update, the following are a few subroutines I found in these range of addresses:
0x25D0C:0x25FD4
0x25FDC:0x26114
0x26114:0x2633c
and so on..
Most of these code have floating point operation and call to address in the 0x2000 - 0x3000 range outside of the flash image range starting from 0x4000.
Some hints to analyze the assembly code is to look for any valid subroutine call. All subroutines call should use a register to load a full 32bit data. eg.
mov.l @(PC,xx), Rn
jsr @Rn
nop
And the follow codes should be mark as invalid:
mov.w (@PC,xx),Rn
jsr @Rn
All subroutine should have a begin and end code signatures with some variant of the follow format:
;begin routine
mov.l r14, @-r15
mov.l r13, @-r15
...
sts.l pr,@-r15
...
...
lds.l @r15+,pr
...
mov.l r15+,@r13
rts
mov.l r15+,@r14 ; code place here for delay return, sometime you may see nop instruction
; some data definition if any
; end subroutine
0x25D0C:0x25FD4
0x25FDC:0x26114
0x26114:0x2633c
and so on..
Most of these code have floating point operation and call to address in the 0x2000 - 0x3000 range outside of the flash image range starting from 0x4000.
Some hints to analyze the assembly code is to look for any valid subroutine call. All subroutines call should use a register to load a full 32bit data. eg.
mov.l @(PC,xx), Rn
jsr @Rn
nop
And the follow codes should be mark as invalid:
mov.w (@PC,xx),Rn
jsr @Rn
All subroutine should have a begin and end code signatures with some variant of the follow format:
;begin routine
mov.l r14, @-r15
mov.l r13, @-r15
...
sts.l pr,@-r15
...
...
lds.l @r15+,pr
...
mov.l r15+,@r13
rts
mov.l r15+,@r14 ; code place here for delay return, sometime you may see nop instruction
; some data definition if any
; end subroutine
#246
Is this title ok?
I hit gold in subroutine in range: 0x22060:0x2211A, there are codes referencing data access to the data map I've previous identified.
I'm tired now, got to catch some shut eye.
I'm tired now, got to catch some shut eye.
#250
i've been swamped for the last month and a half with work. I lost my tech and picked up a new gf so I've not had much time. I'll have the next week and a half or so all to myself so hopefully I'll be able to go through some of the new things I've got ( thanks zoom ) and see what I can do.
#252
Is this title ok?
There is progress, but slow. Currently I'm waiting to purchase the J2534 device as I am tight in budget at the moment. Otherwise, I have learned a lot about how the module is programed and such.
To lets you in some details, the Mazda Module Programming software seem to have a function for you to read the Flash from the PCM and check to see if the PCM is empty by validating if all data is Zero/FF (depending on the EEPROM each PCM use). In the application there are .DLL files which have functions interfacing with the Vehicle and reading/writing Flash images, etc. By default, it will auto check the HW and look in DB then connect to internet to get the latest info, if found you will be prompt whether you want to download & reflash with the new version.
However, there is option that would allow you to manually select a module flash File to upload to the PCM. There are options that set to prevent user from uploading the wrong flash file to the PCM but they can be turn off and bypass. Since I do not have the J2534, I cannot verify how that will work in the UI yet.
Regarding the flash image itself, I still have not figure out the checksum yet because there are missing data and I'm trying to locate and study the SBL (Secondary BootLoader) segment of the codes; these codes are upload/load from a protected region on he ROM to the RAM then run so that the reading/write process may occurs via communication with the a remote application such as the Mazda Module Programming Software.
As for the disassembly, I have about 350+ functions/subroutines identified and some jump/branch to address below 0x4000 which I currently have no access to so I can't verify the codes purpose.
And I was sick today, so I took a day off to rest. Still having a light headache at the moment
To lets you in some details, the Mazda Module Programming software seem to have a function for you to read the Flash from the PCM and check to see if the PCM is empty by validating if all data is Zero/FF (depending on the EEPROM each PCM use). In the application there are .DLL files which have functions interfacing with the Vehicle and reading/writing Flash images, etc. By default, it will auto check the HW and look in DB then connect to internet to get the latest info, if found you will be prompt whether you want to download & reflash with the new version.
However, there is option that would allow you to manually select a module flash File to upload to the PCM. There are options that set to prevent user from uploading the wrong flash file to the PCM but they can be turn off and bypass. Since I do not have the J2534, I cannot verify how that will work in the UI yet.
Regarding the flash image itself, I still have not figure out the checksum yet because there are missing data and I'm trying to locate and study the SBL (Secondary BootLoader) segment of the codes; these codes are upload/load from a protected region on he ROM to the RAM then run so that the reading/write process may occurs via communication with the a remote application such as the Mazda Module Programming Software.
As for the disassembly, I have about 350+ functions/subroutines identified and some jump/branch to address below 0x4000 which I currently have no access to so I can't verify the codes purpose.
And I was sick today, so I took a day off to rest. Still having a light headache at the moment
#255
Is this title ok?
To continue the saga,
if anyone want to pursue other alternative is to use the SCI port (Serial Communication Interface), there are source in japan that have those board to allow you to flash the ECU and here is the link for example if you understand Japanese (or to babefish translated): http://60.43.208.97/1/CPU-SH.htm
I've also read through many document from Renesas, the board can be reprogram directly via the SCI port (now I have understood how it works). The site also have the Flash Development Kit that you can download. Problem is, I have no spare ECU to play around with; because if you put the ECU into the wrong mode (boot mode) the entire flash will auto erase. This is the cheapest option you will find by making a very simple circuit to interface with the SCI that probably cost in the 2 digit figure.
And the cheapest J2534 device I found is McS1 from EEPod costing $475.
if anyone want to pursue other alternative is to use the SCI port (Serial Communication Interface), there are source in japan that have those board to allow you to flash the ECU and here is the link for example if you understand Japanese (or to babefish translated): http://60.43.208.97/1/CPU-SH.htm
I've also read through many document from Renesas, the board can be reprogram directly via the SCI port (now I have understood how it works). The site also have the Flash Development Kit that you can download. Problem is, I have no spare ECU to play around with; because if you put the ECU into the wrong mode (boot mode) the entire flash will auto erase. This is the cheapest option you will find by making a very simple circuit to interface with the SCI that probably cost in the 2 digit figure.
And the cheapest J2534 device I found is McS1 from EEPod costing $475.