250 lines
8.8 KiB
C
250 lines
8.8 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x1401fbf20 FUN_1401fbf20
|
|
* Pseudocode, not original source. */
|
|
|
|
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
|
|
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
|
|
|
|
void FUN_1401fbf20(longlong param_1,longlong param_2)
|
|
|
|
{
|
|
int *piVar1;
|
|
undefined8 *puVar2;
|
|
longlong lVar3;
|
|
char cVar4;
|
|
int iVar5;
|
|
longlong *plVar6;
|
|
longlong *plVar7;
|
|
longlong *plVar8;
|
|
longlong *plVar9;
|
|
undefined8 uVar10;
|
|
longlong lVar11;
|
|
undefined *puVar12;
|
|
bool bVar13;
|
|
undefined1 auStack_1b8 [32];
|
|
undefined4 *local_198;
|
|
undefined ***local_190;
|
|
undefined ***local_188;
|
|
undefined ***local_180;
|
|
undefined ***local_178;
|
|
undefined4 local_168 [2];
|
|
longlong *local_160;
|
|
undefined **local_158;
|
|
undefined4 local_150;
|
|
undefined2 local_14c;
|
|
undefined **local_148;
|
|
undefined4 local_140;
|
|
undefined2 local_13c;
|
|
undefined **local_138;
|
|
undefined4 local_130;
|
|
undefined2 local_12c;
|
|
undefined *local_128;
|
|
undefined8 local_120;
|
|
undefined *local_118;
|
|
undefined *local_110;
|
|
undefined **local_108;
|
|
undefined4 local_100;
|
|
undefined2 local_fc;
|
|
undefined *local_f8;
|
|
undefined8 local_f0;
|
|
undefined1 local_e8;
|
|
undefined8 local_e0;
|
|
undefined1 local_d8;
|
|
undefined8 local_d0;
|
|
undefined8 local_c8;
|
|
undefined1 local_c0;
|
|
undefined8 local_b8;
|
|
undefined1 local_b0;
|
|
undefined8 local_a8;
|
|
undefined8 uStack_a0;
|
|
undefined8 local_98;
|
|
ulonglong uStack_90;
|
|
undefined8 local_88;
|
|
undefined8 uStack_80;
|
|
undefined8 local_78;
|
|
undefined8 uStack_70;
|
|
undefined4 local_68;
|
|
undefined4 uStack_64;
|
|
undefined4 uStack_60;
|
|
undefined4 uStack_5c;
|
|
undefined4 local_58;
|
|
undefined4 uStack_54;
|
|
undefined4 uStack_50;
|
|
undefined4 uStack_4c;
|
|
undefined4 local_48;
|
|
undefined4 uStack_44;
|
|
undefined4 uStack_40;
|
|
undefined4 uStack_3c;
|
|
undefined4 local_38;
|
|
undefined4 uStack_34;
|
|
undefined4 uStack_30;
|
|
undefined4 uStack_2c;
|
|
ulonglong local_28;
|
|
|
|
local_d0 = 0xfffffffffffffffe;
|
|
local_28 = DAT_1403463c0 ^ (ulonglong)auStack_1b8;
|
|
local_148 = Proud::AddrPort::vftable;
|
|
lVar11 = 0;
|
|
local_140 = 0;
|
|
local_13c = 0;
|
|
local_158 = Proud::AddrPort::vftable;
|
|
local_150 = 0;
|
|
local_14c = 0;
|
|
local_138 = Proud::AddrPort::vftable;
|
|
local_130 = 0;
|
|
local_12c = 0;
|
|
local_48 = 0;
|
|
uStack_44 = 0;
|
|
uStack_40 = 0;
|
|
uStack_3c = 0;
|
|
cVar4 = FUN_14016b370(param_2,&local_48,0x10);
|
|
if (cVar4 != '\0') {
|
|
local_38 = local_48;
|
|
uStack_34 = uStack_44;
|
|
uStack_30 = uStack_40;
|
|
uStack_2c = uStack_3c;
|
|
cVar4 = FUN_14016be00(param_2,local_168);
|
|
if ((((cVar4 != '\0') && (cVar4 = FUN_14016bda0(param_2,&local_148), cVar4 != '\0')) &&
|
|
(cVar4 = FUN_14016bda0(param_2,&local_158), cVar4 != '\0')) &&
|
|
(cVar4 = FUN_14016bda0(param_2,&local_138), cVar4 != '\0')) {
|
|
local_108 = Proud::AddrPort::vftable;
|
|
local_100 = *(undefined4 *)(param_2 + 0x38);
|
|
local_fc = *(undefined2 *)(param_2 + 0x3c);
|
|
plVar6 = (longlong *)FUN_1401d2620(param_1,&local_160,local_168[0]);
|
|
if ((longlong *)*plVar6 != (longlong *)0x0) {
|
|
lVar11 = *(longlong *)*plVar6;
|
|
}
|
|
if ((local_160 != (longlong *)0x0) && (local_160[1] = local_160[1] + -1, local_160[1] == 0)) {
|
|
puVar2 = (undefined8 *)*local_160;
|
|
if (puVar2 != (undefined8 *)0x0) {
|
|
(**(code **)*puVar2)(puVar2,1);
|
|
}
|
|
FUN_14016d970(local_160);
|
|
}
|
|
if (((lVar11 != 0) && (*(char *)(lVar11 + 0x684) == '\0')) &&
|
|
((*(longlong **)(lVar11 + 0x28) != (longlong *)0x0 &&
|
|
(lVar3 = **(longlong **)(lVar11 + 0x28), lVar3 != 0)))) {
|
|
bVar13 = *(ulonglong *)(lVar11 + 0x30) < CONCAT44(uStack_34,local_38);
|
|
if ((*(ulonglong *)(lVar11 + 0x30) == CONCAT44(uStack_34,local_38)) &&
|
|
(bVar13 = *(ulonglong *)(lVar11 + 0x38) < CONCAT44(uStack_2c,uStack_30),
|
|
*(ulonglong *)(lVar11 + 0x38) == CONCAT44(uStack_2c,uStack_30))) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
|
|
}
|
|
if (((iVar5 == 0) && (*(longlong *)(lVar3 + 0x10) != 0)) &&
|
|
(*(int *)(*(longlong *)(lVar3 + 0x10) + 8) == 1)) {
|
|
local_120 = 0;
|
|
FUN_1401d3e30(lVar11 + 0x28,&local_120);
|
|
FUN_1401d3cf0(&local_120);
|
|
local_a8 = _DAT_14034c4b0;
|
|
uStack_a0 = uRam000000014034c4b8;
|
|
local_98 = _DAT_14034c4c0;
|
|
local_88 = _DAT_14034c4d0;
|
|
uStack_80 = _DAT_14034c4d8;
|
|
local_78 = _DAT_14034c4e0;
|
|
uStack_70 = _DAT_14034c4e8;
|
|
local_68 = _DAT_14034c4f0;
|
|
uStack_64 = uRam000000014034c4f4;
|
|
uStack_60 = _DAT_14034c4f8;
|
|
uStack_5c = uRam000000014034c4fc;
|
|
local_58 = _DAT_14034c500;
|
|
uStack_54 = _DAT_14034c504;
|
|
uStack_50 = uRam000000014034c508;
|
|
uStack_4c = uRam000000014034c50c;
|
|
uStack_90 = _DAT_14034c4c8 & 0xffffffff00000000;
|
|
(**(code **)(*(longlong *)(param_1 + 0x17d0) + 0x30))
|
|
((longlong *)(param_1 + 0x17d0),*(undefined4 *)(lVar11 + 0x56c),&local_a8);
|
|
local_178 = &local_108;
|
|
local_180 = &local_138;
|
|
local_188 = &local_158;
|
|
local_190 = &local_148;
|
|
local_198 = (undefined4 *)(lVar11 + 0x56c);
|
|
(**(code **)(*(longlong *)(param_1 + 0x1818) + 0x70))
|
|
((longlong *)(param_1 + 0x1818),1,&DAT_14034c4b0,param_1 + 0x1578);
|
|
if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
|
|
plVar6 = (longlong *)FUN_1401705d0(&local_108,&local_f8);
|
|
plVar7 = (longlong *)FUN_1401705d0(&local_138,&local_118);
|
|
plVar8 = (longlong *)FUN_1401705d0(&local_158,&local_128);
|
|
plVar9 = (longlong *)FUN_1401705d0(&local_148,&local_110);
|
|
local_188 = (undefined ***)*plVar6;
|
|
if ((undefined *)*plVar6 == (undefined *)0x0) {
|
|
local_188 = (undefined ***)PTR_DAT_1403440a0;
|
|
}
|
|
local_190 = (undefined ***)*plVar7;
|
|
if ((undefined *)*plVar7 == (undefined *)0x0) {
|
|
local_190 = (undefined ***)PTR_DAT_1403440a0;
|
|
}
|
|
local_198 = (undefined4 *)*plVar8;
|
|
if ((undefined *)*plVar8 == (undefined *)0x0) {
|
|
local_198 = (undefined4 *)PTR_DAT_1403440a0;
|
|
}
|
|
puVar12 = (undefined *)*plVar9;
|
|
if ((undefined *)*plVar9 == (undefined *)0x0) {
|
|
puVar12 = PTR_DAT_1403440a0;
|
|
}
|
|
FUN_1401d4c70(param_1,1,L"HolepunchAck OK. ABS=%s ABR=%s BAS=%s BAR=%s",puVar12);
|
|
if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1403440a0)) &&
|
|
(local_110 + -8 != (undefined *)0x0)) {
|
|
uVar10 = FUN_14016d8c0();
|
|
local_f0 = uVar10;
|
|
FUN_14016db50(uVar10);
|
|
local_e8 = 1;
|
|
piVar1 = (int *)(local_110 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_110 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar10);
|
|
}
|
|
local_110 = PTR_DAT_1403440a0;
|
|
if (((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1403440a0)) &&
|
|
(local_128 + -8 != (undefined *)0x0)) {
|
|
uVar10 = FUN_14016d8c0();
|
|
local_e0 = uVar10;
|
|
FUN_14016db50(uVar10);
|
|
local_d8 = 1;
|
|
piVar1 = (int *)(local_128 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_128 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar10);
|
|
}
|
|
local_128 = PTR_DAT_1403440a0;
|
|
if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1403440a0)) &&
|
|
(local_118 + -8 != (undefined *)0x0)) {
|
|
uVar10 = FUN_14016d8c0();
|
|
local_c8 = uVar10;
|
|
FUN_14016db50(uVar10);
|
|
local_c0 = 1;
|
|
piVar1 = (int *)(local_118 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_118 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar10);
|
|
}
|
|
if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1403440a0)) &&
|
|
(local_f8 + -8 != (undefined *)0x0)) {
|
|
local_118 = PTR_DAT_1403440a0;
|
|
uVar10 = FUN_14016d8c0();
|
|
local_b8 = uVar10;
|
|
FUN_14016db50(uVar10);
|
|
local_b0 = 1;
|
|
piVar1 = (int *)(local_f8 + -4);
|
|
*piVar1 = *piVar1 + -1;
|
|
if (*piVar1 == 0) {
|
|
FUN_14016d970(local_f8 + -8);
|
|
}
|
|
FUN_14016dbe0(uVar10);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|