198 lines
5.7 KiB
C
198 lines
5.7 KiB
C
/* AgentManager_Release_x64.exe sha256 8fd8ca91725858651a7839d34257b10c2970ac16c97e60c523b8b0c983fcb186
|
|
* Ghidra 12.1.2 decompiler output for 0x14000d170 FUN_14000d170
|
|
* Pseudocode, not original source. */
|
|
|
|
void FUN_14000d170(longlong param_1,undefined8 param_2,short *param_3,longlong param_4)
|
|
|
|
{
|
|
uint uVar1;
|
|
uint uVar2;
|
|
int *piVar3;
|
|
uint *puVar4;
|
|
longlong lVar5;
|
|
longlong *plVar6;
|
|
LPVOID pvVar7;
|
|
undefined ***pppuVar8;
|
|
uint *puVar9;
|
|
LPVOID pvVar10;
|
|
uint uVar11;
|
|
uint uVar12;
|
|
short *psVar13;
|
|
ulonglong uVar14;
|
|
undefined *puVar15;
|
|
uint uVar16;
|
|
uint *local_res20;
|
|
undefined **local_50;
|
|
longlong *local_48;
|
|
LPVOID local_40;
|
|
ulonglong local_38;
|
|
undefined8 local_30;
|
|
|
|
local_50 = Proud::CFastArray<Proud::HostID,0>::vftable;
|
|
local_48 = (longlong *)0x0;
|
|
local_40 = (LPVOID)0x0;
|
|
local_38 = 0;
|
|
local_30 = 0;
|
|
pppuVar8 = &local_50;
|
|
lVar5 = DAT_14017cf20;
|
|
psVar13 = param_3;
|
|
FUN_140039670(DAT_14017cf20,(longlong)pppuVar8,param_3,param_4);
|
|
uVar16 = 0;
|
|
if ((int)local_38 == 0) {
|
|
if (local_40 == (LPVOID)0x0) {
|
|
return;
|
|
}
|
|
pvVar7 = local_40;
|
|
if (local_48 != (longlong *)0x0) {
|
|
(**(code **)(*local_48 + 0x18))(local_48,local_40);
|
|
return;
|
|
}
|
|
goto LAB_14000d47a;
|
|
}
|
|
FUN_14003e7c0(lVar5,pppuVar8,psVar13,param_4);
|
|
local_res20 = (uint *)PTR_DAT_14016f010;
|
|
uVar1 = FUN_14003e620(param_3);
|
|
uVar14 = 0;
|
|
if ((local_res20 != (uint *)0x0) && (uVar14 = 0, local_res20 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar14 = (ulonglong)local_res20[-2];
|
|
}
|
|
uVar2 = uVar1;
|
|
if ((((int)uVar1 <= (int)uVar14) && (uVar2 = uVar16, local_res20 != (uint *)0x0)) &&
|
|
(local_res20 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar2 = local_res20[-2];
|
|
}
|
|
uVar11 = 1;
|
|
if (1 < (int)uVar2) {
|
|
uVar11 = uVar2;
|
|
}
|
|
uVar2 = uVar16;
|
|
if ((local_res20 != (uint *)0x0) && (local_res20 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar2 = local_res20[-2];
|
|
}
|
|
uVar12 = 0;
|
|
if ((int)uVar2 < (int)uVar11) {
|
|
puVar4 = local_res20;
|
|
if (local_res20 == (uint *)0x0) {
|
|
puVar4 = (uint *)PTR_DAT_14016f010;
|
|
}
|
|
local_res20 = puVar4;
|
|
if ((int)uVar11 < 0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14003dec0();
|
|
}
|
|
if (uVar11 == 0) {
|
|
local_res20 = (uint *)PTR_DAT_14016f010;
|
|
if (((puVar4 != (uint *)0x0) && (puVar4 != (uint *)PTR_DAT_14016f010)) &&
|
|
(puVar4 + -2 != (uint *)0x0)) {
|
|
local_res20 = puVar4;
|
|
piVar3 = (int *)FUN_14003e7c0(puVar4,PTR_DAT_14016f010,uVar14,param_4);
|
|
FUN_14003d040(piVar3);
|
|
puVar9 = puVar4 + -1;
|
|
*puVar9 = *puVar9 - 1;
|
|
if (*puVar9 == 0) {
|
|
FUN_14003e8b0(puVar4 + -2);
|
|
}
|
|
FUN_14003d0d0((longlong)piVar3);
|
|
local_res20 = (uint *)PTR_DAT_14016f010;
|
|
}
|
|
}
|
|
else {
|
|
uVar2 = uVar16;
|
|
if ((puVar4 != (uint *)0x0) && (puVar4 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar2 = puVar4[-2];
|
|
}
|
|
if (uVar11 != uVar2) {
|
|
puVar4 = (uint *)FUN_14003e840((longlong)(int)uVar11 * 2 + 10);
|
|
if (puVar4 != (uint *)0x0) {
|
|
*puVar4 = 0;
|
|
puVar4[1] = 1;
|
|
}
|
|
*puVar4 = uVar11;
|
|
uVar2 = uVar12;
|
|
if ((local_res20 != (uint *)0x0) && (local_res20 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar2 = local_res20[-2];
|
|
}
|
|
puVar9 = (uint *)PTR_DAT_14016f010;
|
|
if ((int)uVar11 < (int)uVar2) {
|
|
LAB_14000d332:
|
|
if (local_res20 != (uint *)0x0) {
|
|
puVar9 = local_res20;
|
|
}
|
|
}
|
|
else {
|
|
uVar11 = uVar16;
|
|
if (local_res20 != (uint *)0x0) {
|
|
if (local_res20 != (uint *)PTR_DAT_14016f010) {
|
|
uVar11 = local_res20[-2];
|
|
}
|
|
goto LAB_14000d332;
|
|
}
|
|
}
|
|
uVar14 = (ulonglong)uVar11;
|
|
FUN_14003e650(puVar4 + 2,puVar9,uVar11);
|
|
FUN_140002190((longlong *)&local_res20,puVar9,uVar14,param_4);
|
|
local_res20 = puVar4 + 2;
|
|
}
|
|
}
|
|
}
|
|
FUN_140001df0((longlong *)&local_res20);
|
|
puVar4 = local_res20;
|
|
if (local_res20 == (uint *)0x0) {
|
|
puVar4 = (uint *)PTR_DAT_14016f010;
|
|
}
|
|
FUN_14003e650(puVar4,param_3,uVar1);
|
|
puVar4 = local_res20;
|
|
if (local_res20 == (uint *)0x0) {
|
|
puVar4 = (uint *)PTR_DAT_14016f010;
|
|
}
|
|
uVar1 = FUN_14003e620((short *)puVar4);
|
|
pvVar7 = local_40;
|
|
uVar16 = 0;
|
|
if (0 < (int)uVar1) {
|
|
uVar16 = uVar1;
|
|
}
|
|
uVar1 = uVar12;
|
|
if ((local_res20 != (uint *)0x0) && (local_res20 != (uint *)PTR_DAT_14016f010)) {
|
|
uVar1 = local_res20[-2];
|
|
}
|
|
if (((int)uVar16 < (int)uVar1) || (uVar16 = uVar12, local_res20 == (uint *)0x0)) {
|
|
LAB_14000d3c4:
|
|
if (((local_res20 != (uint *)PTR_DAT_14016f010) && (local_res20 != (uint *)0x0)) &&
|
|
(local_res20 + -2 != (uint *)0x0)) {
|
|
local_res20[-2] = uVar16;
|
|
*(undefined2 *)((longlong)local_res20 + (longlong)(int)uVar16 * 2) = 0;
|
|
}
|
|
}
|
|
else if (local_res20 != (uint *)PTR_DAT_14016f010) {
|
|
uVar16 = local_res20[-2];
|
|
goto LAB_14000d3c4;
|
|
}
|
|
plVar6 = (longlong *)(param_1 + 0x48);
|
|
puVar15 = &DAT_14016f5d0;
|
|
uVar14 = local_38 & 0xffffffff;
|
|
pvVar10 = local_40;
|
|
(**(code **)(*plVar6 + 0xa8))();
|
|
puVar4 = local_res20;
|
|
if (((local_res20 != (uint *)0x0) && (local_res20 != (uint *)PTR_DAT_14016f010)) &&
|
|
(puVar9 = local_res20 + -2, puVar9 != (uint *)0x0)) {
|
|
piVar3 = (int *)FUN_14003e7c0(plVar6,pvVar10,uVar14,puVar15);
|
|
FUN_14003d040(piVar3);
|
|
puVar4 = puVar4 + -1;
|
|
*puVar4 = *puVar4 - 1;
|
|
if (*puVar4 == 0) {
|
|
FUN_14003e8b0(puVar9);
|
|
}
|
|
FUN_14003d0d0((longlong)piVar3);
|
|
}
|
|
if (pvVar7 == (LPVOID)0x0) {
|
|
return;
|
|
}
|
|
if (local_48 != (longlong *)0x0) {
|
|
(**(code **)(*local_48 + 0x18))(local_48,pvVar7);
|
|
return;
|
|
}
|
|
LAB_14000d47a:
|
|
FUN_14003e8b0(pvVar7);
|
|
return;
|
|
}
|
|
|