LS1 OSID 12225074 bin/xdf/checksum plugin

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
User avatar
antus
Site Admin
Posts: 8231
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

LS1 OSID 12225074 bin/xdf/checksum plugin

Post by antus »

This is alpha v0.1 of an experimental project to create LS1 XDFs and the tools to use them. I originally wrote it in 2011, and figured It should be up on the forms here somewhere. No development work is currently in progress. Personally I would recommend at this stage to use EFI Live for LS1 tuning, as this solution is not complete enough for prime time. But if you want to have a look at it and play around:

To use copy "ls1 checksum plugin" in to Documents\Tunerpro Files\plugins

Then in Tunerpro 5, load the incuded (or another OSID 12225074) bin, and the included XDF.

The checksum is just a 16bit sum, but the plugin implements skipping needed areas to calculate the correct operating system checksum should you devise code patches and wish to define them in the XDF.


2019-01-02 Update: Since this tool was released its been included with many XDF files which do not need it. The plugin is only required for Operating System checksums, so only when your XDF has code patches. To calculate normal checksums use the tunerpro standard plugin, and configure for 16data, 16 bit store, 2s compliment.

I will be releasing an update to this tool shortly with support for the 1Mbyte pcms also, and calling it version 1.1
Attachments
ls1 xdf + plugin v.01.zip
(232.21 KiB) Downloaded 1566 times
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by NSFW »

I realize this is quite an old post, but would you be willing to share the source code for the checksum plugin?

Thanks!
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
antus
Site Admin
Posts: 8231
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by antus »

I dont have permission to distribute the tunerpro sdk and although Mark has kept backwards compatability by means of a version contract between the app and the plugins it loads this is based on a version that is probably no longer current. If you are interested in making a similar plugin, speak to Mark (The TP author) directly.

I'll post the main code here to show what its doing. Essentially the XDF defines the checksum type and start/end/save locations. This plugin does the same as the built in plugin for a 16 but sum but it skips the parts which are other segments. The OS segment spans 3 blocks (bootloader, code before the param blocks and calibration, and code after the calibration). So in TP you specify the start of the lowest block and the end of the highest block and the save location and this plugin skips jumps over the calibration and parameter blocks so the right areas are totaled. It would not be hard to add support for the 1mbyte PCMs. If there is an XDF which includes code patches let me know, and i'll jump on board.

Code: Select all

//---------------------------------------------------------------------------------------
// Func: MMCSCalculateChecksum (Exported)
// Desc: The application will call this function to calculate a checksum. The structure
//       passed in gives the plug-in all of the info necessary to do the work, including
//       the index of the checksum calculation to use. Note that some of the info can be
//       ignored by the plug-in if it isn't needed. More complex checksum calculations,
//       for instance, may not use some of the information passed in.
//---------------------------------------------------------------------------------------
extern "C" __declspec(dllexport)
HRESULT MMCSCalculateChecksum(MMCHECKSUMCALC* pCalcInfo)
{
    HRESULT hr = S_OK;

    // Clear the last error text
    g_strLastError[0] = '\0';

    if ( !pCalcInfo )
    {
        hr = E_INVALIDARG;
        goto Exit;
    }

    if ( pCalcInfo->cbStructSize != sizeof(MMCHECKSUMCALC) )
    {
        hr = HRESULT_FROM_WIN32(ERROR_PRODUCT_VERSION);
        goto Exit;
    }

    // Verify that we have data to work on
    if ( !pCalcInfo->pBaseData || !pCalcInfo->cbBaseData )
    {
        hr = E_INVALIDARG;
        goto Exit;
    }

    //
    // Calculate and store the checksum. The caller tells us which
    // checksum calculator to use.
    //
    switch ( pCalcInfo->dwChecksumIndex )
    {
    case CHECKSUM_LS1:
        {
            unsigned __int16 wChecksum = 0;
            unsigned __int16 temp = 0;
            bool os_hack=0;
            TCHAR msg[128];

            // if we detect its the LS1 OS range, then enable a hack to skip parts that are not included
            if (pCalcInfo->dwRegionStartAddress==0 && pCalcInfo->dwRegionEndAddress==0x7FFFD) os_hack=1;

            sprintf_s (msg, sizeof(msg), "Creating sum for %X to %X", pCalcInfo->dwRegionStartAddress, pCalcInfo->dwRegionEndAddress);
            OutputDebugString(msg);
            if (os_hack) OutputDebugString("Using OS Hack");

            // Simply subtract each element. In this example we ignore type flags and element size,
            // but we mind the addresses and store size.
            if ( pCalcInfo->dwRegionEndAddress < pCalcInfo->cbBaseData )
            {
                for ( UINT ui = pCalcInfo->dwRegionStartAddress; ui <= pCalcInfo->dwRegionEndAddress; ui+=2 ) {
                    // implement os hack jumps, real start and end are configured in xdf, this just jumps unchecked parts
                    if (os_hack && ui==0x500) { ui=0x502; OutputDebugString("Skip 0x500->0x501");}
                    if (os_hack && ui==0x4000) { ui=0x20000; OutputDebugString("Skip 0x4000->0x1FFFF");}
                    temp=pCalcInfo->pBaseData[ui]<<8;
                    temp+=pCalcInfo->pBaseData[ui+1];
                    wChecksum -= temp;
                }

                // Store it where we're told to, and truncate it to the size specified
                if ( pCalcInfo->cbBaseData >= (pCalcInfo->dwStoreAddress + (pCalcInfo->dwStoreSizeBits / 8) - 1) )
                {
                    sprintf_s (msg, sizeof(msg), "Storing sum %2X to %X", wChecksum, pCalcInfo->dwStoreAddress);
                    OutputDebugString(msg);

                    switch ( pCalcInfo->dwStoreSizeBits )
                    {
                    case 16:
                        pCalcInfo->pBaseData[pCalcInfo->dwStoreAddress] = wChecksum>>8;
                        pCalcInfo->pBaseData[pCalcInfo->dwStoreAddress+1] = wChecksum&0xFF;
                        break;
                    default:
                        hr = HRESULT_FROM_WIN32(ERROR_INCORRECT_ADDRESS);
                        StringCbCopyA(g_strLastError, ARRAYSIZE(g_strLastError),
                            "Checksum store size is not 16bit");
                        OutputDebugString("Not 16bit!");
                    }
                }
                else
                {
                    hr = HRESULT_FROM_WIN32(ERROR_INCORRECT_ADDRESS);
                    StringCbCopyA(g_strLastError, ARRAYSIZE(g_strLastError),
                        "Checksum store address is beyond data size");
                    sprintf_s (msg, sizeof(msg), "Checksum store address %X is beyond data size %X", (pCalcInfo->dwStoreAddress + (pCalcInfo->dwStoreSizeBits / 8) - 1), pCalcInfo->cbBaseData);
                    OutputDebugString(msg);
                }
            }
            else
            {
                hr = HRESULT_FROM_WIN32(ERROR_INCORRECT_ADDRESS);
                StringCbCopyA(g_strLastError, ARRAYSIZE(g_strLastError),
                    "Region end address is beyond data size");
                sprintf_s (msg, sizeof(msg), "Region end address %X is beyond data size %X", pCalcInfo->dwRegionEndAddress, pCalcInfo->cbBaseData);
                OutputDebugString(msg);
            }
        }
        break;

    default:
        hr = HRESULT_FROM_WIN32(ERROR_INVALID_INDEX);
        StringCbCopyA(g_strLastError, ARRAYSIZE(g_strLastError),
            "Invalid Checksum Index");
        OutputDebugString("Invalid Checksum Index");
        break;
    }

    Exit:
    return hr;
}
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
02cvman
Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm
cars: 2002 cv8 383 man

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by 02cvman »

