159 lines
4.4 KiB
C
159 lines
4.4 KiB
C
/* MessageServer_Release_x64.exe sha256 7911b15c4379625eaa12ff227708aa3a033bc6ac2cf6b34283136e3a62df25f1
|
|
* Ghidra 12.1.2 decompiler output for 0x140001350 FUN_140001350
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __chkstk replaced with injection: alloca_probe */
|
|
|
|
undefined8 FUN_140001350(int param_1,longlong param_2,undefined8 param_3,char *param_4)
|
|
|
|
{
|
|
short sVar1;
|
|
FILE *_File;
|
|
undefined4 uVar2;
|
|
DWORD DVar3;
|
|
_invalid_parameter_handler _Handler;
|
|
ulonglong uVar4;
|
|
char *pcVar5;
|
|
short *psVar6;
|
|
HANDLE *ppvVar7;
|
|
undefined8 *puVar8;
|
|
undefined4 *HeapInformation;
|
|
undefined *puVar9;
|
|
LPCWSTR pWVar10;
|
|
undefined4 local_res18 [2];
|
|
undefined8 local_res20;
|
|
undefined **local_2108;
|
|
undefined4 local_2100;
|
|
void *local_20f8;
|
|
undefined8 local_20f0;
|
|
undefined8 local_20e8;
|
|
undefined8 local_20d8;
|
|
undefined8 local_20d0;
|
|
undefined4 local_20c8;
|
|
undefined8 *local_20c0;
|
|
undefined8 local_20b8;
|
|
undefined8 local_20b0;
|
|
undefined8 local_20a8;
|
|
undefined8 local_20a0;
|
|
undefined8 local_2098;
|
|
undefined8 local_2090;
|
|
undefined4 local_2088 [16];
|
|
undefined8 local_2048;
|
|
HANDLE local_2038;
|
|
undefined1 local_2030 [8192];
|
|
undefined8 uStack_30;
|
|
|
|
uStack_30 = 0x14000136b;
|
|
local_2048 = 0xfffffffffffffffe;
|
|
DAT_1401bcf04 = timeGetTime();
|
|
FUN_140009e00(&local_res20);
|
|
uVar2 = FUN_140009e40(&local_res20);
|
|
if ((char)uVar2 != '\0') {
|
|
FUN_140009eb0();
|
|
FUN_140001660();
|
|
FUN_140001060((longlong)DAT_1401ba9f0);
|
|
if (1 < param_1) {
|
|
uVar4 = 0xffffffffffffffff;
|
|
psVar6 = *(short **)(param_2 + 8);
|
|
do {
|
|
if (uVar4 == 0) break;
|
|
uVar4 = uVar4 - 1;
|
|
sVar1 = *psVar6;
|
|
psVar6 = psVar6 + 1;
|
|
} while (sVar1 != 0);
|
|
FUN_140001830((ulonglong *)&DAT_1401b3540,*(short **)(param_2 + 8),~uVar4 - 1);
|
|
}
|
|
local_2038 = (HANDLE)0x0;
|
|
HeapInformation = (undefined4 *)0x2000;
|
|
memset(local_2030,0,0x2000);
|
|
DVar3 = GetProcessHeaps(0x400,&local_2038);
|
|
pcVar5 = (char *)0x4;
|
|
if (DVar3 != 0) {
|
|
ppvVar7 = &local_2038;
|
|
uVar4 = (ulonglong)DVar3;
|
|
do {
|
|
local_res18[0] = 2;
|
|
HeapInformation = local_res18;
|
|
param_4 = pcVar5;
|
|
HeapSetInformation(*ppvVar7,HeapCompatibilityInformation,HeapInformation,4);
|
|
ppvVar7 = ppvVar7 + 1;
|
|
uVar4 = uVar4 - 1;
|
|
} while (uVar4 != 0);
|
|
}
|
|
_Handler = _set_invalid_parameter_handler(FUN_140001300);
|
|
local_2100 = 0;
|
|
local_20f8 = (void *)0x0;
|
|
local_20f0 = 0;
|
|
local_20e8 = 0;
|
|
local_20d8 = 0;
|
|
local_20d0 = 0;
|
|
local_2108 = MagiMsgServer::vftable;
|
|
local_20c8 = 1;
|
|
local_20c0 = (undefined8 *)0x0;
|
|
local_20b8 = 0;
|
|
local_20b0 = 0;
|
|
uVar4 = FUN_140079250();
|
|
uVar4 = uVar4 & 0xffffffff;
|
|
puVar9 = (undefined *)CONCAT71((int7)((ulonglong)HeapInformation >> 8),1);
|
|
FUN_14006b270(local_2088,uVar4,puVar9,param_4);
|
|
local_20a8 = 0;
|
|
local_20a0 = 0;
|
|
local_2098 = 0;
|
|
local_2090 = 0;
|
|
pWVar10 = (LPCWSTR)&DAT_1401b3540;
|
|
if (7 < DAT_1401b3558) {
|
|
pWVar10 = DAT_1401b3540;
|
|
}
|
|
FUN_1400047a0(pWVar10,uVar4,puVar9,param_4);
|
|
FUN_140004f00((longlong)&local_2108,uVar4,puVar9,param_4);
|
|
if (local_20c0 != (undefined8 *)0x0) {
|
|
uVar4 = 1;
|
|
(**(code **)*local_20c0)();
|
|
}
|
|
local_20c0 = (undefined8 *)0x0;
|
|
if (DAT_1401bd040 != (undefined8 *)0x0) {
|
|
uVar4 = 1;
|
|
(**(code **)*DAT_1401bd040)();
|
|
}
|
|
if (DAT_1401bd030 != (undefined8 *)0x0) {
|
|
uVar4 = 1;
|
|
(**(code **)*DAT_1401bd030)();
|
|
}
|
|
puVar8 = DAT_1401ba9e8;
|
|
EnterCriticalSection(DAT_1401bd028);
|
|
_File = (FILE *)puVar8[0x17];
|
|
if (_File != (FILE *)0x0) {
|
|
fclose(_File);
|
|
}
|
|
puVar8 = puVar8 + 0x19;
|
|
do {
|
|
if ((FILE *)*puVar8 != (FILE *)0x0) {
|
|
fclose((FILE *)*puVar8);
|
|
}
|
|
puVar8 = puVar8 + 1;
|
|
pcVar5 = pcVar5 + -1;
|
|
} while (pcVar5 != (char *)0x0);
|
|
LeaveCriticalSection(DAT_1401bd028);
|
|
if (DAT_1401ba9e8 != (undefined8 *)0x0) {
|
|
uVar4 = 1;
|
|
(**(code **)*DAT_1401ba9e8)();
|
|
}
|
|
if (DAT_1401ba9f0 != (undefined8 *)0x0) {
|
|
uVar4 = 1;
|
|
(**(code **)*DAT_1401ba9f0)();
|
|
}
|
|
_set_invalid_parameter_handler(_Handler);
|
|
local_2108 = MagiMsgServer::vftable;
|
|
FUN_14006b400(local_2088,uVar4,puVar9,param_4);
|
|
local_2108 = MagiServerBase::vftable;
|
|
if (local_20f8 != (void *)0x0) {
|
|
operator_delete(local_20f8);
|
|
}
|
|
local_20f8 = (void *)0x0;
|
|
local_20f0 = 0;
|
|
local_20e8 = 0;
|
|
}
|
|
FUN_140009e10(&local_res20);
|
|
return 0;
|
|
}
|
|
|