RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sun Dec 28, 2025 11:55 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 94 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Fri Apr 05, 2019 9:55 am 
Offline
Newbie

Joined: Sun Mar 31, 2019 9:35 am
Posts: 16
After reading the two pages, it looks like it shouldn't be difficult to dump an ECU using CAN.
-or- did I miss something?

Over the weekend, I will manually (via terminal) send the first few commands to my ECU and see if it responds the same.

My ECU (1NX4A - 2011 G37) supports K-line and CAN,so it will be interesting to see what happens.


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Fri May 24, 2019 9:47 pm 
Offline
Experienced
User avatar

Joined: Sat Mar 30, 2019 3:04 am
Posts: 362
FrankVQ wrote:
After reading the two pages, it looks like it shouldn't be difficult to dump an ECU using CAN.
-or- did I miss something?

Over the weekend, I will manually (via terminal) send the first few commands to my ECU and see if it responds the same.

My ECU (1NX4A - 2011 G37) supports K-line and CAN,so it will be interesting to see what happens.


what result?

_________________
SKYLINE 06`CPV35/MT6/VQ35DET/Cosworth/Eagle/ACL/ARP/Supertech/Cometic/MOCAL/
KAKIMOTO RACING/FUJITSUBO/Greddy/HKS/OBX RACING/AEROMOTIVE/UpRev


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sun Dec 08, 2019 1:48 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
fenugrec wrote:
Those recent ROMs have RIPEMD-160 code, and I'm still not sure of the details, but it's somehow related to that vector table at FFFF8500.

The RP160 function itself calculates a 20-byte hash (in certain situations only ? or continuously ?). If I'm reading the code correctly, the hash is calculated over that table @ FFFF8500, but the length looks insane (0x2614 probably), and I'm not sure what that hash is compared to.

Again from 1KA6A:
Code:
ROM:00000426                 add     r5, r14         ; r14 = [ffff8500]dd
ROM:00000428                 stc     gbr, r5         ; r4=ffff8500 also
ROM:0000042A                 add     #h'10, r5    ; r5=ffff826e
ROM:0000042C                 bsr     RIPEMD160       ; i: r4=&src?, r5=&dest?, r6:len?
ROM:0000042E                 mov     r14, r6


So, I'm not sure any more if that RP160 hash is important for ROM modifications.


I haven't looked at any code or ROM disassembly, but "I have heard of" (more than one) OEM that use a RP160 hash to determine if an ECU should be reflashed. Basically after a new SW is flashed to the ECU, it will calculate the RP160 hash over some or all of the ROM and store it to NVRAM. As part of the programming sequence, the test tool will request this hash from the ECU and compare it to it's own calculation of the hash over the ROM that it wants to load. If the hashes are equal then no flashing occurs.


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sun Dec 22, 2019 10:44 pm 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
So I got my Uprev cable and it was finally warm enough to go out and take a dump of my ecu (2017 370z). I was interested in taking a look at their ROM Editor software in IDA, but it turns out that they use one of the more sophisticated obfuscation tools (Themida/WinLicense), and I want no parts of that right now (I'm a little surprised by this because I thought Uprev had a tiny dev team). In any case, I'm sure the .bin that was saved on my laptop is obfuscated too. I have a full CAN log, so I'm going to do a quick sanity check to see if the transferred data is what's actually showing up in the .bin file. If it's been obfuscated then I should be able to write a quick perl script to reconstruct the ROM from the CAN log. Is there anything that anyone is interested in me taking a closer look at while I'm in there?


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Mon Dec 23, 2019 4:26 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
Attached the CAN log from dumping my ecu with Uprev's cable+software. I will wait to post the bin to see if they've screwed around with it, or if it's straight off the ecu.

2017 370z base model 6MT

Moderator: ROM removed, please read posting rules before submitting ROMs or maps.


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Fri Dec 27, 2019 4:50 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
LeftoverPi wrote:
Attached the CAN log from dumping my ecu with Uprev's cable+software. I will wait to post the bin to see if they've screwed around with it, or if it's straight off the ecu.

2017 370z base model 6MT

Moderator: ROM removed, please read posting rules before submitting ROMs or maps.


I read the forum rules and I'd like clarification as to why my upload was removed. It is neither a ROM nor a map. It is a CAN log of an ECU dump.

Thanks


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sat Dec 28, 2019 1:31 pm 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
LeftoverPi wrote:
why my upload was removed. It is neither a ROM nor a map.


I think it's too close to being a commercial-tuned ROM - I didn't check the log but it's probably not very difficult to extract Uprev's custom ROM from it, and that would be a problem.

What did you want to learn from that log ? if it's just the stock ROM you want, nissan-techinfo might have an update .dat for your ecuid already.
If it's the dump process you're interested in, then I think you could probably post short extracts of your log (maybe just the first few % ).

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sun Dec 29, 2019 6:30 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
fenugrec wrote:
LeftoverPi wrote:
why my upload was removed. It is neither a ROM nor a map.


I think it's too close to being a commercial-tuned ROM - I didn't check the log but it's probably not very difficult to extract Uprev's custom ROM from it, and that would be a problem.

What did you want to learn from that log ? if it's just the stock ROM you want, nissan-techinfo might have an update .dat for your ecuid already.
If it's the dump process you're interested in, then I think you could probably post short extracts of your log (maybe just the first few % ).

But it wasn't UpRev custom ROM. It's a dump of a bone stock 2017 370z. I took a CAN bus log while the stock ROM was being read. There's nothing special about the CAN log; just a bunch of service 0x23 requests. I posted it because I can't find any ROMs for a 370z and I'm going to reconstruct it (again, there is nothing proprietary. If I didn't use the word Uprev in my own post it would be impossible to know). I don't believe this violates any forum rules


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sun Dec 29, 2019 6:33 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
... It feels like the moderator just saw that there was an attachment in a post with the word "Uprev" and deleted it without bothering to understand what its really referring to.


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Sun Dec 29, 2019 1:32 pm 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
LeftoverPi wrote:
If I didn't use the word Uprev in my own post it would be impossible to know). I don't believe this violates any forum rules


Yes, I also would have assumed it was an Uprev base ROM just reading the last few posts. It was easy to make the connection, don't take it the wrong way. I think it's OK to repost, as it's pretty much equivalent to posting a stock .dat or .bin

If it had been one of their ROMs, it's fairly easy to recognize once reassembled anyway.

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Mon Dec 30, 2019 3:44 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
fenugrec wrote:
LeftoverPi wrote:
If I didn't use the word Uprev in my own post it would be impossible to know). I don't believe this violates any forum rules


Yes, I also would have assumed it was an Uprev base ROM just reading the last few posts. It was easy to make the connection, don't take it the wrong way. I think it's OK to repost, as it's pretty much equivalent to posting a stock .dat or .bin

If it had been one of their ROMs, it's fairly easy to recognize once reassembled anyway.


That's really what I was getting at; whether or not I should be OK to repost that. I'll be more clear next time with my wording lol.
I wrote a small tool that I believe will reconstruct the ROM .bin from the CAN log.

Unfortunately I can't find a stock ROM from my vehicle to verify. The ROM I constructed looks to be right, but I need something concrete.

I'm going to throw this one out there to see if anyone can help:
Does anyone have a CAN log of an ECU dump AND the resulting ROM binary that was dumped. I'd like to run the log through my tool and verify the output is correct.


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Mon Dec 30, 2019 3:55 am 
Offline
Experienced
User avatar

Joined: Tue Oct 13, 2015 1:56 am
Posts: 141
Location: Russia, Voronezh
I even tried flashing all 0xFF and all 0x00 to the ECU (in my case tool was only flashing area from 0x8200 to 0x80000) and I do have such logs if you want to experiment.

writing for all 0xFFs was loking like this
Code:
>> 07 e0 34 82 07 fc 80 80 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 4b d2
<< 07 e8 74 02


flashing all 0x00s gave the below log

Code:
>> 07 e0 34 82 07 fd 80 80 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 00 22 ff ff 49 99
<< 07 e8 74 02


Didn't have much time and motivation to finish this up yet :)


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Mon Dec 30, 2019 11:42 am 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
LeftoverPi wrote:
Unfortunately I can't find a stock ROM from my vehicle to verify. The ROM I constructed looks to be right, but I need something concrete.


My approach for that scenario would be to make sure you got an even 500k/1M/2MB file, then decrypt it if necessary (usually standard nissan algo for repro files, but a SID23 dump should be plaintext). And last, run nisrom on it - if it find all expected checksums, it's almost guaranteed to be ok.

If not, I'd check the beginning and ends of the ROM - first hundred bytes or so should be a valid interrupt vector table; the end should be mostly blank (0xFF) except a 4-byte signature that looks like 'NHU.'


@Shuher: you probably figured this out already, but in case it wasn't clear :
Code:
>> 07 e0 34 82 07 fc 80 80 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 fe fe 00 07 4b d2
<< 07 e8 74 02

would split like this

Code:
>> 07 e0 34 82    (SID 34 82)
07 fc 80  (start addr)
80 (length)
"fe fe 00 07" , total 0x80 bytes
4b d2 (checksum/ CRC ? I forget)
07 e8 74 02 (SID 34 positive responsem alhtough I'm not sure what the last 02 is for)


And again the data is encrypted with nissan's standard algo, it is recognizable by producing 4-byte patterns when encrypting constant data.

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Mon Dec 30, 2019 12:01 pm 
Offline
Experienced
User avatar

Joined: Tue Oct 13, 2015 1:56 am
Posts: 141
Location: Russia, Voronezh
Quote:
@Shuher: you probably figured this out already, but in case it wasn't clear :


I didn't :) From the time we were discussing it I didn't bother much in CAN reprog as I purchased a commercial tool for it, which I used only 3 times maybe.
So thanks for clarifications, you saved me couple of evenings with IDA - I still have a plan to finish K+CAN cable support in nisprog (it's about 30% ready now) and then make the CAN reprog happen with this nice tool.

But this will happen after I complete ASCD algo dissection - such a wierd stuff or I just dumb :-D


Top
 Profile  
 
 Post subject: Re: CAN-only / "recent" ROMs
PostPosted: Tue Dec 31, 2019 1:59 am 
Offline
Newbie

Joined: Sat Nov 23, 2019 2:55 pm
Posts: 21
fenugrec wrote:
My approach for that scenario would be to make sure you got an even 500k/1M/2MB file, then decrypt it if necessary (usually standard nissan algo for repro files, but a SID23 dump should be plaintext). And last, run nisrom on it - if it find all expected checksums, it's almost guaranteed to be ok.

If not, I'd check the beginning and ends of the ROM - first hundred bytes or so should be a valid interrupt vector table; the end should be mostly blank (0xFF) except a 4-byte signature that looks like 'NHU.'


Thanks for the suggestions; I think I may be on the right track. The ROM that I reconstructed is exactly 1.5MB in size (which I've read is the correct size for Z34s). The first 0x398 bytes is a repeating table, and the end of the file is padded with 0xFF. I see the "NHU" signature 124 bytes from EOF. I also have another checksum (?) at the very end; it's 6 bytes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 94 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl