Segment Swap utility

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
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:
Extract with "replace" creates duplicates to extractedsegments.xml, will be fixed in next version.
Fixed in version 0.11.2
Added support for "Segment Swap address". If defined, address is used for segment extract & swap. Useful with segment search functionality. (eeprom segment)
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

0.11.3

previously saving information [stock]/[modded]/[n/a] when extracting segments.
But if you later add CVN to stockcvn-list, information is not updated to extractedsegments.xml
Now saving CVN too, and if it's saved, comparing latest stockcvn list when listing segments.

I think there was some problems with extract/updating extractedsegments.xml, should be fixed now.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

I finally figured a way how to find the v6s checksum in the bin.

First we need to find the store address of the OS. It is usually 3fffa, 7fffa[7fff8], ffffa.

Than a search can be done. For 256kb and some 512kb[7fff8] the search is 20 39 xx xx xx xx, for 512kb[7fffa] and 1mb 26 39 xx xx xx xx [xx= 4 byte OS address]
If a match is found next 20 39 or 26 39 hit will give you the checksum address. Usually in the next 16-32 bytes.


To give it an example for 512kb.
The OS is at 0007fffa

perform a search for 26 39 00 07 ff fa. If a match is found perform another search to confirm there is only one hit in the full bin.
If a single match is found than the next hit of 26 39 will give you the checksum address

it will look something like this

Code: Select all

52 41 64 04 32 3C FF FF 31 C1 A9 08 [26 39 00 07 FF FA] 24 03 E0 8A E0 8A 28 38 A9 00 98 82 24 3C 00 00 FF FF C6 82 98 83 [26 39 00 07 06 D6] 2E 03
We can use this function to generate the OS:checksum list in a separate tab. It can be a good foundation for the table search for ls1 bins I am thinking of.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:I finally figured a way how to find the v6s checksum in the bin.

First we need to find the store address of the OS. It is usually 3fffa, 7fffa[7fff8], ffffa.

Than a search can be done. For 256kb and some 512kb[7fff8] the search is 20 39 xx xx xx xx, for 512kb[7fffa] and 1mb 26 39 xx xx xx xx [xx= 4 byte OS address]
If a match is found next 20 39 or 26 39 hit will give you the checksum address. Usually in the next 16-32 bytes.


To give it an example for 512kb.
The OS is at 0007fffa

perform a search for 26 39 00 07 ff fa. If a match is found perform another search to confirm there is only one hit in the full bin.
If a single match is found than the next hit of 26 39 will give you the checksum address

it will look something like this

Code: Select all

52 41 64 04 32 3C FF FF 31 C1 A9 08 [26 39 00 07 FF FA] 24 03 E0 8A E0 8A 28 38 A9 00 98 82 24 3C 00 00 FF FF C6 82 98 83 [26 39 00 07 06 D6] 2E 03
We can use this function to generate the OS:checksum list in a separate tab. It can be a good foundation for the table search for ls1 bins I am thinking of.
Implemented in 0.11.4 (Source not in github yet, some problems)
First it is searching checksum address using above method, if not found will try old file-method.
Currently you can see only from debug, what method is used.
OS:Checksum tab not added yet.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

0.11.5

Added "CS Address" tab for V6 binaries, hope it is ok.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Just brilliant work. I run it through a bin library and not a single issue with checksum identification.

I found some very limited exception on some 96-97 files that are 512kb in size. These use 20 39 opcode and the program can`t find the checksum address on those. I am sure it will be an easy fix.

Here is some list with Os:checksum I managed to gather.
Attachments
GM-V6.csv
(18.5 KiB) Downloaded 187 times
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:Just brilliant work. I run it through a bin library and not a single issue with checksum identification.

I found some very limited exception on some 96-97 files that are 512kb in size. These use 20 39 opcode and the program can`t find the checksum address on those. I am sure it will be an easy fix.

Here is some list with Os:checksum I managed to gather.
Please send one file, which checksum it can't find.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Here is one of the examples. $22fb4 is the search for 20 39 00 07 FF FA
Attachments
1997 Buick 9365041.bin
(512 KiB) Downloaded 172 times
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:Here is one of the examples. $22fb4 is the search for 20 39 00 07 FF FA
Fixed in 0.11.6

Now it searches all combinations for 512kb files in order:
20 39 00 07 FF F8
20 39 00 07 FF FA
26 39 00 07 FF FA
26 39 00 07 FF F8

Not sure if last one is needed?
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

I did a full test on the v6 and now is working flawless with anything I throw in. Great work.

For the search order we might use the most common to less common combo, to optimize the search engine,
it will be something something like this

26 39 00 07 FF FA
20 39 00 07 FF FA
20 39 00 07 FF F8
26 39 00 07 FF F8

Can we also add in the CS address tab 1 more field with the start address of the first search hit.
For example the address of 26 39 00 07 FF FA code. This will make chart of identical OS since the code will be at the same location and cross reference of similar OS can be obtained.

I have some other suggestion for improvement and some requests.

1. Rename in settings tab [segments] to [edit xml]
2. on unchecking "autodetect config" to pop up a dialog to xml folder for xml select
3. making visible a select xml button when "autodetect config" is unchecked.
4. adding save only button to the xml edit dialog, useful for editing multiple xmls. Now you have to close the dialog to save.

5. Adding another tab like [file info] that will list only the files with bad checksum. I need it for debugging.
6. Opening file location in windows explorer from [file info] tab or the [bad chk file] tab. Something like right click with a menu or something like that. I am not sure if this will be possible.
7. Not really needed but if it is an easy add. Adding search in the log tab.


I also pinpoint some of the problems with autoconfig settings dialog. It happens to throw an error when you are deleting multiple entries in specific order. Usually up-down order. Deleting in down-up order is almost working. I also noticed that deleting doesn`t need save. The entry is deleted immediately.
Post Reply