hey antus would you be able to post some tables and identifires and thank you for your response on my.post
User avatar
antus
Site Admin
Posts: 8231
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by antus »

Got a couple which you need specifically?
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
02cvman
Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm
cars: 2002 cv8 383 man

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by 02cvman »

what program do you use to read the bin file i know low.oct.table.is adress f760 25x29 and high is fb106 25x29 injection ofset is ea1c 14x5 umm i could.find.all if i.could.just read the bin.correctly id.gladly help working on it.with you
User avatar
antus
Site Admin
Posts: 8231
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by antus »

I use my tool - here: viewtopic.php?f=3&t=3111

I also have a version which writes which has not been released as its a monolithic app without multi thread handling. If you pick up the app with the mouse and hold it up for long enough for vehicle bus chatter to resume it will not be able to recover. For reading this doesnt cause a big problem, but for writing it might. Im hoping to work with forum member NSFW who is more experienced with C# class design. He can build the framework and I can port my code to suit. Then we have a winner and both of us save some time compared to doing it all.

I am able to located tables/scalars/flags - thats not the problem. The problem is effective use of my time. If you want to use my XDF but find something you need missing, you name it. I'll spend an hour and add a couple of items per hit some night after i'm home from my day job and post an update. If you say all items, well, thats too much, so I do nothing. I took a stab at what I thought would be useful in the above, but until NSFW asked about the checksum there was no interest in 4 years. Maybe it was just never noticed :(

Its not locked, you can download it, add what you like, and send it back to me via PM and i'll update the initial post with credit to you for the work.

There is a bin in the zip, and others in the bin thread under Holden bins. This is a screenshot of the XDF now. Jaymes ADX works with the same AVT cable for logging.
Attachments
Screenshot from 2018-03-07 12-13-27.png
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
02cvman
Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm
cars: 2002 cv8 383 man

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by 02cvman »

sorry for the.confusion i.do have a cable and flasher from vnsv5000 works.perfectly what.i ment was for.reading the actual bin file i do have ida but i think im doing something wrong wrong would you be able to.shed some.light on.correctly setting this up.and.the method you use just stuck at.the moment i can tune the.ls1 engines beautifuly for.boost cam ect.i do jave vns 1290005 xdf and osi but its not.100 what i need
User avatar
antus
Site Admin
Posts: 8231
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by antus »

Sorry, but we cant support vn5000s products. You'll need to go back to him for any gaps and support.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
02cvman
Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm
cars: 2002 cv8 383 man

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Post by 02cvman »

ill give him.a go i have met him before dose he view this.site much anymore i jave ao many bin files ive.tried stock bins i just cant see any reference to any maps even for ones i know are there no reference to the map.or.size
Post Reply