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: --
Contact:

Re: Segment Swap utility

Post by joukoy »

ironduke wrote:I had to copy over the Reference-CVN.xml file to the XDF folder to get it to run, hope that's ok, it was missing in the new zipped XML folder.

How to use the templates? When i save as xdf am I supposed to point it to the template? Won't that overwrite that file? or should I make a copy of that template and then select it??
Ok, i need to create new xml.zip

Just put template to XML folder and forget it :)
Open file, click DTC tab and "Export xdf"

Edit:
Currently you need 2 templates (included in xml_v3.4.1.zip) : e38-template.xdf and e67-template.xdf
Don't overwrite templates, export xdf files directly to:
C:\Users\<username>\Documents\TunerPro Files\Bin Definitions\
ironduke
Posts: 583
Joined: Thu Feb 13, 2020 11:32 pm
cars: Mainly GM trucks, a Cruze and an Equinox for dailys..

Re: Segment Swap utility

Post by ironduke »

I'm not doing something right with exporting XDF's or editing and saving after changing DTC's from within your program.. I'm a bit too busy at the moment but I'll spend some time later on trying to figure it out.

tried leaving the template.xdf files right in the XML folder? also tried putting them in my Bin Definitions folder.. neither seem to work, I open the file, click export and tried saving it both in the temp folder I created just to test and also the Bin definitions folder.

This is with the latest XML 3.4.1 version.. the about still says 12.47 though, assuming that just needs to be updated?
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

Template files must be in XML -folder.
File save -dialog will not show up if template is missing.

Program version is now 0.12.49, please upgrade if you still have 0.12.47
XML -zip version is 3.4.1

Edit: EXE was not updated in github, only source.
Please try again.
ironduke
Posts: 583
Joined: Thu Feb 13, 2020 11:32 pm
cars: Mainly GM trucks, a Cruze and an Equinox for dailys..

Re: Segment Swap utility

Post by ironduke »

OK, with the new download it's working as it should, I really like how it prompts with the suggested filename for the XDF that includes the OS, man that's fantastic..
I'm going to have to look at my notes, I don't think or remember there ever being a 04 in the dtc list.. I know I typed it as meaning the same as 00 but if it's not present in any bins we might as well remove the choice.

Edited.. 4 is Not reported but MIL will come on, That is an error on my part, I apoligize.. should have caught that with my own checking..

Awesome work!!! Almost ready for some spark tables..
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

The new features really kick ass.

As far I have seen the xdf is some modified xml type of file, making editing not that hard. It can easily be edited in wordpad, with copy pasting new info and merging xdfs and so on.

Interesting if you can unsplit the fields and make some basic xdf editor, at least it will give some headstart for adding tables and scalars to templates.

Since your there I will try to gather some data for ls1 DTC discovery ASAP.

Here are some identifiers for 1mb bins. Should work with most of the 1mb bins but there migth be exclusions. Still need to find some pattern for 512kb files.

Search for
18 30 35 B0 * * * *

You will likely get 4 hits
**** is the start address of the dtc table.
The table is 4 bytes long
first 2 bytes are not used, or is some priority stuff
second 2 bytes is the pid number

The pis number start with a digit for P numbers, C for C number and D for U number.
To figure end of table maybe follow the order of the first digit of dtc it must be in 0-9, C, D concession, If after D code, you got something else for first digit that it might be the end of dtc table.

To get the DTC status search for

18 30 31 B0 * * * * 67

* * * * will be the start address, some bins might get false result with this search string, Usually you will get 4 hits with the same start address.

Print the DTC status till FF is reached, that starts the mil on/off table it should be the same size as the DTC status table. The mil on/off table again ends with FF.

ONe more rule for cvn rules.

