GetDtcXmlFileMap Function: Retrieve XML File Mapping for Diagnostic Trouble Codes
{"title":"GetDtcXmlFileMap Function: Retrieve XML File Mapping for Diagnostic Trouble Codes", "description":"This function, GetDtcXmlFileMap, retrieves the XML file mapping for Diagnostic Trouble Codes (DTCs) from a binary file, "PORSCHE_MAPDTC.BIN". The function iterates through the file, searching for a match with the given DTC value. If a match is found, it appends the corresponding XML file path to the provided string.", "keywords":"DTC, Diagnostic Trouble Code, XML, file mapping, PORSCHE_MAPDTC.BIN, binary file, function, GetDtcXmlFileMap", "content":"int __fastcall GetDtcXmlFileMap(int a1, const void **a2, char *a3)\n{\n int v3; // r8\n char *v4; // r4\n int v5; // r0\n int v6; // r0\n int v7; // r0\n int v8; // r11\n int v9; // r10\n signed int v10; // r4\n int v11; // r5\n int v12; // r9\n int v13; // r11\n int v14; // r8\n int v15; // r4\n size_t v16; // r0\n unsigned int v17; // r10\n unsigned int v18; // r5\n size_t v19; // r2\n int v20; // r0\n int v21; // r0\n int result; // r0\n char *dest; // [sp+0h] [bp-118h]\n int v24; // [sp+4h] [bp-114h]\n int v25; // [sp+Ch] [bp-10Ch]\n const void **v26; // [sp+10h] [bp-108h]\n int v27; // [sp+14h] [bp-104h]\n void *s2; // [sp+18h] [bp-100h]\n int v29; // [sp+1Ch] [bp-FCh]\n int v30; // [sp+20h] [bp-F8h]\n char v31[200]; // [sp+28h] [bp-F0h]\n char src[20]; // [sp+F0h] [bp-28h]\n int v33; // [sp+108h] [bp-10h]\n\n v3 = a1;\n v26 = a2;\n v4 = a3;\n v24 = 0;\n v30 = 0;\n v5 = j_OpenDiagReadFileDll(0);\n v6 = j_OpenSearchIDDLL(v5);\n j_OpenShowInterfaceDLL(v6);\n ShowMessageBoxID(-16772089, -16772087, 5);\n v7 = fopen("PORSCHE_MAPDTC.BIN", "rb");\n v8 = v7;\n if ( v7 )\n {\n dest = v4;\n v9 = 1;\n v24 = 0;\n move_lib_data(v7, 0, &v30, 1);\n if ( v30 >= 1 )\n {\n v10 = 5;\n v11 = 0;\n while ( 1 )\n {\n *(_DWORD *)v31 = 0;\n move_lib_data(v8, v10 - 4, v31, 4);\n if ( *(_DWORD *)v31 == v3 )\n break;\n v10 += 8;\n if ( ++v11 >= v30 )\n {\n v9 = v10 - 4;\n goto LABEL_8;\n }\n }\n move_lib_data(v8, v10, v31, 4);\n v9 = *(_DWORD *)v31;\n }\nLABEL_8:\n v27 = v8;\n move_lib_data(v8, v9, &v30, 4);\n _aeabi_memclr8(src, 20);\n _aeabi_memclr8(v31, 200);\n v12 = v30;\n v29 = 0;\n s2 = &byte_240C88;\n if ( v30 >= 1 )\n {\n v25 = v9 + 4;\n v13 = 0;\n while ( 2 )\n {\n v14 = v12 - 1;\n while ( 1 )\n {\n _aeabi_memclr8(v31, 200);\n v12 = (v13 + v14) / 2;\n v15 = ReadStrFromFile(v27, v25 + 49 * v12, v31);\n v16 = strlen(v31);\n sub_1C6D58((_BYTE **)&s2, v31, v16);\n v17 = *((_DWORD *)s2 - 3);\n v18 = *((_DWORD *)*v26 - 3);\n v19 = *((_DWORD *)*v26 - 3);\n if ( v18 > v17 )\n v19 = *((_DWORD *)s2 - 3);\n v20 = memcmp(*v26, s2, v19);\n if ( !v20 )\n v20 = v18 - v17;\n if ( v20 <= -1 )\n break;\n if ( !v20 )\n {\n _aeabi_memclr8(src, 20);\n v21 = ReadStrFromFile(v27, v15, src);\n v29 = 0;\n move_lib_data(v27, v21, &v29, 4);\n v24 = v29;\n strcat(dest, src);\n goto LABEL_22;\n }\n v13 = v12 + 1;\n if ( v14 <= v12 )\n {\n v24 = 0;\n goto LABEL_22;\n }\n }\n v24 = 0;\n if ( v12 > v13 )\n continue;\n break;\n }\n }\nLABEL_22:\n CloseExFile(v27);\n sub_1C6FB4((unsigned int *)s2 - 3);\n }\n result = _stack_chk_guard - v33;\n if ( _stack_chk_guard == v33 )\n result = v24;\n return result;\n}"}
原文地址: https://www.cveoy.top/t/topic/o96L 著作权归作者所有。请勿转载和采集!