151 lines
4.4 KiB
C
151 lines
4.4 KiB
C
/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
|
|
* Ghidra 12.1.2 decompiler output for 0x1401ec760 FUN_1401ec760
|
|
* Pseudocode, not original source. */
|
|
|
|
void FUN_1401ec760(longlong param_1,longlong param_2)
|
|
|
|
{
|
|
longlong *plVar1;
|
|
int iVar2;
|
|
uint uVar3;
|
|
uint uVar4;
|
|
longlong lVar5;
|
|
uint *puVar6;
|
|
undefined8 uVar7;
|
|
uint *puVar8;
|
|
uint uVar9;
|
|
uint uVar10;
|
|
uint uVar11;
|
|
uint *local_res8;
|
|
|
|
(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
|
|
lVar5 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
*(undefined1 *)(lVar5 + 0x80) = 0;
|
|
iVar2 = *(int *)(param_2 + 8);
|
|
if (-1 < iVar2) {
|
|
if (0 < iVar2) {
|
|
lVar5 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
FUN_1401bf1d0(lVar5 + 0x170,iVar2);
|
|
plVar1 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x660);
|
|
*plVar1 = *plVar1 + (longlong)*(int *)(param_2 + 8);
|
|
}
|
|
uVar7 = FUN_1401c71f0(*(undefined8 *)(param_1 + 0x108));
|
|
FUN_1401f9bb0(uVar7);
|
|
return;
|
|
}
|
|
FUN_14016d8c0();
|
|
local_res8 = (uint *)PTR_DAT_1403440a0;
|
|
uVar3 = FUN_14016d740(L"compdatalength < 0 sendcomplete");
|
|
uVar11 = 0;
|
|
uVar9 = 0;
|
|
if ((local_res8 != (uint *)0x0) && (uVar9 = 0, local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar9 = local_res8[-2];
|
|
}
|
|
uVar4 = uVar3;
|
|
if ((((int)uVar3 <= (int)uVar9) && (uVar4 = uVar11, local_res8 != (uint *)0x0)) &&
|
|
(local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar4 = local_res8[-2];
|
|
}
|
|
uVar9 = 1;
|
|
if (1 < (int)uVar4) {
|
|
uVar9 = uVar4;
|
|
}
|
|
uVar4 = uVar11;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar4 = local_res8[-2];
|
|
}
|
|
uVar10 = 0;
|
|
if ((int)uVar4 < (int)uVar9) {
|
|
if (local_res8 == (uint *)0x0) {
|
|
local_res8 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
if ((int)uVar9 < 0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_14016d6b0();
|
|
}
|
|
if (uVar9 == 0) {
|
|
FUN_14004eb70(&local_res8);
|
|
}
|
|
else {
|
|
uVar4 = uVar11;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar4 = local_res8[-2];
|
|
}
|
|
if (uVar9 != uVar4) {
|
|
puVar6 = (uint *)FUN_14016d940((longlong)(int)uVar9 * 2 + 10);
|
|
if (puVar6 != (uint *)0x0) {
|
|
*puVar6 = 0;
|
|
puVar6[1] = 1;
|
|
}
|
|
*puVar6 = uVar9;
|
|
uVar4 = uVar10;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar4 = local_res8[-2];
|
|
}
|
|
puVar8 = (uint *)PTR_DAT_1403440a0;
|
|
if ((int)uVar9 < (int)uVar4) {
|
|
LAB_1401ec8b2:
|
|
if (local_res8 != (uint *)0x0) {
|
|
puVar8 = local_res8;
|
|
}
|
|
}
|
|
else {
|
|
uVar9 = uVar11;
|
|
if (local_res8 != (uint *)0x0) {
|
|
if (local_res8 != (uint *)PTR_DAT_1403440a0) {
|
|
uVar9 = local_res8[-2];
|
|
}
|
|
goto LAB_1401ec8b2;
|
|
}
|
|
}
|
|
FUN_14016d770(puVar6 + 2,puVar8,uVar9);
|
|
FUN_14004eb70(&local_res8);
|
|
local_res8 = puVar6 + 2;
|
|
}
|
|
}
|
|
}
|
|
FUN_14004e850(&local_res8);
|
|
puVar6 = local_res8;
|
|
if (local_res8 == (uint *)0x0) {
|
|
puVar6 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
FUN_14016d770(puVar6,L"compdatalength < 0 sendcomplete",uVar3);
|
|
puVar6 = local_res8;
|
|
if (local_res8 == (uint *)0x0) {
|
|
puVar6 = (uint *)PTR_DAT_1403440a0;
|
|
}
|
|
uVar3 = FUN_14016d740(puVar6);
|
|
uVar9 = 0;
|
|
if (0 < (int)uVar3) {
|
|
uVar9 = uVar3;
|
|
}
|
|
uVar3 = uVar10;
|
|
if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) {
|
|
uVar3 = local_res8[-2];
|
|
}
|
|
if (((int)uVar3 <= (int)uVar9) && (uVar9 = uVar10, local_res8 != (uint *)0x0)) {
|
|
if (local_res8 == (uint *)PTR_DAT_1403440a0) goto LAB_1401ec96c;
|
|
uVar9 = local_res8[-2];
|
|
}
|
|
if (((local_res8 != (uint *)PTR_DAT_1403440a0) && (local_res8 != (uint *)0x0)) &&
|
|
(local_res8 + -2 != (uint *)0x0)) {
|
|
local_res8[-2] = uVar9;
|
|
*(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar9 * 2) = 0;
|
|
}
|
|
LAB_1401ec96c:
|
|
FUN_1401df890(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
|
|
puVar6 = local_res8;
|
|
if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1403440a0)) &&
|
|
(puVar8 = local_res8 + -2, puVar8 != (uint *)0x0)) {
|
|
uVar7 = FUN_14016d8c0();
|
|
FUN_14016db50(uVar7);
|
|
puVar6 = puVar6 + -1;
|
|
*puVar6 = *puVar6 - 1;
|
|
if (*puVar6 == 0) {
|
|
FUN_14016d970(puVar8);
|
|
}
|
|
FUN_14016dbe0(uVar7);
|
|
}
|
|
return;
|
|
}
|
|
|