Segment Swap utility

They go by many names, P01, P59, VPW, '0411 etc . Circa 1999 to 2006. All VPW OBD2 PCMs.
User avatar
Posts: 214
Joined: Tue Dec 17, 2019 3:27 am

Re: Segment Swap utility

Postby joukoy » Tue May 26, 2020 5:26 am

kur4o wrote: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.


0.11.7
Implemented 1-6
Opening explorer from file info tab by doubleclick

Search is quite easy but requires more buttons: "search", "search next" minimum. Will think about it.
Autoconfig bug requires debugging. Later...

Posts: 203
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Postby kur4o » Tue May 26, 2020 11:08 pm

Thanks for the awesome improvements. They will save alot of time for debugging.

Is there a way to highlight the file when opened in the explorer, or goto the file in the explorer. It also always goes fullscreen. It will be nice to use the current settings of windows explorer.

I also figured a way to locate the maf table start address for v6s file.
You can play with it and add maf address field in CS address. We might also rename the tab to Gm-v6 info.

The first opcode for search works on pre 98 bins. It is a single hit throughout the bin xxxxxxxx = maf start address

30 3C 50 00 20 7C [xx xx xx xx] 96-98


On later bins the opcode is
36 3c 50 00 24 7c [xx xx xx xx] 99-on

There is a total of 3 hits within the bin.

I will also look for a way to search and make a list of supported pids by v8 and v6 bins. Will write back when it is figured.

User avatar
Posts: 214
Joined: Tue Dec 17, 2019 3:27 am

Re: Segment Swap utility

Postby joukoy » Wed May 27, 2020 4:42 am

kur4o wrote:Thanks for the awesome improvements. They will save alot of time for debugging.

Is there a way to highlight the file when opened in the explorer, or goto the file in the explorer. It also always goes fullscreen. It will be nice to use the current settings of windows explorer.

I also figured a way to locate the maf table start address for v6s file.
You can play with it and add maf address field in CS address. We might also rename the tab to Gm-v6 info.

The first opcode for search works on pre 98 bins. It is a single hit throughout the bin xxxxxxxx = maf start address

30 3C 50 00 20 7C [xx xx xx xx] 96-98


On later bins the opcode is
36 3c 50 00 24 7c [xx xx xx xx] 99-on

There is a total of 3 hits within the bin.

I will also look for a way to search and make a list of supported pids by v8 and v6 bins. Will write back when it is figured.


Implemented in 0.11.8
Added search for log & debug.
Added error handling to autodetect config -> delete, hope it helps finding bug(s)

Posts: 203
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Postby kur4o » Wed May 27, 2020 8:08 am

All works as expected. Some small bugs in the file info tab counter and bad chk file tab counter.

File info tab actually counts bad chksum files and bad chk file counter is not counting. Also clear button do nothing in the bad chk file tab.

I also figured the sequence for ve table search for v6s.

case1 99-on bins
0C 40 1C 00 64 04 E2 48 60 04 30 3C 0E 00 search sequence 1 when found next is

74 [0F] -0f is the row count of table, than

20 7C [00 0E 61 EA] 4E B9 -00 0E 61 EA is the start address of ve table

case2 pre 98 bins

0C 40 1C 00 64 08 E2 48 04 40 02 00 60 04 30 3C 0C 00 -search sequence 1 when found next is

74 [0D] -0d is the row count of table, than

20 7C [00 06 E4 BA] 4E B9 - 00 06 E4 BA start address of ve table.



The 20 7C [xx xx xx xx] 4E B9 sequence can also be used for finding all 3d tables in the bin
20 7C [xx xx xx xx] 4E B9 -xx xx xx xx= table start address

To remove false hits xxxxxxxx must in the $60000-on range

In front of the sequence will be 74 [XX] xx= row counts of table
It can be right in front or upto 10-16 bytes in front of the 207c opcode.

I will play with the autoconfig with hope to find the delete issue.

User avatar
Posts: 214
Joined: Tue Dec 17, 2019 3:27 am

Re: Segment Swap utility

Postby joukoy » Thu May 28, 2020 1:14 am

kur4o wrote:All works as expected. Some small bugs in the file info tab counter and bad chk file tab counter.

File info tab actually counts bad chksum files and bad chk file counter is not counting. Also clear button do nothing in the bad chk file tab.

I also figured the sequence for ve table search for v6s.

case1 99-on bins
0C 40 1C 00 64 04 E2 48 60 04 30 3C 0E 00 search sequence 1 when found next is

74 [0F] -0f is the row count of table, than

20 7C [00 0E 61 EA] 4E B9 -00 0E 61 EA is the start address of ve table

case2 pre 98 bins

0C 40 1C 00 64 08 E2 48 04 40 02 00 60 04 30 3C 0C 00 -search sequence 1 when found next is

74 [0D] -0d is the row count of table, than

20 7C [00 06 E4 BA] 4E B9 - 00 06 E4 BA start address of ve table.



The 20 7C [xx xx xx xx] 4E B9 sequence can also be used for finding all 3d tables in the bin
20 7C [xx xx xx xx] 4E B9 -xx xx xx xx= table start address

To remove false hits xxxxxxxx must in the $60000-on range

In front of the sequence will be 74 [XX] xx= row counts of table
It can be right in front or upto 10-16 bytes in front of the 207c opcode.

I will play with the autoconfig with hope to find the delete issue.


Please test version 0.11.9

