LS1 OSID 12225074 bin/xdf/checksum plugin

Programs / Tools / Scripts
Site Admin
User avatar
Posts: 5091
Joined: Sat Feb 28, 2009 8:34 pm

LS1 OSID 12225074 bin/xdf/checksum plugin

Postby antus » Sun Nov 16, 2014 4:44 pm

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.
Attachments
ls1 xdf + plugin v.01.zip
(232.21 KiB) Downloaded 268 times
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

User avatar
Posts: 36
Joined: Fri Feb 02, 2018 3:13 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby NSFW » Fri Feb 02, 2018 3:33 pm

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

Thanks!

Site Admin
User avatar
Posts: 5091
Joined: Sat Feb 28, 2009 8:34 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby antus » Sun Feb 25, 2018 8:33 am

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: viewtopic.php?f=7&t=1396

Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby 02cvman » Tue Mar 06, 2018 10:42 pm

hey antus would you be able to post some tables and identifires and thank you for your response on my.post

Site Admin
User avatar
Posts: 5091
Joined: Sat Feb 28, 2009 8:34 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby antus » Wed Mar 07, 2018 7:38 am

Got a couple which you need specifically?
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby 02cvman » Wed Mar 07, 2018 10:39 am

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

Site Admin
User avatar
Posts: 5091
Joined: Sat Feb 28, 2009 8:34 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby antus » Wed Mar 07, 2018 11:48 am

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: viewtopic.php?f=7&t=1396

Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby 02cvman » Thu Mar 08, 2018 8:56 pm

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

Site Admin
User avatar
Posts: 5091
Joined: Sat Feb 28, 2009 8:34 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby antus » Thu Mar 08, 2018 9:32 pm

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: viewtopic.php?f=7&t=1396

Posts: 10
Joined: Mon Mar 05, 2018 8:11 pm

Re: LS1 OSID 12225074 bin/xdf/checksum plugin

Postby 02cvman » Thu Mar 08, 2018 10:58 pm

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

Next

Return to Tools

Who is online

Users browsing this forum: No registered users and 2 guests