197 lines
5.8 KiB
C
197 lines
5.8 KiB
C
/* AgentManager_Release_x64.exe sha256 8fd8ca91725858651a7839d34257b10c2970ac16c97e60c523b8b0c983fcb186
|
|
* Ghidra 12.1.2 decompiler output for 0x14000fa00 FUN_14000fa00
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __chkstk replaced with injection: alloca_probe */
|
|
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
|
|
|
|
void FUN_14000fa00(longlong *param_1,LPCWSTR param_2,char *param_3)
|
|
|
|
{
|
|
char *pcVar1;
|
|
char cVar2;
|
|
longlong lVar3;
|
|
void *pvVar4;
|
|
int iVar5;
|
|
longlong *plVar6;
|
|
ulonglong *puVar7;
|
|
undefined8 *puVar8;
|
|
ulonglong uVar9;
|
|
char *pcVar10;
|
|
undefined1 *puVar11;
|
|
char *pcVar12;
|
|
undefined8 uStack_170;
|
|
undefined1 auStack_168 [32];
|
|
undefined8 uStack_148;
|
|
int aiStack_140 [2];
|
|
undefined8 local_138 [2];
|
|
char local_128 [8];
|
|
ulonglong local_120 [2];
|
|
undefined8 local_110;
|
|
ulonglong local_108;
|
|
undefined1 local_f8;
|
|
undefined7 uStack_f7;
|
|
undefined8 local_e8;
|
|
ulonglong local_e0;
|
|
undefined1 local_d0;
|
|
undefined7 uStack_cf;
|
|
undefined8 local_c0;
|
|
ulonglong local_b8;
|
|
undefined1 local_a8;
|
|
undefined7 uStack_a7;
|
|
undefined8 local_98;
|
|
ulonglong local_90;
|
|
undefined1 local_80;
|
|
undefined7 uStack_7f;
|
|
undefined8 local_70;
|
|
ulonglong local_68;
|
|
undefined1 local_58;
|
|
undefined7 uStack_57;
|
|
undefined8 local_48;
|
|
ulonglong local_40;
|
|
ulonglong local_30;
|
|
|
|
local_128[0] = -2;
|
|
local_128[1] = -1;
|
|
local_128[2] = -1;
|
|
local_128[3] = -1;
|
|
local_128[4] = -1;
|
|
local_128[5] = -1;
|
|
local_128[6] = -1;
|
|
local_128[7] = -1;
|
|
local_30 = DAT_14016f5a0 ^ (ulonglong)local_128;
|
|
local_90 = 0xf;
|
|
pcVar12 = (char *)0x0;
|
|
local_98 = 0;
|
|
local_a8 = 0;
|
|
uVar9 = 0xffffffffffffffff;
|
|
pcVar10 = param_3;
|
|
do {
|
|
if (uVar9 == 0) break;
|
|
uVar9 = uVar9 - 1;
|
|
cVar2 = *pcVar10;
|
|
pcVar10 = pcVar10 + 1;
|
|
} while (cVar2 != '\0');
|
|
uStack_170 = 0x14000fa7a;
|
|
FUN_14000c9e0((ulonglong *)&local_a8,param_3,~uVar9 - 1);
|
|
uStack_170 = 0x14000fa8b;
|
|
plVar6 = FUN_140010200((longlong *)&local_d0,(undefined8 *)&local_a8);
|
|
uStack_170 = 0x14000fa9b;
|
|
FUN_1400102b0((undefined8 *)&local_58,plVar6);
|
|
if (0xf < local_b8) {
|
|
uStack_170 = 0x14000faad;
|
|
operator_delete((void *)CONCAT71(uStack_cf,local_d0));
|
|
}
|
|
local_b8 = 0xf;
|
|
local_c0 = 0;
|
|
local_d0 = 0;
|
|
uStack_170 = 0x14000facd;
|
|
puVar7 = FUN_140010300(local_120,(undefined8 *)&local_a8);
|
|
uStack_170 = 0x14000fadd;
|
|
FUN_1400102b0((undefined8 *)&local_80,(longlong *)puVar7);
|
|
if (0xf < local_108) {
|
|
uStack_170 = 0x14000faef;
|
|
operator_delete((void *)CONCAT71(local_120[0]._1_7_,(undefined1)local_120[0]));
|
|
}
|
|
local_108 = 0xf;
|
|
local_110 = 0;
|
|
local_120[0]._0_1_ = 0;
|
|
pcVar10 = pcVar12;
|
|
puVar11 = auStack_168;
|
|
if (param_2 != (LPCWSTR)0x0) {
|
|
uStack_170 = 0x14000fb0d;
|
|
iVar5 = lstrlenW(param_2);
|
|
iVar5 = iVar5 + 1;
|
|
puVar11 = auStack_168;
|
|
if (iVar5 < 0x40000000) {
|
|
uVar9 = (longlong)iVar5 * 2 + 0xf;
|
|
if (uVar9 <= (ulonglong)((longlong)iVar5 * 2)) {
|
|
uVar9 = 0xffffffffffffff0;
|
|
}
|
|
uStack_170 = 0x14000fb3d;
|
|
lVar3 = -(uVar9 & 0xfffffffffffffff0);
|
|
pcVar1 = local_128 + lVar3;
|
|
puVar11 = auStack_168 + lVar3;
|
|
if (pcVar1 != (char *)0x0) {
|
|
*pcVar1 = '\0';
|
|
*(undefined8 *)((longlong)local_138 + lVar3 + 8) = 0;
|
|
*(undefined8 *)((longlong)local_138 + lVar3) = 0;
|
|
*(int *)((longlong)aiStack_140 + lVar3) = iVar5 * 2;
|
|
*(char **)((longlong)&uStack_148 + lVar3) = pcVar1;
|
|
*(undefined8 *)(auStack_168 + lVar3 + -8) = 0x14000fb75;
|
|
iVar5 = WideCharToMultiByte(3,0,param_2,-1,*(LPSTR *)((longlong)&uStack_148 + lVar3),
|
|
*(int *)((longlong)aiStack_140 + lVar3),
|
|
*(LPCSTR *)((longlong)local_138 + lVar3),
|
|
*(LPBOOL *)((longlong)local_138 + lVar3 + 8));
|
|
pcVar10 = pcVar1;
|
|
puVar11 = auStack_168 + lVar3;
|
|
if (iVar5 == 0) {
|
|
pcVar10 = pcVar12;
|
|
puVar11 = auStack_168 + lVar3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_e0 = 0xf;
|
|
local_e8 = 0;
|
|
local_f8 = 0;
|
|
uVar9 = 0xffffffffffffffff;
|
|
pcVar12 = pcVar10;
|
|
do {
|
|
if (uVar9 == 0) break;
|
|
uVar9 = uVar9 - 1;
|
|
cVar2 = *pcVar12;
|
|
pcVar12 = pcVar12 + 1;
|
|
} while (cVar2 != '\0');
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fbae;
|
|
FUN_14000c9e0((ulonglong *)&local_f8,pcVar10,~uVar9 - 1);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fbc3;
|
|
plVar6 = FUN_1400103e0((longlong *)&local_d0,(undefined8 *)&local_58,(undefined8 *)&local_f8);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fbd7;
|
|
puVar8 = FUN_140010490(local_120,plVar6,(undefined8 *)&local_80);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fbea;
|
|
FUN_14000c360(param_1,puVar8,0,0xffffffffffffffff);
|
|
if (0xf < local_108) {
|
|
pvVar4 = (void *)CONCAT71(local_120[0]._1_7_,(undefined1)local_120[0]);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fbfc;
|
|
operator_delete(pvVar4);
|
|
}
|
|
local_108 = 0xf;
|
|
local_110 = 0;
|
|
local_120[0]._0_1_ = 0;
|
|
if (0xf < local_b8) {
|
|
pvVar4 = (void *)CONCAT71(uStack_cf,local_d0);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fc1d;
|
|
operator_delete(pvVar4);
|
|
}
|
|
if (0xf < local_e0) {
|
|
pvVar4 = (void *)CONCAT71(uStack_f7,local_f8);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fc2f;
|
|
operator_delete(pvVar4);
|
|
}
|
|
local_e0 = 0xf;
|
|
local_e8 = 0;
|
|
local_f8 = 0;
|
|
if (0xf < local_68) {
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fc56;
|
|
operator_delete((void *)CONCAT71(uStack_7f,local_80));
|
|
}
|
|
local_68 = 0xf;
|
|
local_70 = 0;
|
|
local_80 = 0;
|
|
if (0xf < local_40) {
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fc86;
|
|
operator_delete((void *)CONCAT71(uStack_57,local_58));
|
|
}
|
|
local_40 = 0xf;
|
|
local_48 = 0;
|
|
local_58 = 0;
|
|
if (0xf < local_90) {
|
|
pvVar4 = (void *)CONCAT71(uStack_a7,local_a8);
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fcb6;
|
|
operator_delete(pvVar4);
|
|
}
|
|
*(undefined8 *)(puVar11 + -8) = 0x14000fcc5;
|
|
return;
|
|
}
|
|
|