Posts: 203
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Postby kur4o » Thu May 28, 2020 3:43 am

I did some test and the tables are ripped flawless. There are some small issues.

It seems there is a third case for ve table

0C 46 1C 00 64 0A 20 06 E2 48 04 40 02 00 60 04 30 3C 0C 00

Than as the previous.
74 [0D] -0d is the row count of table, than

20 7C [00 06 E4 BA] 4E B9 - 00 06 E4 BA start address of ve table.

Since the file sizes are 256 512 and 1024kb, we need to define the cal section individually.

For 256kb cal data is $36000-on
For 512kb cal data is $64000-on
For 1mb cal data is $cf000-on


The "other tables" field seems to be capped at some XXXX amount of characters and doesn`t display all data.


I also figured the 3d lookup routines, There are total of 6 ones but 2 are identical so we have 5 in total. The first one should be found in 2 places across the bin. I need some more time to define them. The interesting part is that they are identical for ls1 bins and can be used globally. We need to find the start address where they are stored and save the start address for future search use. Usually it will be something like that

20 7c [xx xx xx xx] 4e b9 [yyyyyyyy]
xxxxxxxx = table start address
yyyyyyyy= 3d routine start address
4e b9 is the opcode for JSR

36 01 E0 4B C6 C2 D1 C3 36 00 F8 10 05 00 F8 30 35 00 20 00 F8 00 10 43 06 41 00 80 E0 49 30 01 4E 75

36 01 E0 4B E3 4A C6 C2 D1 C3 36 00 F8 10 05 40 F8 30 35 40 20 00 F8 00 10 83 06 81 00 00 00 80 E0 89 20 01 4E 75

36 01 E0 4B E3 4A C6 C2 D1 C3 36 00 F8 10 0D 40 F8 30 3D 40 20 00 F8 00 18 83 06 81 00 00 00 80 E0 81 20 01 4E 75

36 01 E0 4B C6 C2 D1 C3 36 00 F8 10 0D 40 F8 30 3D 40 20 00 F8 00 18 83 06 81 00 00 00 80 E0 81 20 01 4E 75

36 01 E0 4B C6 C2 D1 C3 36 00 F8 10 05 40 F8 30 35 40 20 00 F8 00 10 83 06 81 00 00 00 80 E0 89 20 01 4E 75

The difference is signed vs unsigned lookup, byte or word or dword lookup.

User avatar
Posts: 214
Joined: Tue Dec 17, 2019 3:27 am

Re: Segment Swap utility

Postby joukoy » Thu May 28, 2020 4:15 am

kur4o wrote:I did some test and the tables are ripped flawless. There are some small issues.

It seems there is a third case for ve table

0C 46 1C 00 64 0A 20 06 E2 48 04 40 02 00 60 04 30 3C 0C 00

Than as the previous.
74 [0D] -0d is the row count of table, than

20 7C [00 06 E4 BA] 4E B9 - 00 06 E4 BA start address of ve table.

Since the file sizes are 256 512 and 1024kb, we need to define the cal section individually.

For 256kb cal data is $36000-on
For 512kb cal data is $64000-on
For 1mb cal data is $cf000-on


The "other tables" field seems to be capped at some XXXX amount of characters and doesn`t display all data.




Fixed in 0.11.10
I dont have any problems with "other tables". How are you looking at it? Excel divides data to mulitple rows...
You can use text-editor to see all values.

Posts: 203
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Postby kur4o » Thu May 28, 2020 5:02 am

All issues fixed.

I didn`t look in external file the table data. It is only capped in the display tab, when exported is all the data.

We might label that column field 3d tables.

For 2d tables the search sequence is

24 7C [xx xx xx xx] F8 12

xxxxxxxx=table address

The 3d and 2d table search is valid for ls1 bins too. You might give it a try. I couldn`t fool the program to take ls1 file as v6 so couldn`t run any tests.

Splitting to segments there will give better picture for table usage.



I am thinking about sorting the tables addresses.
Some of the tables are looked up at 2-3 different code locations. We can cure this or combine by using 2 different strategies of sorting the tables



First strategy will be the current strategy: by code usage.

Second strategy can be to sort by the address and add counter for multiple hits. :[hit times]

Both strategy can provide valuable data for easy table guessing.

Maybe some checkbox to switch between 2 sort strategies.

User avatar
Posts: 214
Joined: Tue Dec 17, 2019 3:27 am

Re: Segment Swap utility

Postby joukoy » Fri May 29, 2020 5:32 am

Version 0.11.11
Started support for configurable table search.
Not finished yet, need more functions etc, but basic functions work.

Extract attached files to XML -folder (same file tree times with different name), hit "Show info for files..." and select some V6 bnaries.
You should get data to [Searched Tables]

Config:
Settings -> Edit Table Search
Attachments
SearchTables-V6.zip
(1.34 KiB) Downloaded 50 times

Posts: 24
Joined: Mon Oct 21, 2019 4:58 am

Re: Segment Swap utility

Postby kostia111 » Fri May 29, 2020 11:10 am

Good afternoon !
I want to check the checksums
file which consists of one segment
file = segment
for example this
I already broke my head
trying to write xml
there is no way to indicate
that segment address is the beginning - the end of the file
Attachments
12598439.bin
(176 Bytes) Downloaded 53 times

PreviousNext

Return to GM LS1 512Kbyte and 1Mbyte

Who is online

Users browsing this forum: No registered users and 5 guests