231 lines
6.8 KiB
C
231 lines
6.8 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x1401eea40 FUN_1401eea40
|
|
* Pseudocode, not original source. */
|
|
|
|
void FUN_1401eea40(longlong param_1,undefined8 param_2,int *param_3)
|
|
|
|
{
|
|
undefined8 *puVar1;
|
|
uint uVar2;
|
|
uint uVar3;
|
|
longlong *plVar4;
|
|
uint *puVar5;
|
|
undefined8 uVar6;
|
|
uint *puVar7;
|
|
uint uVar8;
|
|
uint uVar9;
|
|
int iVar10;
|
|
ulonglong uVar11;
|
|
ulonglong uVar12;
|
|
ulonglong uVar13;
|
|
int local_res8 [2];
|
|
undefined8 local_res10;
|
|
uint *local_res18;
|
|
longlong *local_res20;
|
|
undefined **local_c8;
|
|
undefined8 local_c0;
|
|
longlong local_b8;
|
|
undefined8 local_b0;
|
|
undefined4 local_a8;
|
|
undefined4 local_a4;
|
|
undefined **local_a0;
|
|
int local_98;
|
|
undefined2 local_94;
|
|
undefined **local_90;
|
|
undefined8 local_88;
|
|
undefined8 local_80;
|
|
undefined8 local_78;
|
|
undefined8 local_70;
|
|
undefined8 local_68;
|
|
undefined1 local_60;
|
|
undefined1 local_58 [8];
|
|
undefined8 local_50;
|
|
|
|
local_50 = 0xfffffffffffffffe;
|
|
local_res10 = param_2;
|
|
(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
|
|
local_a0 = Proud::AddrPort::vftable;
|
|
local_98 = param_3[0xe];
|
|
local_94 = (undefined2)param_3[0xf];
|
|
plVar4 = (longlong *)FUN_1401d0f00(*(undefined8 *)(param_1 + 0x108),&local_res20,&local_a0);
|
|
uVar11 = 0;
|
|
uVar13 = uVar11;
|
|
if ((ulonglong *)*plVar4 != (ulonglong *)0x0) {
|
|
uVar13 = *(ulonglong *)*plVar4;
|
|
}
|
|
if ((local_res20 != (longlong *)0x0) &&
|
|
(local_res20[1] = local_res20[1] + -1, local_res20[1] == 0)) {
|
|
puVar1 = (undefined8 *)*local_res20;
|
|
if (puVar1 != (undefined8 *)0x0) {
|
|
(**(code **)*puVar1)(puVar1,1);
|
|
}
|
|
FUN_14016d970(local_res20);
|
|
}
|
|
if ((uVar13 == 0) || (*(char *)(uVar13 + 0x650) != '\0')) {
|
|
if (*(longlong *)(param_3 + 2) == 0) {
|
|
if (*(longlong *)(param_3 + 4) == 0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d1e0();
|
|
}
|
|
iVar10 = param_3[6];
|
|
}
|
|
else {
|
|
iVar10 = *(int *)(*(longlong *)(param_3 + 2) + 0x18);
|
|
}
|
|
FUN_14016b600(param_3,iVar10 - ((int)(*param_3 + (*param_3 >> 0x1f & 7U)) >> 3));
|
|
return;
|
|
}
|
|
local_c0 = 0;
|
|
local_b8 = 0;
|
|
local_b0 = 0;
|
|
local_c8 = Proud::CReceivedMessageList::vftable;
|
|
local_a8 = 1000;
|
|
local_a4 = 1;
|
|
FUN_1401ff5a0(uVar13 + 0x638,param_3,&local_c8,local_res8);
|
|
if (local_res8[0] == 0) goto LAB_1401eeda2;
|
|
FUN_14016d8c0();
|
|
local_res18 = (uint *)PTR_DAT_1403440a0;
|
|
uVar2 = FUN_14016d740(L"Stream Extract Error at Reliable UDP");
|
|
uVar9 = 0;
|
|
uVar12 = uVar11;
|
|
if ((local_res18 != (uint *)0x0) && (uVar12 = 0, local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar12 = (ulonglong)local_res18[-2];
|
|
}
|
|
uVar3 = uVar2;
|
|
if ((((int)uVar2 <= (int)uVar12) && (uVar3 = uVar9, local_res18 != (uint *)0x0)) &&
|
|
(local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res18[-2];
|
|
}
|
|
uVar8 = 1;
|
|
if (1 < (int)uVar3) {
|
|
uVar8 = uVar3;
|
|
}
|
|
uVar3 = uVar9;
|
|
if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res18[-2];
|
|
}
|
|
if ((int)uVar3 < (int)uVar8) {
|
|
if (local_res18 == (uint *)0x0) {
|
|
local_res18 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
if ((int)uVar8 < 0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6b0();
|
|
}
|
|
if (uVar8 == 0) {
|
|
FUN_14004eb70(&local_res18);
|
|
}
|
|
else {
|
|
uVar3 = uVar9;
|
|
if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res18[-2];
|
|
}
|
|
if (uVar8 != uVar3) {
|
|
puVar5 = (uint *)FUN_14016d940((longlong)(int)uVar8 * 2 + 10);
|
|
if (puVar5 != (uint *)0x0) {
|
|
*puVar5 = 0;
|
|
puVar5[1] = 1;
|
|
}
|
|
*puVar5 = uVar8;
|
|
uVar3 = uVar9;
|
|
if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res18[-2];
|
|
}
|
|
puVar7 = (uint *)PTR_DAT_1403440a0;
|
|
if ((int)uVar8 < (int)uVar3) {
|
|
LAB_1401eec4b:
|
|
if (local_res18 != (uint *)0x0) {
|
|
puVar7 = local_res18;
|
|
}
|
|
}
|
|
else {
|
|
uVar8 = uVar9;
|
|
if (local_res18 != (uint *)0x0) {
|
|
if (local_res18 != (uint *)PTR_DAT_1403440a0) {
|
|
uVar8 = local_res18[-2];
|
|
}
|
|
goto LAB_1401eec4b;
|
|
}
|
|
}
|
|
FUN_14016d770(puVar5 + 2,puVar7,uVar8);
|
|
FUN_14004eb70(&local_res18);
|
|
local_res18 = puVar5 + 2;
|
|
}
|
|
}
|
|
}
|
|
FUN_14004e850(&local_res18);
|
|
puVar5 = local_res18;
|
|
if (local_res18 == (uint *)0x0) {
|
|
puVar5 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
FUN_14016d770(puVar5,L"Stream Extract Error at Reliable UDP",uVar2);
|
|
puVar5 = local_res18;
|
|
if (local_res18 == (uint *)0x0) {
|
|
puVar5 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
uVar3 = FUN_14016d740(puVar5);
|
|
uVar2 = 0;
|
|
if (0 < (int)uVar3) {
|
|
uVar2 = uVar3;
|
|
}
|
|
uVar3 = uVar9;
|
|
if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res18[-2];
|
|
}
|
|
if (((int)uVar2 < (int)uVar3) || (uVar2 = uVar9, local_res18 == (uint *)0x0)) {
|
|
LAB_1401eecde:
|
|
if (((local_res18 != (uint *)PTR_DAT_1403440a0) && (local_res18 != (uint *)0x0)) &&
|
|
(local_res18 + -2 != (uint *)0x0)) {
|
|
local_res18[-2] = uVar2;
|
|
*(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar2 * 2) = 0;
|
|
}
|
|
}
|
|
else if (local_res18 != (uint *)PTR_DAT_1403440a0) {
|
|
uVar2 = local_res18[-2];
|
|
goto LAB_1401eecde;
|
|
}
|
|
local_88 = 0;
|
|
local_80 = 0;
|
|
local_78 = 0;
|
|
local_70 = 0;
|
|
local_90 = Proud::ByteArray::vftable;
|
|
uVar6 = FUN_140198f80(local_58,local_res8[0],*(undefined4 *)(uVar13 + 0x56c),&local_res18,
|
|
&local_90);
|
|
(**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar6);
|
|
FUN_14019a9e0(&local_90);
|
|
puVar5 = local_res18;
|
|
param_2 = local_res10;
|
|
if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1403440a0)) &&
|
|
(puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
|
|
uVar6 = FUN_14016d8c0();
|
|
local_68 = uVar6;
|
|
FUN_14016db50(uVar6);
|
|
local_60 = 1;
|
|
puVar5 = puVar5 + -1;
|
|
*puVar5 = *puVar5 - 1;
|
|
if (*puVar5 == 0) {
|
|
FUN_14016d970(puVar7);
|
|
}
|
|
FUN_14016dbe0(uVar6);
|
|
param_2 = local_res10;
|
|
}
|
|
LAB_1401eeda2:
|
|
while( true ) {
|
|
iVar10 = (int)uVar11;
|
|
if (iVar10 == (int)local_b0) {
|
|
FUN_1401a7fe0(&local_c8);
|
|
return;
|
|
}
|
|
if ((iVar10 < 0) || ((int)local_b0 <= iVar10)) break;
|
|
*(char *)(local_b8 + (longlong)iVar10 * 0x48 + 0x40) = (char)param_3[0x10];
|
|
FUN_1401f17a0(param_1,param_2);
|
|
if ((int)local_b0 <= iVar10) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6e0();
|
|
}
|
|
uVar11 = (ulonglong)(iVar10 + 1);
|
|
}
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6e0();
|
|
}
|
|
|