279 lines
9.1 KiB
C
279 lines
9.1 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x1401f25b0 FUN_1401f25b0
|
|
* Pseudocode, not original source. */
|
|
|
|
void FUN_1401f25b0(longlong param_1,longlong param_2)
|
|
|
|
{
|
|
undefined *puVar1;
|
|
int *piVar2;
|
|
longlong *plVar3;
|
|
undefined *puVar4;
|
|
char cVar5;
|
|
uint uVar6;
|
|
uint uVar7;
|
|
uint uVar8;
|
|
int iVar9;
|
|
longlong lVar10;
|
|
uint *puVar11;
|
|
ulonglong uVar12;
|
|
uint *puVar13;
|
|
ulonglong uVar14;
|
|
uint uVar15;
|
|
uint uVar16;
|
|
uint *local_res8;
|
|
undefined *local_res10;
|
|
undefined *local_res18;
|
|
undefined8 uVar17;
|
|
undefined **local_50;
|
|
undefined8 local_48;
|
|
longlong local_40;
|
|
undefined8 local_38;
|
|
undefined4 local_30;
|
|
undefined4 local_2c;
|
|
|
|
uVar17 = 0xfffffffffffffffe;
|
|
(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
|
|
lVar10 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
*(undefined1 *)(lVar10 + 0xc0) = 0;
|
|
if (*(int *)(param_2 + 8) < 1) {
|
|
FUN_14016d8c0();
|
|
local_res10 = PTR_DAT_1403440a0;
|
|
FUN_14004c020(&local_res10,L"compeltedlength < 0 recvcomplete errorcode:%d",
|
|
*(undefined4 *)(param_2 + 0xc));
|
|
FUN_1401df890(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res10,uVar17);
|
|
if (*(int *)(param_1 + 0x100) < 4) {
|
|
*(undefined4 *)(param_1 + 0x40) = 0;
|
|
*(undefined4 *)(param_1 + 0x100) = 4;
|
|
uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
|
|
*(undefined8 *)(param_1 + 0x80) = uVar17;
|
|
*(undefined1 *)(param_1 + 0xc0) = 0;
|
|
}
|
|
puVar4 = local_res10;
|
|
if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1403440a0)) &&
|
|
(puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
|
|
uVar17 = FUN_14016d8c0();
|
|
FUN_14016db50(uVar17);
|
|
piVar2 = (int *)(puVar4 + -4);
|
|
*piVar2 = *piVar2 + -1;
|
|
if (*piVar2 == 0) {
|
|
FUN_14016d970(puVar1);
|
|
}
|
|
FUN_14016dbe0(uVar17);
|
|
}
|
|
local_res10 = PTR_DAT_1403440a0;
|
|
goto LAB_1401f2ac7;
|
|
}
|
|
lVar10 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
uVar14 = 0;
|
|
uVar12 = uVar14;
|
|
if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
|
|
uVar12 = **(ulonglong **)(lVar10 + 0x128);
|
|
}
|
|
cVar5 = FUN_14019c8d0(uVar12);
|
|
uVar15 = 0;
|
|
if (cVar5 == '\0') {
|
|
uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
|
|
*(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x18c0) = uVar17;
|
|
lVar10 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
uVar12 = uVar14;
|
|
if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
|
|
uVar12 = **(ulonglong **)(lVar10 + 0x128);
|
|
}
|
|
uVar17 = FUN_14019c8b0(uVar12);
|
|
lVar10 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
FUN_1401c5b60(lVar10 + 0x130,uVar17,*(undefined4 *)(param_2 + 8));
|
|
plVar3 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x658);
|
|
*plVar3 = *plVar3 + (longlong)*(int *)(param_2 + 8);
|
|
local_48 = 0;
|
|
local_40 = 0;
|
|
local_38 = 0;
|
|
local_50 = Proud::CReceivedMessageList::vftable;
|
|
local_30 = 1000;
|
|
local_2c = 1;
|
|
FUN_1401d6280(*(undefined8 *)(param_1 + 0x108),&local_50);
|
|
while (iVar9 = (int)uVar14, iVar9 != (int)local_38) {
|
|
if ((iVar9 < 0) || ((int)local_38 <= iVar9)) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6e0();
|
|
}
|
|
lVar10 = *(longlong *)(param_1 + 0x108);
|
|
uVar17 = FUN_1401ed6b0(lVar10 + 0x6e0,local_40 + (longlong)iVar9 * 0x48,
|
|
*(undefined8 *)(lVar10 + 0x6f0),0);
|
|
if (*(undefined8 **)(lVar10 + 0x6f0) == (undefined8 *)0x0) {
|
|
*(undefined8 *)(lVar10 + 0x6e8) = uVar17;
|
|
}
|
|
else {
|
|
**(undefined8 **)(lVar10 + 0x6f0) = uVar17;
|
|
}
|
|
*(undefined8 *)(lVar10 + 0x6f0) = uVar17;
|
|
if ((int)local_38 <= iVar9) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6e0();
|
|
}
|
|
uVar14 = (ulonglong)(iVar9 + 1);
|
|
}
|
|
FUN_1401f1e50(param_1,0);
|
|
FUN_1401a7fe0(&local_50);
|
|
goto LAB_1401f2ac7;
|
|
}
|
|
if (3 < *(int *)(param_1 + 0x100)) goto LAB_1401f2ac7;
|
|
FUN_14016d8c0();
|
|
local_res8 = (uint *)PTR_DAT_1403440a0;
|
|
uVar6 = FUN_14016d740(L"close socket completion");
|
|
if ((local_res8 != (uint *)0x0) && (uVar14 = 0, local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar14 = (ulonglong)local_res8[-2];
|
|
}
|
|
uVar7 = 0;
|
|
uVar8 = uVar6;
|
|
if ((((int)uVar6 <= (int)uVar14) && (uVar8 = uVar15, local_res8 != (uint *)0x0)) &&
|
|
(uVar8 = uVar7, local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar8 = local_res8[-2];
|
|
}
|
|
uVar16 = 1;
|
|
if (1 < (int)uVar8) {
|
|
uVar16 = uVar8;
|
|
}
|
|
uVar8 = uVar7;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar8 = local_res8[-2];
|
|
}
|
|
if ((int)uVar8 < (int)uVar16) {
|
|
if (local_res8 == (uint *)0x0) {
|
|
local_res8 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
if ((int)uVar16 < 0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6b0();
|
|
}
|
|
if (uVar16 == 0) {
|
|
FUN_14004eb70(&local_res8);
|
|
}
|
|
else {
|
|
uVar8 = uVar15;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar8 = local_res8[-2];
|
|
}
|
|
if (uVar16 != uVar8) {
|
|
puVar11 = (uint *)FUN_14016d940((longlong)(int)uVar16 * 2 + 10);
|
|
if (puVar11 != (uint *)0x0) {
|
|
*puVar11 = 0;
|
|
puVar11[1] = 1;
|
|
}
|
|
*puVar11 = uVar16;
|
|
uVar8 = uVar15;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar8 = local_res8[-2];
|
|
}
|
|
puVar13 = (uint *)PTR_DAT_1403440a0;
|
|
if ((int)uVar16 < (int)uVar8) {
|
|
LAB_1401f281c:
|
|
if (local_res8 != (uint *)0x0) {
|
|
puVar13 = local_res8;
|
|
}
|
|
}
|
|
else {
|
|
uVar16 = uVar15;
|
|
if (local_res8 != (uint *)0x0) {
|
|
if (local_res8 != (uint *)PTR_DAT_1403440a0) {
|
|
uVar16 = local_res8[-2];
|
|
}
|
|
goto LAB_1401f281c;
|
|
}
|
|
}
|
|
FUN_14016d770(puVar11 + 2,puVar13,uVar16);
|
|
FUN_14004eb70(&local_res8);
|
|
local_res8 = puVar11 + 2;
|
|
}
|
|
}
|
|
}
|
|
FUN_14004e850(&local_res8);
|
|
puVar11 = local_res8;
|
|
if (local_res8 == (uint *)0x0) {
|
|
puVar11 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
FUN_14016d770(puVar11,L"close socket completion",uVar6);
|
|
puVar11 = local_res8;
|
|
if (local_res8 == (uint *)0x0) {
|
|
puVar11 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
uVar6 = FUN_14016d740(puVar11);
|
|
uVar15 = 0;
|
|
if (0 < (int)uVar6) {
|
|
uVar15 = uVar6;
|
|
}
|
|
uVar6 = uVar7;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar6 = local_res8[-2];
|
|
}
|
|
if (((int)uVar15 < (int)uVar6) || (uVar15 = uVar7, local_res8 == (uint *)0x0)) {
|
|
LAB_1401f28af:
|
|
if (((local_res8 != (uint *)PTR_DAT_1403440a0) && (local_res8 != (uint *)0x0)) &&
|
|
(local_res8 + -2 != (uint *)0x0)) {
|
|
local_res8[-2] = uVar15;
|
|
*(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar15 * 2) = 0;
|
|
}
|
|
}
|
|
else if (local_res8 != (uint *)PTR_DAT_1403440a0) {
|
|
uVar15 = local_res8[-2];
|
|
goto LAB_1401f28af;
|
|
}
|
|
FUN_1401df890(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
|
|
puVar11 = local_res8;
|
|
if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) &&
|
|
(puVar13 = local_res8 + -2, puVar13 != (uint *)0x0)) {
|
|
uVar17 = FUN_14016d8c0();
|
|
FUN_14016db50(uVar17);
|
|
puVar11 = puVar11 + -1;
|
|
*puVar11 = *puVar11 - 1;
|
|
if (*puVar11 == 0) {
|
|
FUN_14016d970(puVar13);
|
|
}
|
|
FUN_14016dbe0(uVar17);
|
|
}
|
|
local_res8 = (uint *)PTR_DAT_1403440a0;
|
|
if (*(int *)(param_1 + 0x100) < 4) {
|
|
*(undefined4 *)(param_1 + 0x40) = 0;
|
|
*(undefined4 *)(param_1 + 0x100) = 4;
|
|
uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
|
|
*(undefined8 *)(param_1 + 0x80) = uVar17;
|
|
*(undefined1 *)(param_1 + 0xc0) = 0;
|
|
}
|
|
LAB_1401f2ac7:
|
|
lVar10 = 0;
|
|
plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x5d0);
|
|
if (plVar3 != (longlong *)0x0) {
|
|
lVar10 = *plVar3;
|
|
}
|
|
if (*(int *)(lVar10 + 0x100) < 4) {
|
|
uVar17 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
iVar9 = FUN_1401f9a20(uVar17);
|
|
if (iVar9 != 0) {
|
|
FUN_14016d8c0();
|
|
local_res18 = PTR_DAT_1403440a0;
|
|
FUN_14004c020(&local_res18,L"%d Tcp issueRecv Failed SocketErrorCode",iVar9);
|
|
FUN_1401df890(*(undefined8 *)(param_1 + 0x108),3,1,&local_res18);
|
|
if (*(int *)(param_1 + 0x100) < 4) {
|
|
*(undefined4 *)(param_1 + 0x40) = 0;
|
|
*(undefined4 *)(param_1 + 0x100) = 4;
|
|
uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
|
|
*(undefined8 *)(param_1 + 0x80) = uVar17;
|
|
*(undefined1 *)(param_1 + 0xc0) = 0;
|
|
}
|
|
puVar4 = local_res18;
|
|
if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1403440a0)) &&
|
|
(puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
|
|
uVar17 = FUN_14016d8c0();
|
|
FUN_14016db50(uVar17);
|
|
piVar2 = (int *)(puVar4 + -4);
|
|
*piVar2 = *piVar2 + -1;
|
|
if (*piVar2 == 0) {
|
|
FUN_14016d970(puVar1);
|
|
}
|
|
FUN_14016dbe0(uVar17);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|