376 lines
13 KiB
C
376 lines
13 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x1401fb780 FUN_1401fb780
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
|
|
|
|
void FUN_1401fb780(longlong param_1,longlong param_2)
|
|
|
|
{
|
|
int *piVar1;
|
|
undefined8 *puVar2;
|
|
char cVar3;
|
|
int iVar4;
|
|
longlong *plVar5;
|
|
longlong *plVar6;
|
|
undefined8 uVar7;
|
|
undefined1 *puVar8;
|
|
longlong lVar9;
|
|
longlong lVar10;
|
|
undefined1 *_Memory;
|
|
longlong lVar11;
|
|
undefined *puVar12;
|
|
longlong lVar13;
|
|
bool bVar14;
|
|
undefined4 uVar15;
|
|
undefined4 uVar16;
|
|
undefined4 uVar17;
|
|
undefined4 uVar18;
|
|
undefined1 auStack_628 [32];
|
|
undefined ***local_608;
|
|
undefined **local_5f8;
|
|
undefined4 local_5f0;
|
|
undefined2 local_5ec;
|
|
undefined **local_5e8;
|
|
undefined4 local_5e0;
|
|
undefined2 local_5dc;
|
|
longlong *local_5d8;
|
|
undefined4 local_5d0 [2];
|
|
undefined *local_5c8;
|
|
undefined **local_5c0;
|
|
undefined4 local_5b8;
|
|
undefined2 local_5b4;
|
|
undefined **local_5b0;
|
|
undefined4 local_5a8;
|
|
undefined2 local_5a4;
|
|
undefined *local_5a0;
|
|
undefined **local_598;
|
|
undefined4 local_590;
|
|
undefined2 local_58c;
|
|
undefined **local_588;
|
|
undefined4 local_580;
|
|
undefined2 local_57c;
|
|
undefined **local_578;
|
|
undefined4 local_570;
|
|
undefined2 local_56c;
|
|
undefined **local_568;
|
|
undefined4 local_560;
|
|
undefined2 local_55c;
|
|
undefined **local_558;
|
|
undefined4 local_550;
|
|
undefined2 local_54c;
|
|
undefined **local_548;
|
|
undefined4 local_540;
|
|
undefined2 local_53c;
|
|
undefined **local_538;
|
|
undefined4 local_530;
|
|
undefined2 local_52c;
|
|
undefined4 local_528;
|
|
undefined4 uStack_524;
|
|
undefined4 uStack_520;
|
|
undefined4 uStack_51c;
|
|
undefined8 local_518;
|
|
undefined1 local_510;
|
|
undefined4 local_508;
|
|
undefined4 uStack_504;
|
|
undefined4 uStack_500;
|
|
undefined4 uStack_4fc;
|
|
undefined8 local_4f8;
|
|
undefined1 local_4f0;
|
|
undefined8 local_4e8;
|
|
undefined4 local_4d8;
|
|
undefined4 uStack_4d4;
|
|
undefined4 uStack_4d0;
|
|
undefined4 uStack_4cc;
|
|
undefined4 local_4c8;
|
|
undefined4 uStack_4c4;
|
|
undefined4 uStack_4c0;
|
|
undefined4 uStack_4bc;
|
|
undefined4 local_4b8;
|
|
undefined4 uStack_4b4;
|
|
undefined4 uStack_4b0;
|
|
undefined4 uStack_4ac;
|
|
undefined4 local_4a8;
|
|
undefined4 uStack_4a4;
|
|
undefined4 uStack_4a0;
|
|
undefined4 uStack_49c;
|
|
undefined4 local_498;
|
|
undefined4 uStack_494;
|
|
undefined4 uStack_490;
|
|
undefined4 uStack_48c;
|
|
undefined1 *local_488;
|
|
undefined1 local_480 [264];
|
|
undefined1 *local_378;
|
|
undefined1 local_370 [264];
|
|
undefined1 *local_268;
|
|
undefined1 local_260 [264];
|
|
undefined1 *local_158;
|
|
undefined1 local_150 [264];
|
|
ulonglong local_48;
|
|
|
|
local_4e8 = 0xfffffffffffffffe;
|
|
local_48 = DAT_1403463c0 ^ (ulonglong)auStack_628;
|
|
local_5f8 = Proud::AddrPort::vftable;
|
|
lVar11 = 0;
|
|
iVar4 = 0;
|
|
local_5f0 = 0;
|
|
local_5ec = 0;
|
|
cVar3 = FUN_14016be00(param_2,local_5d0);
|
|
if (cVar3 == '\0') {
|
|
if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
|
|
return;
|
|
}
|
|
local_488 = local_480;
|
|
FUN_14015b060(&local_488,"RemotePeer.cpp",3);
|
|
local_608 = (undefined ***)CONCAT44(local_608._4_4_,0x9b);
|
|
FUN_1401d4c70(param_1,1,&DAT_140294948,local_488);
|
|
puVar8 = local_480;
|
|
_Memory = local_488;
|
|
}
|
|
else {
|
|
local_4c8 = 0;
|
|
uStack_4c4 = 0;
|
|
uStack_4c0 = 0;
|
|
uStack_4bc = 0;
|
|
cVar3 = FUN_14016b370(param_2,&local_4c8,0x10);
|
|
uVar18 = uStack_4bc;
|
|
uVar17 = uStack_4c0;
|
|
uVar16 = uStack_4c4;
|
|
uVar15 = local_4c8;
|
|
if (cVar3 == '\0') {
|
|
if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
|
|
return;
|
|
}
|
|
local_158 = local_150;
|
|
FUN_14015b060(&local_158,"RemotePeer.cpp",3);
|
|
local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa0);
|
|
FUN_1401d4c70(param_1,1,&DAT_140294948,local_158);
|
|
puVar8 = local_150;
|
|
_Memory = local_158;
|
|
}
|
|
else {
|
|
local_4a8 = local_4c8;
|
|
uStack_4a4 = uStack_4c4;
|
|
uStack_4a0 = uStack_4c0;
|
|
uStack_49c = uStack_4bc;
|
|
local_4b8 = 0;
|
|
uStack_4b4 = 0;
|
|
uStack_4b0 = 0;
|
|
uStack_4ac = 0;
|
|
cVar3 = FUN_14016b370(param_2,&local_4b8,0x10);
|
|
if (cVar3 == '\0') {
|
|
if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
|
|
return;
|
|
}
|
|
local_378 = local_370;
|
|
FUN_14015b060(&local_378,"RemotePeer.cpp",3);
|
|
local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa5);
|
|
FUN_1401d4c70(param_1,1,&DAT_140294948,local_378);
|
|
puVar8 = local_370;
|
|
_Memory = local_378;
|
|
}
|
|
else {
|
|
local_498 = local_4b8;
|
|
uStack_494 = uStack_4b4;
|
|
uStack_490 = uStack_4b0;
|
|
uStack_48c = uStack_4ac;
|
|
cVar3 = FUN_14016bda0(param_2,&local_5f8);
|
|
if (cVar3 != '\0') {
|
|
bVar14 = CONCAT44(uStack_494,local_498) < *(ulonglong *)(param_1 + 0x6d0);
|
|
if ((CONCAT44(uStack_494,local_498) != *(ulonglong *)(param_1 + 0x6d0)) ||
|
|
(bVar14 = CONCAT44(uStack_48c,uStack_490) < *(ulonglong *)(param_1 + 0x6d8),
|
|
CONCAT44(uStack_48c,uStack_490) != *(ulonglong *)(param_1 + 0x6d8))) {
|
|
iVar4 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
|
|
}
|
|
if (iVar4 != 0) {
|
|
return;
|
|
}
|
|
local_5e8 = Proud::AddrPort::vftable;
|
|
local_5e0 = *(undefined4 *)(param_2 + 0x38);
|
|
local_5dc = *(undefined2 *)(param_2 + 0x3c);
|
|
plVar5 = (longlong *)FUN_1401d2620(param_1,&local_5d8,local_5d0[0]);
|
|
lVar13 = lVar11;
|
|
if ((longlong *)*plVar5 != (longlong *)0x0) {
|
|
lVar13 = *(longlong *)*plVar5;
|
|
}
|
|
if ((local_5d8 != (longlong *)0x0) &&
|
|
(local_5d8[1] = local_5d8[1] + -1, uVar15 = local_4c8, uVar16 = uStack_4c4,
|
|
uVar17 = uStack_4c0, uVar18 = uStack_4bc, local_5d8[1] == 0)) {
|
|
puVar2 = (undefined8 *)*local_5d8;
|
|
if (puVar2 != (undefined8 *)0x0) {
|
|
(**(code **)*puVar2)(puVar2,1);
|
|
}
|
|
FUN_14016d970(local_5d8);
|
|
uVar15 = local_4c8;
|
|
uVar16 = uStack_4c4;
|
|
uVar17 = uStack_4c0;
|
|
uVar18 = uStack_4bc;
|
|
}
|
|
if (lVar13 == 0) {
|
|
return;
|
|
}
|
|
if (*(char *)(lVar13 + 0x684) != '\0') {
|
|
return;
|
|
}
|
|
if (*(longlong **)(lVar13 + 0x28) == (longlong *)0x0) {
|
|
return;
|
|
}
|
|
if (**(longlong **)(lVar13 + 0x28) == 0) {
|
|
return;
|
|
}
|
|
bVar14 = CONCAT44(uStack_4a4,local_4a8) < *(ulonglong *)(lVar13 + 0x30);
|
|
if ((CONCAT44(uStack_4a4,local_4a8) == *(ulonglong *)(lVar13 + 0x30)) &&
|
|
(bVar14 = CONCAT44(uStack_49c,uStack_4a0) < *(ulonglong *)(lVar13 + 0x38),
|
|
CONCAT44(uStack_49c,uStack_4a0) == *(ulonglong *)(lVar13 + 0x38))) {
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
iVar4 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
|
|
}
|
|
if (iVar4 != 0) {
|
|
return;
|
|
}
|
|
if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
|
|
plVar5 = (longlong *)FUN_1401705d0(&local_5e8,&local_5a0);
|
|
plVar6 = (longlong *)FUN_1401705d0(&local_5f8,&local_5c8);
|
|
local_608 = (undefined ***)*plVar5;
|
|
if ((undefined ***)*plVar5 == (undefined ***)0x0) {
|
|
local_608 = (undefined ***)PTR_DAT_1403440a0;
|
|
}
|
|
puVar12 = (undefined *)*plVar6;
|
|
if ((undefined *)*plVar6 == (undefined *)0x0) {
|
|
puVar12 = PTR_DAT_1403440a0;
|
|
}
|
|
FUN_1401d4c70(param_1,1,&DAT_140294900,puVar12);
|
|
if (((local_5c8 != (undefined *)0x0) && (local_5c8 != PTR_DAT_1403440a0)) &&
|
|
(local_5c8 + -8 != (undefined *)0x0)) {
|
|
uVar7 = FUN_14016d8c0();
|
|
local_518 = uVar7;
|
|
FUN_14016db50(uVar7);
|
|
local_510 = 1;
|
|
piVar1 = (int *)(local_5c8 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_5c8 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar7);
|
|
}
|
|
local_5c8 = PTR_DAT_1403440a0;
|
|
if (((local_5a0 != (undefined *)0x0) && (local_5a0 != PTR_DAT_1403440a0)) &&
|
|
(local_5a0 + -8 != (undefined *)0x0)) {
|
|
uVar7 = FUN_14016d8c0();
|
|
local_4f8 = uVar7;
|
|
FUN_14016db50(uVar7);
|
|
local_4f0 = 1;
|
|
piVar1 = (int *)(local_5a0 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_5a0 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar7);
|
|
}
|
|
}
|
|
FUN_14016f870(lVar13 + 0x570);
|
|
cVar3 = FUN_14016f870(lVar13 + 0x580);
|
|
if (cVar3 != '\0') {
|
|
if ((*(longlong **)(lVar13 + 0x18) == (longlong *)0x0) ||
|
|
(lVar10 = **(longlong **)(lVar13 + 0x18), lVar9 = lVar10 + -0x40, lVar10 == 0)) {
|
|
lVar9 = lVar11;
|
|
}
|
|
cVar3 = FUN_14016f870(lVar9 + 0x128);
|
|
if (cVar3 != '\0') {
|
|
plVar5 = *(longlong **)(lVar13 + 0x18);
|
|
if ((plVar5 == (longlong *)0x0) || (lVar10 = *plVar5 + -0x40, *plVar5 == 0)) {
|
|
lVar10 = lVar11;
|
|
}
|
|
if (*(int *)(lVar10 + 0x140) == *(int *)(lVar13 + 0x578)) {
|
|
lVar10 = lVar11;
|
|
if ((plVar5 != (longlong *)0x0) && (*plVar5 != 0)) {
|
|
lVar10 = *plVar5 + -0x40;
|
|
}
|
|
if (((*(char *)(lVar10 + 0x130) == *(char *)(lVar13 + 0x588)) &&
|
|
(*(char *)(lVar10 + 0x131) == *(char *)(lVar13 + 0x589))) &&
|
|
(*(char *)(lVar10 + 0x132) == *(char *)(lVar13 + 0x58a))) {
|
|
local_598 = Proud::AddrPort::vftable;
|
|
local_590 = local_5e0;
|
|
local_58c = local_5dc;
|
|
local_558 = Proud::AddrPort::vftable;
|
|
local_550 = local_5f0;
|
|
local_54c = local_5ec;
|
|
local_568 = Proud::AddrPort::vftable;
|
|
local_560 = *(undefined4 *)(lVar13 + 0x588);
|
|
local_55c = *(undefined2 *)(lVar13 + 0x58c);
|
|
lVar10 = lVar11;
|
|
if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
|
|
lVar10 = **(longlong **)(lVar13 + 0x28);
|
|
}
|
|
local_608 = &local_598;
|
|
local_4d8 = uVar15;
|
|
uStack_4d4 = uVar16;
|
|
uStack_4d0 = uVar17;
|
|
uStack_4cc = uVar18;
|
|
FUN_1401fae20(lVar10,&local_568,&local_4d8,&local_558);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cVar3 = FUN_14016f870(lVar13 + 0x570);
|
|
if (cVar3 != '\0') {
|
|
local_588 = Proud::AddrPort::vftable;
|
|
local_580 = local_5e0;
|
|
local_57c = local_5dc;
|
|
local_578 = Proud::AddrPort::vftable;
|
|
local_570 = local_5f0;
|
|
local_56c = local_5ec;
|
|
local_5b0 = Proud::AddrPort::vftable;
|
|
local_5a8 = *(undefined4 *)(lVar13 + 0x578);
|
|
local_5a4 = *(undefined2 *)(lVar13 + 0x57c);
|
|
lVar10 = lVar11;
|
|
if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
|
|
lVar10 = **(longlong **)(lVar13 + 0x28);
|
|
}
|
|
local_608 = &local_588;
|
|
local_528 = uVar15;
|
|
uStack_524 = uVar16;
|
|
uStack_520 = uVar17;
|
|
uStack_51c = uVar18;
|
|
FUN_1401fae20(lVar10,&local_5b0,&local_528,&local_578);
|
|
}
|
|
local_5c0 = Proud::AddrPort::vftable;
|
|
local_5b8 = local_5e0;
|
|
local_5b4 = local_5dc;
|
|
local_538 = Proud::AddrPort::vftable;
|
|
local_530 = local_5f0;
|
|
local_52c = local_5ec;
|
|
local_548 = Proud::AddrPort::vftable;
|
|
local_540 = *(undefined4 *)(param_2 + 0x38);
|
|
local_53c = *(undefined2 *)(param_2 + 0x3c);
|
|
if (*(longlong **)(lVar13 + 0x28) != (longlong *)0x0) {
|
|
lVar11 = **(longlong **)(lVar13 + 0x28);
|
|
}
|
|
local_608 = &local_5c0;
|
|
local_508 = uVar15;
|
|
uStack_504 = uVar16;
|
|
uStack_500 = uVar17;
|
|
uStack_4fc = uVar18;
|
|
FUN_1401fae20(lVar11,&local_548,&local_508,&local_538);
|
|
return;
|
|
}
|
|
if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
|
|
return;
|
|
}
|
|
local_268 = local_260;
|
|
FUN_14015b060(&local_268,"RemotePeer.cpp",3);
|
|
local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xaa);
|
|
FUN_1401d4c70(param_1,1,&DAT_140294948,local_268);
|
|
puVar8 = local_260;
|
|
_Memory = local_268;
|
|
}
|
|
}
|
|
}
|
|
if (_Memory != puVar8) {
|
|
free(_Memory);
|
|
}
|
|
return;
|
|
}
|
|
|