If cvn is not in the stockcvn list and cvn is in the reference list but it doesn`t match print [modded/R]
Now it is [n/a]
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:The new features really kick ass.

As far I have seen the xdf is some modified xml type of file, making editing not that hard. It can easily be edited in wordpad, with copy pasting new info and merging xdfs and so on.

Interesting if you can unsplit the fields and make some basic xdf editor, at least it will give some headstart for adding tables and scalars to templates.

Since your there I will try to gather some data for ls1 DTC discovery ASAP.

Here are some identifiers for 1mb bins. Should work with most of the 1mb bins but there migth be exclusions. Still need to find some pattern for 512kb files.

Search for
18 30 35 B0 * * * *

You will likely get 4 hits
**** is the start address of the dtc table.
The table is 4 bytes long
first 2 bytes are not used, or is some priority stuff
second 2 bytes is the pid number

The pis number start with a digit for P numbers, C for C number and D for U number.
To figure end of table maybe follow the order of the first digit of dtc it must be in 0-9, C, D concession, If after D code, you got something else for first digit that it might be the end of dtc table.

To get the DTC status search for

18 30 31 B0 * * * * 67

* * * * will be the start address, some bins might get false result with this search string, Usually you will get 4 hits with the same start address.

Print the DTC status till FF is reached, that starts the mil on/off table it should be the same size as the DTC status table. The mil on/off table again ends with FF.

ONe more rule for cvn rules.

If cvn is not in the stockcvn list and cvn is in the reference list but it doesn`t match print [modded/R]
Now it is [n/a]
Version 0.12.50

stockcvn modified

Of course there is but for P59 DTC search...
12579405 doesn't have FF between status & MIL tables, or end of MIL table.
12587603 have extra byte @beginning of status table
Maybe some other, not tested that much.

Version 0.12.50 uses this method:
- Find table_address by searching 18 30 31 B0 * * * * 67
- Find end_address of MIL table by searching (byte > 1), beginning at (table_address + 2 * code_count)
- First DTC status is in (end_address - (2 * code_count) - 2)
=> This is table_address OR table_address +1 in binaries I have tested

Please test, there is big change status and/or MIL table is off by 1-2 bytes

Edit: Added P01-P59-template.xdf
Removed XML_*.zip, added UniversalPatcher-Full.Zip, includes exe and XML-folder
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

0.12.51

DTC MIL was 1 byte off for some P59 files.

Now status codes start from table_address + 1.
If there is FF after status codes, skip it AND next byte.
If there is no FF, skip one byte after status bytes.

Confirmed working with:
12579405
12587603
12592618
12587604

NOT working with -05 or newer binaries like:
12606807
12587811
12619624
12597120
(Can't find 18 30 35 B0)
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

I did some tests and it works also with

12606960
12592425
12593058
12585950
12579405

I guess all pre 2005-06 OS will work with this setup. Wonder why gm used different opcodes for DTC lookup on later and previous revisions.

I noticed some error in the printing of c and u errors.

For example in hex C1 07 prints as u0107, must be C0107
and D0 40 prints as u1040, must be u0040

The easiest way will be to exchange c with C0 and keep the rest
and exchange D with U0 and keep the rest.

Will look for the opcodes used on later revisions. I will need to dig out some disassemlies.
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Figured the hardway some opcodes for 06-07 bins.
The other work for most of the 04-05 bins.

For 06-07

BC 30 59 B0 * * * * 66 -dtc table 1 hit

00 03 41 B0 * * * * 66 -dtc status 2 hits

4A 30 31 B0 * * * * 67 2E -dtc mil on/off 2hits
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

These are for 512kb ls1 bin

B0 30 55 B0 * * * * 66 DTC table 1hit

00 03 41 B0 * * * * 66 DTC status 2hits [the same for 06-07 1mb]

4A 30 31 B0 * * * * 67 2E DTC mil on/off 2hits [the same for 06-07 1mb]


This one finds the dtc table for 97-98 ls1 bins and 2001-on v6 bins

B0 30 55 B0 * * * * 66 DTC table

status and mil are still unknown.
Post Reply