133 lines
3.3 KiB
C
133 lines
3.3 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x14015c330 FUN_14015c330
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
|
|
|
|
void FUN_14015c330(longlong param_1,int param_2)
|
|
|
|
{
|
|
ulonglong uVar1;
|
|
code *pcVar2;
|
|
undefined2 *puVar3;
|
|
undefined2 *puVar4;
|
|
wchar_t *pwVar5;
|
|
ulonglong uVar6;
|
|
undefined8 uVar7;
|
|
undefined1 auStack_e8 [32];
|
|
uint local_c8;
|
|
uint local_c0;
|
|
undefined8 local_b8;
|
|
undefined2 local_b0;
|
|
undefined6 uStack_ae;
|
|
ulonglong local_a0;
|
|
ulonglong local_98;
|
|
undefined2 local_88;
|
|
undefined6 uStack_86;
|
|
undefined8 local_78;
|
|
ulonglong local_70;
|
|
undefined2 local_60;
|
|
undefined6 uStack_5e;
|
|
ulonglong local_50;
|
|
ulonglong local_48;
|
|
ulonglong local_38;
|
|
|
|
local_b8 = 0xfffffffffffffffe;
|
|
local_38 = DAT_1403463c0 ^ (ulonglong)auStack_e8;
|
|
local_48 = 7;
|
|
local_50 = 0;
|
|
local_60 = 0;
|
|
local_70 = 7;
|
|
local_78 = 0;
|
|
local_88 = 0;
|
|
local_98 = 7;
|
|
local_a0 = 0;
|
|
local_b0 = 0;
|
|
FUN_14015c5d0(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_140055ed0(&local_b0,uVar1);
|
|
}
|
|
else if (uVar1 == 0) {
|
|
local_a0 = 0;
|
|
puVar4 = &local_b0;
|
|
if (7 < local_98) {
|
|
puVar4 = (undefined2 *)CONCAT62(uStack_ae,local_b0);
|
|
}
|
|
*puVar4 = 0;
|
|
}
|
|
if (uVar1 != 0) {
|
|
puVar4 = &local_60;
|
|
if (7 < local_48) {
|
|
puVar4 = (undefined2 *)CONCAT62(uStack_5e,local_60);
|
|
}
|
|
puVar3 = &local_b0;
|
|
if (7 < local_98) {
|
|
puVar3 = (undefined2 *)CONCAT62(uStack_ae,local_b0);
|
|
}
|
|
memcpy(puVar3 + local_a0,puVar4,uVar6 * 2);
|
|
puVar4 = &local_b0;
|
|
if (7 < local_98) {
|
|
puVar4 = (undefined2 *)CONCAT62(uStack_ae,local_b0);
|
|
}
|
|
local_a0 = uVar1;
|
|
puVar4[uVar1] = 0;
|
|
}
|
|
}
|
|
FUN_14015c800(&local_b0,9);
|
|
if (*(char *)(param_1 + 0x18) == '\0') {
|
|
uVar7 = 10;
|
|
pwVar5 = L"[ DisUse ]";
|
|
}
|
|
else {
|
|
uVar7 = 7;
|
|
pwVar5 = L"[ Use ]";
|
|
}
|
|
FUN_140056040(&local_88,pwVar5,uVar7);
|
|
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(uStack_ae,local_b0));
|
|
}
|
|
local_98 = 7;
|
|
local_a0 = 0;
|
|
local_b0 = 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(uStack_5e,local_60));
|
|
}
|
|
return;
|
|
}
|
|
|