Winols Checksum Dll -

Most ECUs (Bosch, Delphi) use big-endian for checksums. Intel/Motorola MCUs may differ. Always verify against an original unmodified binary. 6.3 Debugging Use OutputDebugString() from Windows API and monitor with DebugView to trace execution without crashing WinOLS.

#ifdef __cplusplus

DLL_EXPORT int __stdcall GetDllVersion(void); DLL_EXPORT int __stdcall GetPluginType(void); DLL_EXPORT int __stdcall CalculateChecksum(tChecksumInfo* info); Winols Checksum Dll

int __stdcall GetDllVersion(void) return DLL_VERSION;

// Byte swap for little-endian ECU return (crc >> 8) Most ECUs (Bosch, Delphi) use big-endian for checksums

int __stdcall GetPluginType(void) return PLUGIN_TYPE_CHECKSUM;

EXPORTS GetDllVersion GetPluginType CalculateChecksum While WinOLS includes native checksum routines for many

Abstract WinOLS is the industry standard for Engine Control Unit (ECU) tuning and calibration. A critical function within this ecosystem is the correction of checksums after binary modifications. While WinOLS includes native checksum routines for many ECUs, developers often need custom algorithms for rare, undocumented, or proprietary ECUs. This paper details the architecture, development, and implementation of a custom Checksum DLL for WinOLS using C/C++. 1. Introduction Modifying a binary file (e.g., MAP, PID, limiter values) without updating its checksum results in a non-booting ECU due to a "Checksum Error" triggered during power-on self-test. WinOLS allows externalization of checksum logic via a standardized DLL interface. Understanding this interface enables tuners to support any ECU architecture. 2. WinOLS DLL Interface Specification WinOLS interacts with custom DLLs via a strict calling convention. The DLL must export three specific functions. 2.1 Required Exported Functions | Function Name | Calling Convention | Purpose | |---------------|--------------------|---------| | GetDllVersion | __stdcall | Returns API version compatibility. | | GetPluginType | __stdcall | Returns a constant identifying the plugin as a checksum module. | | CalculateChecksum | __stdcall | Core function: receives binary data, calculates checksum, returns result. | 2.2 Data Structures The CalculateChecksum function receives a tChecksumInfo structure:

uint16_t custom_crc16(const uint8_t* data, uint32_t len, uint16_t init) uint16_t crc = init; for (uint32_t i = 0; i < len; i++) crc ^= (data[i] << 8); for (int bit = 0; bit < 8; bit++) if (crc & 0x8000) crc = (crc << 1) ^ 0x8005; else crc = crc << 1;

switch(info->algorithmID) case 1: return crc16_ibm(info); case 2: return checksum_me7_sum8(info); case 3: return custom_renault_checksum(info);