Skip to content

XNul32.dll - Null Interface Analysis

Decompilation analysis of the EDIABAS Null/Dummy interface driver.

Overview

Purpose: Stub/dummy interface that returns simulated responses without actual hardware communication.

Use Case: Testing, development, offline simulation.

Size: ~5.7K lines of decompiled code


Exported Functions

ExportOrdinalDescription
dllStartupIFH6Initialize interface
dllShutdownIFH5Shutdown interface
dllCheckIFH2Check interface capability
dllCallIFH1Execute IFH command

Function Analysis

dllStartupIFH

c
uint dllStartupIFH(undefined4 unused, char* ifh_name) {
    // Copy IFH name to global buffer (max ~256 bytes)
    size_t len = strlen(ifh_name);
    memcpy(&global_ifh_name, ifh_name, len);
    
    // Return success (high word = 0)
    return 0;
}

Parameters:

  • unused - Not used
  • ifh_name - Interface name string

Returns: 0 on success


dllShutdownIFH

c
void dllShutdownIFH(void) {
    // No-op - nothing to clean up
    return;
}

dllCheckIFH

c
byte dllCheckIFH(short cmd) {
    // Only command 6 (GET_INFO) returns 0 (supported)
    // All others return 0x1D (29 = not supported)
    if (cmd == 6) {
        return 0;
    }
    return 0x1D;
}

Commands:

CodeSupportedDescription
6YesGet interface info
OtherNoReturns error 0x1D

dllCallIFH

Main command dispatcher. Handles IFH commands 2-51.

c
uint dllCallIFH(short* request, short* response) {
    short cmd;
    
    // Validate request
    uint result = validate_request(&request, response);
    if (result != 0) {
        return result;  // Error in high word cleared
    }
    
    cmd = *request;
    
    // Dispatch based on command (2-51 range)
    if (cmd - 2 >= 50) {
        return 0;  // Out of range - ignore
    }
    
    switch (cmd) {
        case 2:  // IFH_INIT
            result = handle_init();
            response[1] = 0;
            // Copy interface name to response
            strcpy((char*)&response[2], global_ifh_name);
            break;
            
        case 3:  // IFH_END
            break;
            
        case 4:  // IFH_CONNECT
            // Return success
            response[1] = 0;
            break;
            
        case 5:  // IFH_DISCONNECT
            break;
            
        case 6:  // IFH_SYSINFO
            // Return interface info
            response[1] = 0;
            response[2] = 0x0001;  // Version
            break;
            
        case 0x16:  // IFH_SEND
            // Simulate send - always succeeds
            break;
            
        case 0x17:  // IFH_RECEIVE
            // Return empty response
            response[1] = 0;  // No data
            break;
            
        case 0x1E:  // IFH_GETERROR
            // Return no error
            response[1] = 0;
            break;
            
        case 0x22:  // IFH_SETPARAMETER
            // Accept any parameters
            break;
            
        case 0x23:  // IFH_GETPARAMETER
            // Return empty
            response[1] = 0;
            break;
            
        default:
            // Unsupported command
            break;
    }
    
    return 0;
}

IFH Command Codes

CodeHexNameDescription
20x02IFH_INITInitialize interface
30x03IFH_ENDTerminate interface
40x04IFH_CONNECTConnect to ECU
50x05IFH_DISCONNECTDisconnect from ECU
60x06IFH_SYSINFOGet system info
220x16IFH_SENDSend telegram
230x17IFH_RECEIVEReceive telegram
300x1EIFH_GETERRORGet last error
340x22IFH_SETPARAMETERSet parameters
350x23IFH_GETPARAMETERGet parameters

Global Variables

AddressNamePurpose
DAT_10009e3cglobal_ifh_nameStored interface name
DAT_10009d00work_bufferTemporary work buffer

Error Codes

CodeHexDescription
00x00Success
290x1DCommand not supported

Notes

  1. No Hardware: This interface performs no actual I/O
  2. Simulation: All operations succeed without side effects
  3. Testing: Useful for unit tests and SGBD validation
  4. Minimal: Only implements essential IFH commands