Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: CMD Exhaust brake memory cax

  1. #11
    Senior Member Jim P's Avatar
    Join Date
    Nov 2019
    Posts
    178

    Default

    Code from a 2012 calibration for the exhaust brake switch save

    void FUN_0018fdc0(void)

    {
    undefined uVar1;
    undefined1 *puVar2;

    puVar2 = &DAT_60010590;
    DAT_6000c774 = 0xfffa;
    FUN_00063070(&DAT_00011ace,0xfffffffffffffffa);
    uVar1 = T_CANC_Exhaust_Brake_Switch_Saved;
    CANC_Exhaust_Brake_Switch = uVar1;
    *(undefined2 *)(&DAT_ffffc20e + (int)puVar2) = 0;
    FUN_00063070(&PTR_00012b6f,0);
    return;
    }

    undefined8 FUN_00198570(int param_1)

    {
    undefined *puVar1;
    short sVar2;
    short sVar3;
    char cVar4;
    byte bVar5;
    ushort uVar6;
    ulonglong uVar7;
    longlong lVar8;
    undefined1 *puVar9;
    undefined1 *puVar10;
    undefined uVar11;

    puVar10 = &DAT_60010590;
    puVar9 = &DAT_60010590;
    sVar2 = DAT_6000c774;
    sVar3 = DAT_6000c79e;
    if ((param_1 != 0) && (*(ushort *)(param_1 + 4) < 5)) {
    param_1 = 0;
    uVar6 = CGW3_3FBH_Msg_Status;
    CGW3_3FBH_Msg_Status = uVar6 | 2;
    CGW3_3FBH_Msg_Timer = 0;
    }
    if (param_1 == 0) {
    if (sVar2 != -7) {
    DAT_6000c774 = 0xfff9;
    puVar10 = &DAT_60010590;
    FUN_00063070(&DAT_00011ace,0xfffffffffffffff9);
    CANC_Eb_Sw_Psd = '\0';
    }
    if (*(short *)(&DAT_ffffc20e + (int)puVar10) != -7) {
    *(undefined2 *)(&DAT_ffffc20e + (int)puVar10) = 0xfff9;
    FUN_00063070(&PTR_00012b6f,0xfffffffffffffff9);
    if ((*(char **)(puVar10 + -0x3e04) != (char *)0x0) && (**(char **)(puVar10 + -0x3e04) != '\0')
    ) {
    cVar4 = C_CANC_EB_Switch_Msg_Lost_Val;
    if (cVar4 == '\0') {
    uVar11 = 0;
    }
    else {
    if (cVar4 != '\x01') {
    return 1;
    }
    uVar11 = 1;
    }
    T_CANC_Exhaust_Brake_Switch_Saved = uVar11;
    CANC_Exhaust_Brake_Switch = uVar11;
    }
    }
    }
    else {
    uVar6 = CGW3_3FBH_Msg_Status;
    CGW3_3FBH_Msg_Status = uVar6 & 0xffe9;
    CGW3_3FBH_Msg_Timer = 0;
    puVar1 = *(undefined **)(param_1 + 8);
    CGW3_3FBH_Msg_Data_0 = *puVar1;
    CGW3_3FBH_Msg_Data_1 = puVar1[1];
    CGW3_3FBH_Msg_Data_2 = puVar1[2];
    CGW3_3FBH_Msg_Data_3 = puVar1[3];
    CGW3_3FBH_Msg_Data_4 = puVar1[4];
    uVar7 = ((ulonglong)(byte)puVar1[4] << 0x20) >> 0x22 & 1;
    CGW3_3FBH_Msg_Data_5 = puVar1[5];
    CGW3_3FBH_Msg_Data_6 = puVar1[6];
    CGW3_3FBH_Msg_Data_7 = puVar1[7];
    cVar4 = CANC_Eb_Sw_Psd;
    CANC_Eb_Sw_Psd = (char)uVar7;
    DAT_6000c774 = 0;
    DAT_6000c79e = 0;
    if (((int)uVar7 == 1) && (cVar4 == '\0')) {
    bVar5 = CANC_Exhaust_Brake_Switch;
    lVar8 = countLeadingZeros((uint)bVar5);
    CANC_Exhaust_Brake_Switch = (char)((ulonglong)(lVar8 << 0x20) >> 0x25);
    }
    T_CANC_Exhaust_Brake_Switch_Saved = 0;
    if (sVar2 != 0) {
    puVar9 = puVar10;
    FUN_00063070(&DAT_00011ace,0);
    }
    if (sVar3 != *(short *)(&DAT_ffffc20e + (int)puVar9)) {
    FUN_00063070(&PTR_00012b6f);
    }
    }
    return 1;
    }

  2. #12
    Senior Member Jim P's Avatar
    Join Date
    Nov 2019
    Posts
    178

    Default

    from the last revision (rev 9) of a 2018 calibration, less "labeled" than the 2012

    undefined8 FUN_00222210(int param_1)

    {
    byte bVar1;
    byte *pbVar2;
    byte bVar3;
    byte bVar4;
    char cVar5;
    short sVar6;
    short sVar7;
    undefined2 uVar8;
    byte bVar9;
    ushort uVar10;

    uVar10 = DAT_60072484;
    sVar6 = DAT_6000fd70;
    if ((uVar10 & 0x40) == 0) {
    if ((param_1 != 0) && (*(ushort *)(param_1 + 4) < 5)) {
    param_1 = 0;
    uVar10 = uVar10 | 2;
    DAT_60072484 = uVar10;
    DAT_60072486 = 0;
    }
    if (param_1 == 0) {
    DAT_6000fd70 = 0xfff9;
    DAT_60072124 = 3;
    DAT_60072123 = 0xf;
    }
    else {
    DAT_60072484 = uVar10 & 0x2fe9;
    DAT_60072486 = 0;
    pbVar2 = *(byte **)(param_1 + 8);
    DAT_6007247c = *pbVar2;
    DAT_6007247d = pbVar2[1];
    DAT_6007247e = pbVar2[2];
    bVar1 = pbVar2[3];
    DAT_6007247f = bVar1;
    DAT_60072480 = pbVar2[4];
    DAT_60072481 = pbVar2[5];
    DAT_60072482 = pbVar2[6];
    DAT_60072483 = pbVar2[7];
    bVar3 = *pbVar2 & 3;
    DAT_60072124 = bVar3;
    DAT_60072123 = (char)(((ulonglong)bVar1 << 0x20) >> 0x24);
    DAT_6000fd70 = 0;
    bVar4 = DAT_6000b345;
    bVar9 = C_CANC_EB_Trlr_Count;
    if ((((bVar4 < bVar9) && (cVar5 = C_CANC_EB_Switch_Save_Enable, cVar5 == '\0')) &&
    ((DAT_6000b345 = bVar4 + 1, bVar3 == 1 || (bVar1 >> 4 == 5)))) &&
    (cVar5 = DAT_6000b346, cVar5 == '\0')) {
    bVar1 = DAT_6000fe0f;
    DAT_600b4b74 = bVar1;
    DAT_60072101 = (&C_CANC_EB_States)[bVar1];
    DAT_600b4b69 = (&C_CANC_DL_EB_States)[bVar1];
    DAT_6000b345 = 0xff;
    }
    }
    sVar7 = DAT_6000fd70;
    if (sVar7 != sVar6) {
    FUN_00068070(&DAT_00025484);
    uVar8 = DAT_6000fd70;
    FUN_00068070(&DAT_00025485,uVar8);
    }
    }
    return 1;
    }


    undefined8 FUN_002257a0(void)

    {
    byte bVar1;
    ushort *puVar2;
    bool bVar3;
    undefined4 uVar4;
    ushort uVar5;
    byte bVar6;
    char cVar9;
    longlong lVar7;
    ulonglong uVar8;
    uint uVar10;
    ushort uVar11;
    byte bVar12;
    ulonglong uVar13;
    byte bVar14;
    byte bVar15;
    int iVar16;
    ulonglong uVar17;
    longlong lVar18;
    undefined uVar21;
    short sVar20;
    int iVar19;
    undefined auStack_38 [2];
    undefined auStack_36 [2];
    undefined local_34;
    undefined local_33;
    undefined local_32;
    byte local_31;
    undefined local_30;
    undefined local_2f;
    undefined local_2e;
    undefined local_2d;
    undefined local_2c;
    undefined4 local_28;

    uVar17 = ZEXT48(&DAT_60012c20);
    uVar4 = DAT_6000fcb0;
    FUN_00067020(uVar4,auStack_38,&DAT_6000fcd4);
    FUN_00067020(*(undefined4 *)((int)uVar17 + -0x2f6c),auStack_36,uVar17 - 0x2f48);
    iVar16 = (int)uVar17;
    if (((*(int *)(iVar16 + -0x31a8) == 0) ||
    (cVar9 = FUN_00066570(*(undefined2 *)(iVar16 + -0x2e6e)), cVar9 != '\0')) ||
    (cVar9 = FUN_00066570(*(undefined2 *)(iVar16 + -0x2e6c)), cVar9 != '\0')) {
    uVar17 = 0xff;
    }
    else {
    lVar7 = FUN_001079f8(**(undefined4 **)(iVar16 + -0x31a8));
    uVar17 = lVar7 + 0x28;
    if ((longlong)uVar17 < 0) {
    uVar17 = 0;
    }
    else if (0xfe < (int)uVar17) {
    uVar17 = 0xfe;
    }
    }
    DAT_600722b3 = (char)uVar17;
    bVar12 = *(byte *)(iVar16 + -0x2e29);
    uVar13 = ((ulonglong)bVar12 << 0x20) >> 0x21 & 1;
    uVar8 = FUN_00225760(uVar17,uVar13);
    *(byte *)(iVar16 + -0x2e29) = bVar12 + 1;
    bVar6 = DAT_600722b2;
    DAT_600722b2 = bVar6 & 0x7f;
    bVar1 = (byte)((uVar13 & 1) << 7);
    DAT_600722b2 = bVar6 & 0x7f | bVar1;
    bVar14 = bVar6 & 0x3f | bVar1;
    DAT_600722b2 = bVar14;
    bVar12 = (byte)((uVar8 & 1) << 6);
    DAT_600722b2 = bVar14 | bVar12;
    if (*(byte **)(iVar16 + -0x3038) != (byte *)0x0) {
    bVar14 = DAT_600722b1;
    DAT_600722b1 = bVar14 & 0xcf;
    DAT_600722b1 = bVar14 & 0xcf | (byte)(((ulonglong)**(byte **)(iVar16 + -0x3038) & 3) << 4);
    }
    if (*(char *)(iVar16 + -0x2e10) != '\0') {
    cVar9 = C_CANC_EB_Switch_Save_Enable;
    if (cVar9 == '\0') {
    *(undefined *)(iVar16 + -0x78db) = 0;
    *(undefined *)(iVar16 + -0x78da) = 0;
    *(undefined *)(iVar16 + -0x2e10) = 0;
    uVar21 = DAT_600b4b74;
    *(undefined *)(iVar16 + -0x2e11) = uVar21;
    DAT_600b4b74 = 0;
    }
    bVar14 = DAT_600b4b74;
    DAT_60072101 = (&C_CANC_EB_States)[bVar14];
    DAT_600b4b69 = (&C_CANC_DL_EB_States)[bVar14];
    }
    bVar14 = DAT_600722b0;
    DAT_600722b0 = bVar14 & 0x1f;
    bVar15 = DAT_600b4b69;
    DAT_600722b0 = bVar14 & 0x1f | (byte)(((ulonglong)bVar15 & 7) << 5);
    if ((*(short **)(iVar16 + -0x3060) == (short *)0x0) || (**(short **)(iVar16 + -0x3060) < 1)) {
    bVar3 = false;
    }
    else {
    bVar3 = true;
    }
    if ((bVar3) && (*(char **)(iVar16 + -0x3000) != (char *)0x0)) {
    if (**(char **)(iVar16 + -0x3000) == '\0') {
    lVar7 = 1;
    }
    else {
    lVar7 = 2;
    }
    }
    else {
    lVar7 = 0;
    }
    bVar15 = bVar6 & 0x39 | bVar1 | bVar12;
    DAT_600722b2 = bVar15;
    bVar14 = (byte)(lVar7 << 1);
    DAT_600722b2 = bVar15 | bVar14;
    uVar10 = 0;
    do {
    if ((byte)(&DAT_003364e4)[uVar10] == 0) {
    uVar17 = 0;
    break;
    }
    if (**(ushort **)(iVar16 + -0x312c) == (ushort)(byte)(&DAT_003364e4)[uVar10]) {
    uVar17 = 1;
    break;
    }
    uVar10 = uVar10 + 1 & 0xff;
    } while (uVar10 < 0x19);
    bVar14 = bVar6 & 0x31 | bVar1 | bVar12 | bVar14;
    DAT_600722b2 = bVar14;
    DAT_600722b2 = bVar14 | (byte)((uVar17 & 1) << 3);
    if (((*(char **)(iVar16 + -0x2fd0) == (char *)0x0) || (**(char **)(iVar16 + -0x2fd0) == '\0')) &&
    ((*(char **)(iVar16 + -0x2fcc) == (char *)0x0 || (**(char **)(iVar16 + -0x2fcc) == '\0')))) {
    bVar12 = 0;
    }
    else {
    bVar12 = 1;
    }
    bVar1 = DAT_600722b1;
    DAT_600722b1 = bVar1 & 0xfe;
    DAT_600722b1 = bVar1 & 0xfe | bVar12;
    cVar9 = FUN_00066570(*(undefined2 *)(iVar16 + -0x2e70));
    if (((cVar9 == '\0') && (cVar9 = FUN_00066570(*(undefined2 *)(iVar16 + -0x2e72)), cVar9 == '\0'))
    && ((*(char **)(iVar16 + -0x2fe0) == (char *)0x0 || (**(char **)(iVar16 + -0x2fe0) == '\0'))))
    {
    lVar18 = 0;
    }
    else {
    lVar18 = 1;
    }
    bVar12 = DAT_600722b1;
    DAT_600722b1 = bVar12 & 0xfd;
    local_31 = (byte)(lVar18 << 1);
    DAT_600722b1 = bVar12 & 0xfd | local_31;
    puVar2 = *(ushort **)(iVar16 + -0x30d8);
    if (puVar2 == (ushort *)0x0) {
    uVar21 = 0;
    }
    else {
    bVar1 = DAT_600722b2;
    DAT_600722b2 = bVar1 & 0xef;
    DAT_600722b2 = bVar1 & 0xef | (byte)(((ulonglong)*puVar2 & 1) << 4);
    uVar21 = (undefined)*puVar2;
    }
    DAT_60072183 = uVar21;
    if ((((*(byte **)(iVar16 + -0x2fb8) == (byte *)0x0) ||
    (bVar1 = **(byte **)(iVar16 + -0x2fb8), uVar17 = (ulonglong)bVar1, bVar1 == 0)) ||
    (*(int **)(iVar16 + -0x3198) == (int *)0x0)) || (**(int **)(iVar16 + -0x3198) != 0)) {
    DAT_60072126 = 0;
    }
    else {
    uVar11 = DAT_60072126;
    uVar5 = DAT_60042a22;
    if (uVar11 < uVar5) {
    uVar11 = uVar11 + 100;
    DAT_60072126 = uVar11;
    }
    if (uVar5 <= uVar11) goto LAB_00225b70;
    }
    uVar17 = 0;
    LAB_00225b70:
    local_31 = bVar12 & 0xbd | local_31;
    DAT_600722b1 = local_31;
    local_31 = local_31 | (byte)((uVar17 & 1) << 6);
    DAT_600722b1 = local_31;
    cVar9 = DAT_60042a69;
    if (cVar9 != '\0') {
    *(undefined *)(iVar16 + -0x2e3c) = 1;
    DAT_600723b8 = (int)lVar7;
    }
    if (*(short **)(iVar16 + -0x3054) == (short *)0x0) {
    sVar20 = 0xff;
    }
    else {
    sVar20 = **(short **)(iVar16 + -0x3054) >> 6;
    if (sVar20 < 0) {
    sVar20 = 0;
    }
    else if (0xfa < sVar20) {
    sVar20 = 0xfa;
    }
    }
    local_2e = (undefined)sVar20;
    DAT_600722b4 = local_2e;
    if (*(int **)(iVar16 + -0x3164) == (int *)0x0) {
    iVar19 = 0xff;
    }
    else {
    iVar19 = **(int **)(iVar16 + -0x3164) >> 0xf;
    if (iVar19 < 0) {
    iVar19 = 0;
    }
    else if (0xfa < iVar19) {
    iVar19 = 0xfa;
    }
    }
    local_2d = (undefined)iVar19;
    DAT_600722b5 = local_2d;
    if (((*(short **)(iVar16 + -0x3098) == (short *)0x0) ||
    (*(undefined2 **)(iVar16 + -0x30a8) == (undefined2 *)0x0)) ||
    (sVar20 = **(short **)(iVar16 + -0x3098), sVar20 == 0)) {
    local_34 = 0xff;
    }
    else if (sVar20 == 1) {
    local_34 = 0;
    }
    else {
    local_34 = (undefined)**(undefined2 **)(iVar16 + -0x30a8);
    }
    DAT_600722ae = local_34;
    local_28 = 0x614;
    local_2c = 8;
    local_33 = DAT_600722af;
    local_32 = DAT_600722b0;
    local_30 = DAT_600722b2;
    local_2f = DAT_600722b3;
    FUN_0006a4d0(DAT_003364e2,&local_34);
    return 1;
    }

  3. #13
    Senior Member Jim P's Avatar
    Join Date
    Nov 2019
    Posts
    178

    Default

    big difference there

  4. #14
    Senior Member Jim P's Avatar
    Join Date
    Nov 2019
    Posts
    178

    Default

    Entirely unrelated but I’ve figured out how to get the bootloader code from the ecm

Page 2 of 2 FirstFirst 12

Similar Threads

  1. 2018 CME Exhaust brake memory .cax
    By DaneF in forum Cummins 6.7L
    Replies: 4
    Last Post: December 24th, 2023, 03:53 PM
  2. LML Exhaust brake memory
    By DaneF in forum Duramax 2011+ LML / LGH
    Replies: 1
    Last Post: May 10th, 2022, 05:17 AM
  3. CAX and CMD, CME
    By Red66 in forum Cummins 6.7L
    Replies: 6
    Last Post: July 13th, 2017, 04:53 AM
  4. LML Exhaust Brake Problem - I think
    By 2013 Silverado 3500 in forum Diesel
    Replies: 3
    Last Post: October 10th, 2013, 11:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •