159 lines
4.5 KiB
C
159 lines
4.5 KiB
C
/* AgentManager_Release_x64.exe sha256 8fd8ca91725858651a7839d34257b10c2970ac16c97e60c523b8b0c983fcb186
|
|
* Ghidra 12.1.2 decompiler output for 0x140021a40 FUN_140021a40
|
|
* Pseudocode, not original source. */
|
|
|
|
undefined8 * FUN_140021a40(longlong *param_1,byte *param_2,int param_3)
|
|
|
|
{
|
|
char cVar1;
|
|
byte bVar2;
|
|
int iVar3;
|
|
byte *pbVar4;
|
|
longlong lVar5;
|
|
undefined8 uVar6;
|
|
undefined8 *puVar7;
|
|
byte *pbVar8;
|
|
undefined8 *puVar9;
|
|
char *pcVar10;
|
|
ulonglong uVar11;
|
|
|
|
pbVar4 = FUN_140020ee0(param_2,param_3);
|
|
if (((pbVar4 == (byte *)0x0) || (*pbVar4 == 0)) || (*pbVar4 != 0x3c)) {
|
|
return (undefined8 *)0x0;
|
|
}
|
|
lVar5 = FUN_14001e4f0(param_1);
|
|
pbVar4 = FUN_140020ee0(pbVar4,param_3);
|
|
if (pbVar4 == (byte *)0x0) {
|
|
return (undefined8 *)0x0;
|
|
}
|
|
if (*pbVar4 == 0) {
|
|
return (undefined8 *)0x0;
|
|
}
|
|
uVar6 = FUN_140021270((char *)pbVar4,"<?xml",'\x01',param_3);
|
|
if ((char)uVar6 == '\0') {
|
|
pbVar8 = &DAT_140132768;
|
|
bVar2 = *pbVar4;
|
|
if (bVar2 != 0) {
|
|
do {
|
|
if (*pbVar8 == 0) goto LAB_140021b6b;
|
|
} while (((pbVar4 + -0x140132768)[(longlong)pbVar8] == *pbVar8) &&
|
|
(pbVar8 = pbVar8 + 1, (pbVar4 + -0x140132768)[(longlong)pbVar8] != 0));
|
|
if (*pbVar8 == 0) {
|
|
LAB_140021b6b:
|
|
puVar7 = operator_new(0x58);
|
|
if (puVar7 != (undefined8 *)0x0) {
|
|
puVar7[1] = 0xffffffffffffffff;
|
|
puVar7[2] = 0;
|
|
puVar7[7] = &DAT_14017ce88;
|
|
puVar7[3] = 0;
|
|
*(undefined4 *)(puVar7 + 4) = 2;
|
|
puVar7[5] = 0;
|
|
puVar7[6] = 0;
|
|
puVar7[9] = 0;
|
|
puVar7[10] = 0;
|
|
*puVar7 = TiXmlComment::vftable;
|
|
goto LAB_140021ce5;
|
|
}
|
|
goto LAB_140021c9d;
|
|
}
|
|
}
|
|
pbVar8 = &DAT_140132758;
|
|
if (bVar2 != 0) {
|
|
do {
|
|
if (*pbVar8 == 0) goto LAB_140021bf1;
|
|
} while (((pbVar4 + -0x140132758)[(longlong)pbVar8] == *pbVar8) &&
|
|
(pbVar8 = pbVar8 + 1, (pbVar4 + -0x140132758)[(longlong)pbVar8] != 0));
|
|
if (*pbVar8 == 0) {
|
|
LAB_140021bf1:
|
|
puVar9 = operator_new(0x60);
|
|
puVar7 = (undefined8 *)0x0;
|
|
if (puVar9 != (undefined8 *)0x0) {
|
|
puVar7 = FUN_14001e6f0(puVar9);
|
|
}
|
|
*(undefined1 *)(puVar7 + 0xb) = 1;
|
|
goto LAB_140021ce5;
|
|
}
|
|
}
|
|
pcVar10 = "<!";
|
|
if (bVar2 == 0) {
|
|
LAB_140021ca3:
|
|
if (((0x7e < pbVar4[1]) || (iVar3 = isalpha((uint)pbVar4[1]), iVar3 != 0)) ||
|
|
(pbVar4[1] == 0x5f)) {
|
|
puVar9 = operator_new(0xa8);
|
|
puVar7 = (undefined8 *)0x0;
|
|
if (puVar9 != (undefined8 *)0x0) {
|
|
puVar7 = FUN_14001ef00(puVar9,&DAT_140132660);
|
|
}
|
|
goto LAB_140021ce5;
|
|
}
|
|
}
|
|
else {
|
|
do {
|
|
if (*pcVar10 == '\0') goto LAB_140021c4a;
|
|
} while ((pcVar10[(longlong)(pbVar4 + -0x140132b70)] == *pcVar10) &&
|
|
(pcVar10 = pcVar10 + 1, pcVar10[(longlong)(pbVar4 + -0x140132b70)] != '\0'));
|
|
if (*pcVar10 != '\0') goto LAB_140021ca3;
|
|
}
|
|
LAB_140021c4a:
|
|
puVar7 = operator_new(0x58);
|
|
if (puVar7 != (undefined8 *)0x0) {
|
|
puVar7[1] = 0xffffffffffffffff;
|
|
puVar7[2] = 0;
|
|
puVar7[7] = &DAT_14017ce88;
|
|
puVar7[3] = 0;
|
|
*(undefined4 *)(puVar7 + 4) = 3;
|
|
puVar7[5] = 0;
|
|
puVar7[6] = 0;
|
|
puVar7[9] = 0;
|
|
puVar7[10] = 0;
|
|
*puVar7 = TiXmlUnknown::vftable;
|
|
goto LAB_140021ce5;
|
|
}
|
|
}
|
|
else {
|
|
puVar7 = operator_new(0x88);
|
|
if (puVar7 != (undefined8 *)0x0) {
|
|
puVar7[1] = 0xffffffffffffffff;
|
|
puVar7[2] = 0;
|
|
puVar7[7] = &DAT_14017ce88;
|
|
puVar7[3] = 0;
|
|
*(undefined4 *)(puVar7 + 4) = 5;
|
|
puVar7[5] = 0;
|
|
puVar7[6] = 0;
|
|
puVar7[9] = 0;
|
|
puVar7[10] = 0;
|
|
*puVar7 = TiXmlDeclaration::vftable;
|
|
puVar7[0xb] = &DAT_14017ce88;
|
|
puVar7[0xd] = &DAT_14017ce88;
|
|
puVar7[0xf] = &DAT_14017ce88;
|
|
goto LAB_140021ce5;
|
|
}
|
|
}
|
|
LAB_140021c9d:
|
|
puVar7 = (undefined8 *)0x0;
|
|
LAB_140021ce5:
|
|
if (puVar7 != (undefined8 *)0x0) {
|
|
puVar7[3] = param_1;
|
|
return puVar7;
|
|
}
|
|
if (lVar5 == 0) {
|
|
return (undefined8 *)0x0;
|
|
}
|
|
if (*(char *)(lVar5 + 0x58) != '\0') {
|
|
return (undefined8 *)0x0;
|
|
}
|
|
*(undefined1 *)(lVar5 + 0x58) = 1;
|
|
*(undefined4 *)(lVar5 + 0x5c) = 3;
|
|
uVar11 = 0xffffffffffffffff;
|
|
pcVar10 = PTR_s_Memory_allocation_failed__140174c48;
|
|
do {
|
|
if (uVar11 == 0) break;
|
|
uVar11 = uVar11 - 1;
|
|
cVar1 = *pcVar10;
|
|
pcVar10 = pcVar10 + 1;
|
|
} while (cVar1 != '\0');
|
|
FUN_14001e2c0((longlong *)(lVar5 + 0x60),PTR_s_Memory_allocation_failed__140174c48,~uVar11 - 1);
|
|
*(undefined8 *)(lVar5 + 0x74) = 0xffffffffffffffff;
|
|
return (undefined8 *)0x0;
|
|
}
|
|
|