RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Tue Dec 23, 2025 11:09 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: RIPEMD160 checksum for 19LE4B
PostPosted: Tue Dec 13, 2022 8:00 pm 
Offline
Newbie

Joined: Thu Sep 08, 2022 3:05 pm
Posts: 6
Greetings, I've been working on a checksum correction algorithm for this specific ECU "19LE4B", and found 16bit sumt at 0x8200, 32bit sumt & 32bit xort at 0x99E2 and 0x99EA, there's another sumt checksum at 0x20000 but it looks like isn't important since it's out of the map calibration area.

Already implemented the correction in a python script (attached to the post), but it looks like there's another algorithm I'm missing which value is stored just behind the 32bit sumt and xort.

It looks like it's RIPEMD160 encryption since I found the keywords while disassembling at 0x798. I'm stuck at this point, what I've found is that this checksum covers the area just ahead of the sumt and xort values (starting from 0x99EC I guess). The values are stored as 16bit bytes at 0x99E0 & 0x99E8 (Just behind the 16 bit values from sumt and xort) but why are two values?

The script works with Python 3.11, and does not edit or create a new file, it only prints the corrected values, the values need to be updated manually since It's still a work in progress.

Any help or suggestions will be greatly appreciated. If I'm wrong about something please correct me.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: RIPEMD160 checksum for 19LE4B
PostPosted: Wed Dec 14, 2022 10:37 am 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
hidalga wrote:
It looks like it's RIPEMD160 encryption


Here's all I have about that algo : https://nissanecu.miraheze.org/wiki/Che ... RIPEMD-160

I hadn't looked very closely at it, but I think it'generates a 20-byte hash.

_________________
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: RIPEMD160 checksum for 19LE4B
PostPosted: Wed Dec 14, 2022 1:10 pm 
Offline
Experienced
User avatar

Joined: Tue Oct 13, 2015 1:56 am
Posts: 141
Location: Russia, Voronezh
Did several corrections for such ROMs, never needed for RIPEMD checksum fix. It seems to cover only code area and unless you are doing some hacks on this level you won't probably need to amend it. Just try fixing checksums @ 0x8200, 0x20000, xort / sumt and check if it still fires the wrong checksum error, most probably it will not.

And be careful with the correction order - first you put sumt & xort values on their places in ROM, then calculate checksums for @ 0x20000 and 0x8200 locations as these values are included into calculation area.


Top
 Profile  
 
 Post subject: Re: RIPEMD160 checksum for 19LE4B
PostPosted: Wed Dec 14, 2022 1:32 pm 
Offline
Newbie

Joined: Thu Sep 08, 2022 3:05 pm
Posts: 6
Yes, it's supposed to generate 5 32bit bytes which can be read as 20 8-bit bytes. I did the crypto implementation in python using hashlib which has built in the RIPEMD160, but don't know if it's intended for the whole bin file or just sections, yesterday did a research in the sh7058 datasheet looking for the memory block length and currently planning on brute-forcing every block to find the region where the algo is applied, but I'm unsure if the process will work.


Top
 Profile  
 
 Post subject: Re: RIPEMD160 checksum for 19LE4B
PostPosted: Wed Dec 14, 2022 1:39 pm 
Offline
Newbie

Joined: Thu Sep 08, 2022 3:05 pm
Posts: 6
Shuher wrote:
And be careful with the correction order - first you put sumt & xort values on their places in ROM, then calculate checksums for @ 0x20000 and 0x8200 locations as these values are included into calculation area.


Yes, I realized that 0x8200 includes the sumt and xort values and has to be corrected at last.


Top
 Profile  
 
 Post subject: Re: RIPEMD160 checksum for 19LE4B
PostPosted: Wed Dec 14, 2022 9:32 pm 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
hidalga wrote:
currently planning on brute-forcing every block to find the region where the algo is applied


... why not look at the disasm / decompiled code ?

_________________
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: RIPEMD160 checksum for 19LE4B
PostPosted: Fri Dec 16, 2022 5:09 pm 
Offline
Newbie

Joined: Thu Sep 08, 2022 3:05 pm
Posts: 6
fenugrec wrote:
hidalga wrote:
currently planning on brute-forcing every block to find the region where the algo is applied


... why not look at the disasm / decompiled code ?



Tried to do that, but I'm still very inexperienced with disassembling, can find data and subfunctions but not translate/interpret the assembly code


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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