/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c * Ghidra 12.1.2 decompiler output for 0x1401efab0 FUN_1401efab0 * Pseudocode, not original source. */ void FUN_1401efab0(longlong param_1) { undefined **ppuVar1; char cVar2; int iVar3; int iVar4; int iVar5; int iVar6; longlong lVar7; int *piVar8; undefined8 uVar9; undefined **ppuVar10; ulonglong uVar11; ulonglong uVar12; int iVar13; undefined **local_res8; undefined *local_res10; undefined1 local_res18 [8]; undefined **local_50; undefined8 local_48; undefined8 local_40; undefined8 local_38; undefined8 local_30; lVar7 = *(longlong *)(param_1 + 0x108); if ((*(char *)(lVar7 + 0x1790) != '\0') || (*(int *)(lVar7 + 0x6c8) != 0)) { FUN_1401d4c70(lVar7,0,&DAT_140293848); } lVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); uVar12 = 0; uVar11 = uVar12; if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) { uVar11 = **(ulonglong **)(lVar7 + 0x128); } cVar2 = FUN_14019e650(uVar11); iVar6 = 0; if (cVar2 != '\0') { uVar9 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); FUN_1401f9b20(uVar9); uVar9 = FUN_1401a1eb0(*(longlong *)(param_1 + 0x108) + 0x1620); *(undefined8 *)(param_1 + 200) = uVar9; lVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); uVar11 = uVar12; if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) { uVar11 = **(ulonglong **)(lVar7 + 0x128); } FUN_14019bd10(uVar11); lVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); uVar11 = uVar12; if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) { uVar11 = **(ulonglong **)(lVar7 + 0x128); } FUN_14019bd20(uVar11,0); lVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); uVar11 = uVar12; if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) { uVar11 = **(ulonglong **)(lVar7 + 0x128); } FUN_14019be10(uVar11,0); local_res8 = &local_res10; lVar7 = *(longlong *)(param_1 + 0x108); FUN_14016d8c0(); local_res10 = PTR_DAT_1403440a0; FUN_14004e6d0(&local_res10,lVar7 + 0x1588); lVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108)); if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) { uVar12 = **(ulonglong **)(lVar7 + 0x128); } iVar6 = FUN_14019cfd0(uVar12,&local_res10, *(undefined2 *)(*(longlong *)(param_1 + 0x108) + 0x1590)); if ((iVar6 == 0) || (iVar6 == 0x2733)) { if (0 < *(int *)(param_1 + 0x100)) { return; } *(undefined4 *)(param_1 + 0x40) = 0; *(undefined4 *)(param_1 + 0x100) = 1; uVar9 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))(); *(undefined8 *)(param_1 + 0x80) = uVar9; *(undefined1 *)(param_1 + 0xc0) = 0; return; } goto LAB_1401efd7d; } FUN_14016d8c0(); local_res8 = (undefined **)PTR_DAT_1403440a0; iVar3 = FUN_14016d740(L"Cannot bind TCP socket to a local address!"); if ((local_res8 != (undefined **)0x0) && (uVar12 = 0, local_res8 != (undefined **)PTR_DAT_1403440a0)) { uVar12 = (ulonglong)*(uint *)(local_res8 + -1); } iVar4 = 0; iVar5 = iVar3; if (((iVar3 <= (int)uVar12) && (iVar5 = iVar6, local_res8 != (undefined **)0x0)) && (iVar5 = iVar4, local_res8 != (undefined **)PTR_DAT_1403440a0)) { iVar5 = *(int *)(local_res8 + -1); } iVar13 = 1; if (1 < iVar5) { iVar13 = iVar5; } iVar5 = iVar4; if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1403440a0)) { iVar5 = *(int *)(local_res8 + -1); } if (iVar5 < iVar13) { if (local_res8 == (undefined **)0x0) { local_res8 = (undefined **)PTR_DAT_1403440a0; } if (iVar13 < 0) { /* WARNING: Subroutine does not return */ FUN_14016d6b0(); } if (iVar13 == 0) { FUN_14004eb70(&local_res8); } else { iVar5 = iVar6; if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1403440a0)) { iVar5 = *(int *)(local_res8 + -1); } if (iVar13 != iVar5) { piVar8 = (int *)FUN_14016d940((longlong)iVar13 * 2 + 10); if (piVar8 != (int *)0x0) { *piVar8 = 0; piVar8[1] = 1; } *piVar8 = iVar13; iVar5 = iVar6; if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1403440a0)) { iVar5 = *(int *)(local_res8 + -1); } ppuVar10 = (undefined **)PTR_DAT_1403440a0; if (iVar13 < iVar5) { LAB_1401efc23: if (local_res8 != (undefined **)0x0) { ppuVar10 = local_res8; } } else { iVar13 = iVar6; if (local_res8 != (undefined **)0x0) { if (local_res8 != (undefined **)PTR_DAT_1403440a0) { iVar13 = *(int *)(local_res8 + -1); } goto LAB_1401efc23; } } FUN_14016d770(piVar8 + 2,ppuVar10,iVar13); FUN_14004eb70(&local_res8); local_res8 = (undefined **)(piVar8 + 2); } } } FUN_14004e850(&local_res8); ppuVar10 = local_res8; if (local_res8 == (undefined **)0x0) { ppuVar10 = (undefined **)PTR_DAT_1403440a0; } FUN_14016d770(ppuVar10,L"Cannot bind TCP socket to a local address!",iVar3); ppuVar10 = local_res8; if (local_res8 == (undefined **)0x0) { ppuVar10 = (undefined **)PTR_DAT_1403440a0; } iVar3 = FUN_14016d740(ppuVar10); iVar6 = 0; if (0 < iVar3) { iVar6 = iVar3; } iVar3 = iVar4; if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1403440a0)) { iVar3 = *(int *)(local_res8 + -1); } if ((iVar6 < iVar3) || (iVar6 = iVar4, local_res8 == (undefined **)0x0)) { LAB_1401efcb9: if (((local_res8 != (undefined **)PTR_DAT_1403440a0) && (local_res8 != (undefined **)0x0)) && (local_res8 + -1 != (undefined **)0x0)) { *(int *)(local_res8 + -1) = iVar6; *(undefined2 *)((longlong)local_res8 + (longlong)iVar6 * 2) = 0; } } else if (local_res8 != (undefined **)PTR_DAT_1403440a0) { iVar6 = *(int *)(local_res8 + -1); goto LAB_1401efcb9; } local_48 = 0; local_40 = 0; local_38 = 0; local_30 = 0; local_50 = Proud::ByteArray::vftable; uVar9 = FUN_140198f80(local_res18,3,0,&local_res8,&local_50); (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9); FUN_14019a9e0(&local_50); ppuVar10 = local_res8; if (((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1403440a0)) && (ppuVar1 = local_res8 + -1, ppuVar1 != (undefined **)0x0)) { uVar9 = FUN_14016d8c0(); FUN_14016db50(uVar9); piVar8 = (int *)((longlong)ppuVar10 + -4); *piVar8 = *piVar8 + -1; if (*piVar8 == 0) { FUN_14016d970(ppuVar1); } FUN_14016dbe0(uVar9); } iVar6 = Ordinal_111(); LAB_1401efd7d: FUN_1401eaa60(param_1,iVar6); return; }