Segment Swap utility

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
Post Reply
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Uploaded version 0.6.0 of Universal Patcher
It can now calculate checksums for e38 bin files.
Checksum writing not implemented yet, should be easy task, I hope.
Only minimal test done.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

joukoy wrote:Uploaded version 0.6.0 of Universal Patcher
It can now calculate checksums for e38 bin files.
Checksum writing not implemented yet, should be easy task, I hope.
Only minimal test done.
0.6.1
Fixed some ugly bugs.
Added support for checksum fixing. Currently checksums are not fixed automatically, only if click Checksums-button.

Edit: 0.6.2, small fix
Last edited by joukoy on Mon Feb 24, 2020 2:41 am, edited 1 time in total.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

I am having trouble loading the config you made.
The error is: there is an error in XML document(2,2).
Can we specify the size of the checksum, for example, byte checksum, word checksum , dword checksum length.

Are all the checksum buttons are active. When I tried to save checksum type as crc32 and later load the config file it defaults to checksum none.
I am not sure but if I specify 7fffe-7ffff area, and put word sum the calculation is not done correctly.
I did some more checks and somehow the word sum is not good. Not sure why.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Managed to open the xmls by manually copying them. They seems to change when downloaded. Found a small bug.
I guess 20000-1@ is 20000 to end of bin. Unfortunately the end of OS don`t align with the end of bin. Can we make to end of bin minus XX bytes.
In the example the end of os is ffffd and end of bin is fffff. Or take the end of OS from the bin. It is stored at $510 for 1mb ls1 it is 000FFFFD

EDIT:
It is already there. I changed -1@ to -@510 and it worked like a champ. Great work. I will test for more issues.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

You did some amazing work here.
I managed to configure a file for e92a pcm, and got the v6 stuff working.
The v6 is a simple word sum but it is stored at dword and each OS have different location for the checksum. I got the list for most of the OS but we need to link them.
The idea is to read the OS first. It is stored at 2 possible addresses. Than based on the list each OS will be linked with the Checksum address.
For the calculations of checksum only 4000-7fff area is skipped and the location of checksum and os. The os is stored either at the end of bin -6, or end of bin -8 location.

Can you make the second checksum to be configured as a display type also. For example the cvns on some pcms are not stored in the file, but it will be good to print them only.
User avatar
Tazzi
Posts: 3422
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: Segment Swap utility

Post by Tazzi »

kur4o wrote:You did some amazing work here.
I managed to configure a file for e92a pcm, and got the v6 stuff working.
The v6 is a simple word sum but it is stored at dword and each OS have different location for the checksum. I got the list for most of the OS but we need to link them.
The idea is to read the OS first. It is stored at 2 possible addresses. Than based on the list each OS will be linked with the Checksum address.
For the calculations of checksum only 4000-7fff area is skipped and the location of checksum and os. The os is stored either at the end of bin -6, or end of bin -8 location.

Can you make the second checksum to be configured as a display type also. For example the cvns on some pcms are not stored in the file, but it will be good to print them only.
Try searching the pcm bin for the location address of the checksum. I imagine it will be referenced in the early boot code like many other pcms :thumbup:
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Try searching the pcm bin for the location address of the checksum. I imagine it will be referenced in the early boot code like many other pcms :thumbup:
I hoped so too but it looks like it is not referenced but hardbuilt in the code. Each OS have different chksm location. :sad2:
Some OS can match if they are done at the same time for different platforms.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Uploaded 0.6.3

Now is possible to specify segment end for example: "0-2@" (0-2 bytes from end of file)
Sorry, but config file is not compatible from previous version. Had to make modifications to keep code readable.
i try to keep it unchanged for now on - only new features, maybe.

You can manually modify old XML with texteditor: (Search & replace)
<CSA1> => <CS1Address> (and: </CSA1> => </CS1Address>)
<CSA2> => <CS2Address>
<CSMethod1> => <CS1Method>
<CSA1Block> => <CS1Blocks>
<CSA2Block> => <CS2Blocks>
<Complement1> => <CS1Complement>
<Complement2> => <CS2Complement>
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Don`t try to keep config files the same till the final version, some other improvements might be needed.
I found one situation where the start-end addresses are not 4 bytes long, but 2 bytes long.

Code: Select all

e38 slave info

0F E3 sum
20 07 20 
00 C0 59 CB p/n
4E 42 version
00 01 31 32 36 30 35 38 39 39 00 00 00 00 00 00 00 00 
46 C8 cvn
00 02 03 02 
40 00 os start 1
7F FF os end1
C0 00 os start2
E7 FF os end2
40 02 os cvn start1
40 1C os cvn end1
40 1F os cvn start2
7F FF os cvn end2
C0 00 os cvn start3
E7 FF os cvn end3
40 02 sum start1
7F FF sum end1
C0 00 sum start2
E7 FF sum end2
01 01 02 01 
E8 00 seg1 start
ED FF seg1 end
E8 02 seg1cvn start1
E8 1C seg1cvn end1
E8 1F seg1 cvn start2
ED FF seg2 cvn end2
E8 02 seg1 sum start
ED FF seg1 sum end
It will be great if that can be specified just like the :2, you added in the other fields.

Also the start end addresses might not align with the bin file. Can we add some offsets +- to the ripped start address.
For example the slave os is not full binary some parts are cutout, it can be attached to the end of OS, getting the relative addressing totally off chart. If we can put some offsets there it will work
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Another idea.
Can we add for @xxxx address, to read 2 , 3 , 4 in a row as start-end address.
SO we specify how many start-end addresses are to follow after@xxxx for the given segment, checksum calculation and so on.
Post Reply