131 lines
3.5 KiB
C
131 lines
3.5 KiB
C
/* MessageServer_Release_x64.exe sha256 7911b15c4379625eaa12ff227708aa3a033bc6ac2cf6b34283136e3a62df25f1
|
|
* Ghidra 12.1.2 decompiler output for 0x140002690 FUN_140002690
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
|
|
/* WARNING: Type propagation algorithm not settling */
|
|
|
|
void FUN_140002690(longlong param_1,int param_2)
|
|
|
|
{
|
|
ulonglong uVar1;
|
|
code *pcVar2;
|
|
undefined2 *puVar3;
|
|
undefined2 *puVar4;
|
|
wchar_t *pwVar5;
|
|
ulonglong uVar6;
|
|
undefined1 auStack_e8 [32];
|
|
uint local_c8;
|
|
uint local_c0;
|
|
undefined8 local_b8;
|
|
ulonglong local_b0 [2];
|
|
ulonglong local_a0;
|
|
ulonglong local_98;
|
|
undefined2 local_88;
|
|
undefined6 uStack_86;
|
|
undefined8 local_78;
|
|
ulonglong local_70;
|
|
ulonglong local_60 [2];
|
|
ulonglong local_50;
|
|
ulonglong local_48;
|
|
ulonglong local_38;
|
|
|
|
local_b8 = 0xfffffffffffffffe;
|
|
local_38 = DAT_1401ac5a0 ^ (ulonglong)auStack_e8;
|
|
local_48 = 7;
|
|
local_50 = 0;
|
|
local_60[0]._0_2_ = 0;
|
|
local_70 = 7;
|
|
local_78 = 0;
|
|
local_88 = 0;
|
|
local_98 = 7;
|
|
local_a0 = 0;
|
|
local_b0[0]._0_2_ = 0;
|
|
FUN_140002930(param_1,local_60);
|
|
uVar6 = 0xffffffffffffffff;
|
|
if (local_50 != 0xffffffffffffffff) {
|
|
uVar6 = local_50;
|
|
}
|
|
if (-local_a0 - 1 <= uVar6) {
|
|
std::_Xlength_error("string too long");
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
if (uVar6 != 0) {
|
|
uVar1 = local_a0 + uVar6;
|
|
if (0x7ffffffffffffffe < uVar1) {
|
|
std::_Xlength_error("string too long");
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
if (local_98 < uVar1) {
|
|
FUN_140001a40(local_b0,uVar1,local_a0);
|
|
}
|
|
else if (uVar1 == 0) {
|
|
local_a0 = 0;
|
|
puVar4 = (undefined2 *)local_b0;
|
|
if (7 < local_98) {
|
|
puVar4 = (undefined2 *)CONCAT62(local_b0[0]._2_6_,(undefined2)local_b0[0]);
|
|
}
|
|
*puVar4 = 0;
|
|
}
|
|
if (uVar1 != 0) {
|
|
puVar4 = (undefined2 *)local_60;
|
|
if (7 < local_48) {
|
|
puVar4 = (undefined2 *)CONCAT62(local_60[0]._2_6_,(undefined2)local_60[0]);
|
|
}
|
|
puVar3 = (undefined2 *)local_b0;
|
|
if (7 < local_98) {
|
|
puVar3 = (undefined2 *)CONCAT62(local_b0[0]._2_6_,(undefined2)local_b0[0]);
|
|
}
|
|
memcpy(puVar3 + local_a0,puVar4,uVar6 * 2);
|
|
puVar4 = (undefined2 *)local_b0;
|
|
if (7 < local_98) {
|
|
puVar4 = (undefined2 *)CONCAT62(local_b0[0]._2_6_,(undefined2)local_b0[0]);
|
|
}
|
|
local_a0 = uVar1;
|
|
puVar4[uVar1] = 0;
|
|
}
|
|
}
|
|
FUN_140002b60(local_b0,9);
|
|
if (*(char *)(param_1 + 0x18) == '\0') {
|
|
uVar6 = 10;
|
|
pwVar5 = L"[ DisUse ]";
|
|
}
|
|
else {
|
|
uVar6 = 7;
|
|
pwVar5 = L"[ Use ]";
|
|
}
|
|
FUN_140001830((ulonglong *)&local_88,pwVar5,uVar6);
|
|
if (param_2 < 1) {
|
|
wprintf(L"\n-%s %s---------------------------------------------------------\n");
|
|
}
|
|
local_c8 = *(uint *)(param_1 + 0x3c);
|
|
if (param_2 == -1) {
|
|
wprintf(L"Session S[ %d ] : ADDRESS[ %s ] PORT[ %d ] CODE[ %d ]\n");
|
|
}
|
|
else {
|
|
local_c0 = local_c8;
|
|
local_c8 = (uint)*(ushort *)(param_1 + 0x38);
|
|
wprintf(L"Session [%d] S[ %d ] : ADDRESS[ %s ] PORT[ %d ] CODE[ %d ]\n");
|
|
}
|
|
if (7 < local_98) {
|
|
operator_delete((void *)CONCAT62(local_b0[0]._2_6_,(undefined2)local_b0[0]));
|
|
}
|
|
local_98 = 7;
|
|
local_a0 = 0;
|
|
local_b0[0]._0_2_ = 0;
|
|
if (7 < local_70) {
|
|
operator_delete((void *)CONCAT62(uStack_86,local_88));
|
|
}
|
|
local_70 = 7;
|
|
local_78 = 0;
|
|
local_88 = 0;
|
|
if (7 < local_48) {
|
|
operator_delete((void *)CONCAT62(local_60[0]._2_6_,(undefined2)local_60[0]));
|
|
}
|
|
return;
|
|
}
|
|
|