Complete decompilation of the retail Asheron's Call client using Ghidra 12.0.4 + pyghidra headless. 22,225 of 22,226 functions successfully decompiled in 75 seconds. Output: docs/research/decompiled/ (54 files, 688,567 lines of C) Key findings already identified: - CLandBlockStruct::ConstructPolygons at chunk_00530000.c:2270 (split direction formula with 0x0CCAC033 constants) - Motion command handlers at chunk_00510000.c (0x45000005 etc) - Motion interpreter at chunk_00520000.c - Portal space UI at chunk_004D0000.c and chunk_00560000.c Next: identify CPhysicsObj, CMotionInterp, collision, and movement functions by cross-referencing against ACE's C# port. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9873 lines
252 KiB
C
9873 lines
252 KiB
C
// Decompiled from acclient.exe — chunk 0x004C0000
|
|
// Ghidra 12.0.4 + pyghidra headless
|
|
|
|
// --- FUN_004c0010 at 0x004C0010 (size: 1166) ---
|
|
|
|
|
|
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
|
|
|
|
|
|
|
|
void __fastcall FUN_004c0010(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
float fVar1;
|
|
|
|
float fVar2;
|
|
|
|
char cVar3;
|
|
|
|
int *piVar4;
|
|
|
|
int iVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
int iVar7;
|
|
|
|
uint uVar8;
|
|
|
|
LONG LVar9;
|
|
|
|
undefined4 *puVar10;
|
|
|
|
int iStack_1c;
|
|
|
|
int local_18;
|
|
|
|
int *piStack_14;
|
|
|
|
int iStack_10;
|
|
|
|
int *apiStack_8 [2];
|
|
|
|
|
|
|
|
iVar7 = DAT_00871e54;
|
|
|
|
local_18 = DAT_00871e54;
|
|
|
|
if (*(int *)(param_1 + 0x630) != DAT_00871e54) {
|
|
|
|
*(int *)(param_1 + 0x630) = DAT_00871e54;
|
|
|
|
FUN_0046a740(&DAT_0083774c);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0);
|
|
|
|
if ((*(uint *)(*(int *)(param_1 + 0x61c) + 0xa4) >> 1 & 1) != 0) {
|
|
|
|
FUN_006aaaa0(0);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x61c) + 0x18))(0);
|
|
|
|
}
|
|
|
|
if ((*(uint *)(*(int *)(param_1 + 0x620) + 0xa4) >> 1 & 1) != 0) {
|
|
|
|
FUN_006a9570(0);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x620) + 0x18))(0);
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x624) + 0x18))(0);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x628) + 0x18))(0);
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x630) == 0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x60c) + 0x9c))(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
piVar4 = (int *)FUN_005583f0(*(int *)(param_1 + 0x630));
|
|
|
|
if (piVar4 == (int *)0x0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cVar3 = FUN_004bdee0();
|
|
|
|
if ((cVar3 == '\0') || (iVar5 = FUN_0058df90(), iVar5 == 0)) {
|
|
|
|
uVar8 = piVar4[0x3e];
|
|
|
|
uVar6 = FUN_0058f510(2,0);
|
|
|
|
if (uVar8 < 2) {
|
|
|
|
uVar6 = FUN_00404a40(0,uVar6);
|
|
|
|
FUN_0046a740(uVar6);
|
|
|
|
LVar9 = InterlockedDecrement(piStack_14 + -4);
|
|
|
|
if ((LVar9 == 0) && (piStack_14 + -5 != (int *)0x0)) {
|
|
|
|
(**(code **)piStack_14[-5])(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar6 = FUN_00480980(&piStack_14,0,L"%d %hs",uVar8);
|
|
|
|
FUN_0046a740(uVar6);
|
|
|
|
LVar9 = InterlockedDecrement(piStack_14 + -4);
|
|
|
|
if ((LVar9 == 0) && (piStack_14 + -5 != (int *)0x0)) {
|
|
|
|
(**(code **)piStack_14[-5])(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iStack_1c = 0;
|
|
|
|
uVar6 = FUN_00485200(apiStack_8,&DAT_007b5250);
|
|
|
|
FUN_0048bc80(uVar6);
|
|
|
|
if (apiStack_8[0] != (int *)0x0) {
|
|
|
|
(**(code **)(*apiStack_8[0] + 0x14))();
|
|
|
|
}
|
|
|
|
if ((piStack_14 != (int *)0x0) && (-1 < iStack_10)) {
|
|
|
|
FUN_00590c20(0x14,&iStack_1c,0,0);
|
|
|
|
}
|
|
|
|
iVar7 = piVar4[0x3e];
|
|
|
|
iVar5 = iStack_1c;
|
|
|
|
uVar6 = FUN_0058f510(2,0);
|
|
|
|
uVar6 = FUN_00480980(&piStack_14,0,L"%d %hs (of %d)",iVar7,uVar6,iVar5);
|
|
|
|
FUN_0046a740(uVar6);
|
|
|
|
FUN_004011b0();
|
|
|
|
iVar7 = local_18;
|
|
|
|
if (piStack_14 != (int *)0x0) {
|
|
|
|
(**(code **)(*piStack_14 + 0x14))();
|
|
|
|
iVar7 = local_18;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DAT_0081d7ec = 1;
|
|
|
|
DAT_0081d7f0 = 1;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x624) + 0x18))(0);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x628) + 0x18))(0);
|
|
|
|
if ((piVar4[0x3e] == 0) || ((uint)piVar4[0x3e] < 2)) {
|
|
|
|
iVar5 = (**(code **)(*piVar4 + 0x10))();
|
|
|
|
if ((iVar5 == 0) && (piVar4[0x50] == 0)) {
|
|
|
|
FUN_0056b210(iVar7);
|
|
|
|
cVar3 = FUN_0056b340(iVar7);
|
|
|
|
if (cVar3 == '\0') {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0x1000000b);
|
|
|
|
iVar7 = FUN_0058df90();
|
|
|
|
if (iVar7 != 0) {
|
|
|
|
FUN_006a9570(*(undefined4 *)(param_1 + 0x630));
|
|
|
|
}
|
|
|
|
goto LAB_004c0425;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0x1000000b);
|
|
|
|
FUN_006aaaa0(*(undefined4 *)(param_1 + 0x630));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar7 = FUN_00564d30();
|
|
|
|
if ((((*(int *)(iVar7 + 0x20) != 0) &&
|
|
|
|
(iVar7 = piVar4[0x2d], iVar5 = FUN_00564d30(), iVar7 == *(int *)(iVar5 + 0x20))) &&
|
|
|
|
(uVar8 = (**(code **)(*piVar4 + 0x18))(), (uVar8 & 0xdc41cb0) != 0)) ||
|
|
|
|
(DAT_0081d7ec = piVar4[0x3e], DAT_0081d7ec == 0)) {
|
|
|
|
DAT_0081d7ec = 1;
|
|
|
|
}
|
|
|
|
DAT_0081d7f0 = piVar4[0x3e];
|
|
|
|
if (DAT_0081d7f0 == 0) {
|
|
|
|
DAT_0081d7f0 = 1;
|
|
|
|
}
|
|
|
|
uVar6 = FUN_00480980(&iStack_1c,0,&DAT_007a11d4,DAT_0081d7ec);
|
|
|
|
FUN_0046a740(uVar6);
|
|
|
|
puVar10 = (undefined4 *)(iStack_1c + -0x14);
|
|
|
|
LVar9 = InterlockedDecrement((LONG *)(iStack_1c + -0x10));
|
|
|
|
if ((LVar9 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
fVar1 = (float)DAT_0081d7ec;
|
|
|
|
if (DAT_0081d7ec < 0) {
|
|
|
|
fVar1 = fVar1 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
fVar2 = (float)DAT_0081d7f0;
|
|
|
|
if (DAT_0081d7f0 < 0) {
|
|
|
|
fVar2 = fVar2 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
FUN_00460760(0x86,fVar1 / fVar2);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0x1000000c);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x624) + 0x18))(1);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x628) + 0x18))(1);
|
|
|
|
}
|
|
|
|
LAB_004c0425:
|
|
|
|
FUN_004fd850(piVar4[0x36]);
|
|
|
|
if (((piVar4[0x3b] == 0) && (uVar8 = (**(code **)(*piVar4 + 0x18))(), (uVar8 & 4) == 0)) &&
|
|
|
|
((uVar8 = (**(code **)(*piVar4 + 0x18))(), (uVar8 & 2) == 0 &&
|
|
|
|
((uVar8 = (**(code **)(*piVar4 + 0x18))(), (uVar8 & 8) == 0 &&
|
|
|
|
(iVar7 = FUN_004fd860(), iVar7 == 0)))))) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x60c) + 0x9c))(0xd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x60c) + 0x9c))(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c04a0 at 0x004C04A0 (size: 220) ---
|
|
|
|
|
|
void FUN_004c04a0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
int *piVar4;
|
|
|
|
undefined1 *puVar5;
|
|
|
|
undefined *puVar6;
|
|
|
|
int *piVar7;
|
|
|
|
int **ppiVar8;
|
|
|
|
undefined4 uVar9;
|
|
|
|
int *local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
FUN_004be0b0();
|
|
|
|
ppiVar8 = &local_14;
|
|
|
|
puVar5 = local_10;
|
|
|
|
puVar6 = &DAT_007b5280;
|
|
|
|
local_14 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar5,&DAT_007b5280,ppiVar8);
|
|
|
|
FUN_00406570(puVar5,puVar6,ppiVar8);
|
|
|
|
piVar4 = local_14;
|
|
|
|
uVar9 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar7 = local_14;
|
|
|
|
if (local_14 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_14 + 0x10))(local_14,0);
|
|
|
|
}
|
|
|
|
local_14 = (int *)FUN_00485260(local_c,piVar7,uVar9);
|
|
|
|
local_14 = (int *)*local_14;
|
|
|
|
if (piVar4 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar4 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar4 = local_8;
|
|
|
|
if (((local_8 != (int *)0x0) && (-1 < (int)local_14)) && (iVar2 = FUN_004f1b20(), iVar2 != 0)) {
|
|
|
|
iVar2 = FUN_004f1b20();
|
|
|
|
iVar3 = 0;
|
|
|
|
do {
|
|
|
|
iVar1 = *(int *)(iVar2 + 4 + iVar3 * 4);
|
|
|
|
if ((iVar1 != 0) && (iVar1 = *(int *)(iVar1 + 8), iVar1 != 0)) {
|
|
|
|
FUN_004be630(iVar1,iVar3,0);
|
|
|
|
}
|
|
|
|
iVar3 = iVar3 + 1;
|
|
|
|
piVar4 = local_8;
|
|
|
|
} while (iVar3 < 0x12);
|
|
|
|
}
|
|
|
|
FUN_004bfea0();
|
|
|
|
if (piVar4 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar4 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0610 at 0x004C0610 (size: 14) ---
|
|
|
|
|
|
void FUN_004c0610(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c04a0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0620 at 0x004C0620 (size: 52) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c0620(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
*param_1 = &PTR_FUN_007b5950;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0690 at 0x004C0690 (size: 40) ---
|
|
|
|
|
|
void __fastcall FUN_004c0690(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
*param_1 = &PTR_FUN_007b5950;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0710 at 0x004C0710 (size: 45) ---
|
|
|
|
|
|
void FUN_004c0710(int *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((param_1[2] == 1) && (*param_1 == 0x100000fa)) {
|
|
|
|
FUN_00479f40(1);
|
|
|
|
}
|
|
|
|
FUN_00462420(param_1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0740 at 0x004C0740 (size: 61) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c0740(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
*param_1 = &PTR_FUN_007b5950;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0780 at 0x004C0780 (size: 19) ---
|
|
|
|
|
|
void FUN_004c0780(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x1000000a,&LAB_004c06c0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c07a0 at 0x004C07A0 (size: 171) ---
|
|
|
|
|
|
void __fastcall FUN_004c07a0(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
undefined4 *puVar2;
|
|
|
|
int *piVar3;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
puVar2 = param_1 + 0x17f;
|
|
|
|
*param_1 = &PTR_FUN_007b5da0;
|
|
|
|
*puVar1 = &PTR_FUN_007b5af8;
|
|
|
|
*puVar2 = &PTR_LAB_007bb0e4;
|
|
|
|
piVar3 = (int *)FUN_0043c680();
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar3 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,2,puVar2);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,1,puVar2);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,4,puVar2);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,3,puVar2);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,6,puVar2);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x10))(9,5,puVar2);
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0880 at 0x004C0880 (size: 74) ---
|
|
|
|
|
|
void __thiscall FUN_004c0880(int *param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((*(int *)(param_2 + 8) == 0x1c) &&
|
|
|
|
((*(int *)(param_2 + 0xc) == 7 || (*(int *)(param_2 + 0xc) == 10)))) {
|
|
|
|
(**(code **)(*param_1 + 0x9c))((param_1[0x100] == 0x10000006) + 0x10000006);
|
|
|
|
}
|
|
|
|
FUN_00462420(param_2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c08d0 at 0x004C08D0 (size: 110) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c08d0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007a6af4;
|
|
|
|
param_1[0x180] = 0;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
param_1[0x184] = 0;
|
|
|
|
param_1[0x185] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b5da0;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b5af8;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007bb0e4;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0940 at 0x004C0940 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004c0940(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c07a0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0960 at 0x004C0960 (size: 244) ---
|
|
|
|
|
|
void __fastcall FUN_004c0960(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000e6);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(7);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x600) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000ec);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(7);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x604) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000ee);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(7);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x608) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000eb);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000ed);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x610) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000ef);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
*(undefined4 *)(param_1 + 0x614) = uVar2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x614) = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0a90 at 0x004C0A90 (size: 19) ---
|
|
|
|
|
|
void FUN_004c0a90(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000009,&LAB_004c0a60);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0ab0 at 0x004C0AB0 (size: 946) ---
|
|
|
|
|
|
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
|
|
|
|
|
|
|
|
void __fastcall FUN_004c0ab0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
float fVar1;
|
|
|
|
float fVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
undefined4 *puVar4;
|
|
|
|
int *piVar5;
|
|
|
|
undefined *puVar6;
|
|
|
|
int *piVar7;
|
|
|
|
int **ppiVar8;
|
|
|
|
undefined4 uVar9;
|
|
|
|
int *local_a4;
|
|
|
|
int local_a0;
|
|
|
|
int local_9c;
|
|
|
|
int *local_98;
|
|
|
|
undefined4 local_94;
|
|
|
|
|
|
|
|
ppiVar8 = &local_a4;
|
|
|
|
piVar5 = &local_a0;
|
|
|
|
puVar6 = &DAT_007b5ad0;
|
|
|
|
local_a4 = (int *)0x0;
|
|
|
|
FUN_00406d10(piVar5,&DAT_007b5ad0,ppiVar8);
|
|
|
|
FUN_00406570(piVar5,puVar6,ppiVar8);
|
|
|
|
piVar5 = local_a4;
|
|
|
|
uVar9 = 0;
|
|
|
|
local_98 = (int *)0x0;
|
|
|
|
local_94 = 0;
|
|
|
|
piVar7 = local_a4;
|
|
|
|
if (local_a4 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_a4 + 0x10))(local_a4,0);
|
|
|
|
}
|
|
|
|
local_a4 = (int *)FUN_0048bb00(&local_9c,piVar7,uVar9);
|
|
|
|
local_a4 = (int *)*local_a4;
|
|
|
|
if (piVar5 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar5 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar5 = local_98;
|
|
|
|
if (local_98 != (int *)0x0) {
|
|
|
|
if ((int)local_a4 < 0) {
|
|
|
|
(**(code **)(*local_98 + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x600) != 0) {
|
|
|
|
local_9c = 0;
|
|
|
|
local_a4 = (int *)0x0;
|
|
|
|
FUN_00592d20(2,&local_9c,0);
|
|
|
|
FUN_00592d20(1,&local_a4,0);
|
|
|
|
fVar1 = (float)local_9c;
|
|
|
|
if (local_9c < 0) {
|
|
|
|
fVar1 = fVar1 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
fVar2 = (float)(int)local_a4;
|
|
|
|
if ((int)local_a4 < 0) {
|
|
|
|
fVar2 = fVar2 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
FUN_00460760(0x69,fVar1 / fVar2);
|
|
|
|
if (*(int *)(param_1 + 0x60c) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840520,0x10000001);
|
|
|
|
FUN_0042e000(DAT_00840524,local_9c,0);
|
|
|
|
FUN_0042e000(DAT_00840528,local_a4,0);
|
|
|
|
uVar9 = FUN_0042e980(&local_a0,0);
|
|
|
|
FUN_0046a740(uVar9);
|
|
|
|
puVar4 = (undefined4 *)(local_a0 + -0x14);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_a0 + -0x10));
|
|
|
|
if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x604) != 0) {
|
|
|
|
local_a4 = (int *)0x0;
|
|
|
|
local_9c = 0;
|
|
|
|
FUN_00592d20(4,&local_a4,0);
|
|
|
|
FUN_00592d20(3,&local_9c,0);
|
|
|
|
fVar1 = (float)(int)local_a4;
|
|
|
|
if ((int)local_a4 < 0) {
|
|
|
|
fVar1 = fVar1 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
fVar2 = (float)local_9c;
|
|
|
|
if (local_9c < 0) {
|
|
|
|
fVar2 = fVar2 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
FUN_00460760(0x69,fVar1 / fVar2);
|
|
|
|
if (*(int *)(param_1 + 0x610) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840520,0x10000001);
|
|
|
|
FUN_0042e000(DAT_00840524,local_a4,0);
|
|
|
|
FUN_0042e000(DAT_00840528,local_9c,0);
|
|
|
|
uVar9 = FUN_0042e980(&local_a0,0);
|
|
|
|
FUN_0046a740(uVar9);
|
|
|
|
puVar4 = (undefined4 *)(local_a0 + -0x14);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_a0 + -0x10));
|
|
|
|
if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x608) != 0) {
|
|
|
|
local_a4 = (int *)0x0;
|
|
|
|
local_9c = 0;
|
|
|
|
FUN_00592d20(6,&local_a4,0);
|
|
|
|
FUN_00592d20(5,&local_9c,0);
|
|
|
|
fVar1 = (float)(int)local_a4;
|
|
|
|
if ((int)local_a4 < 0) {
|
|
|
|
fVar1 = fVar1 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
fVar2 = (float)local_9c;
|
|
|
|
if (local_9c < 0) {
|
|
|
|
fVar2 = fVar2 + _DAT_0079920c;
|
|
|
|
}
|
|
|
|
FUN_00460760(0x69,fVar1 / fVar2);
|
|
|
|
if (*(int *)(param_1 + 0x614) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840520,0x10000001);
|
|
|
|
FUN_0042e000(DAT_00840524,local_a4,0);
|
|
|
|
FUN_0042e000(DAT_00840528,local_9c,0);
|
|
|
|
uVar9 = FUN_0042e980(&local_a0,0);
|
|
|
|
FUN_0046a740(uVar9);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_a0 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_a0 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_a0 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar5 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0e80 at 0x004C0E80 (size: 14) ---
|
|
|
|
|
|
void FUN_004c0e80(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c0ab0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0ea0 at 0x004C0EA0 (size: 83) ---
|
|
|
|
|
|
void FUN_004c0ea0(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (param_4 == 0) {
|
|
|
|
FUN_006ab050(param_1,param_2,param_3);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (param_4 != 1) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FUN_006aaf60(param_1,param_2);
|
|
|
|
}
|
|
|
|
FUN_0058d050(param_1,10);
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00565610();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0f00 at 0x004C0F00 (size: 49) ---
|
|
|
|
|
|
void __thiscall FUN_004c0f00(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x3c) + 8))(param_2,param_3);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x44) + 8))(param_2,param_3);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x40) + 8))(param_2,param_3);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0fa0 at 0x004C0FA0 (size: 32) ---
|
|
|
|
|
|
void FUN_004c0fa0(undefined4 param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
iVar1 = FUN_005583f0(param_1);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_0058cfa0(param_2);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c0fc0 at 0x004C0FC0 (size: 73) ---
|
|
|
|
|
|
void FUN_004c0fc0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (((param_1 != 0) && (iVar1 = FUN_004e3bc0(param_2), iVar1 != 0)) &&
|
|
|
|
(iVar1 = FUN_005583f0(param_2), iVar1 != 0)) {
|
|
|
|
if (*(int *)(param_1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(0);
|
|
|
|
}
|
|
|
|
FUN_004e4c70(param_2);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1010 at 0x004C1010 (size: 30) ---
|
|
|
|
|
|
void __fastcall FUN_004c1010(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (*(int *)(param_1 + 0x604) != 0) {
|
|
|
|
*(undefined4 *)(param_1 + 0x644) = 0;
|
|
|
|
FUN_0046c110();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1030 at 0x004C1030 (size: 134) ---
|
|
|
|
|
|
void __fastcall FUN_004c1030(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
|
|
|
|
cVar1 = FUN_004603a0();
|
|
|
|
if (((cVar1 != '\0') && (*(int *)(*(int *)(param_1 + 0x604) + 0x6d8) != 0x100000cd)) &&
|
|
|
|
(*(int *)(DAT_0083e03c + 0x31c) != 0)) {
|
|
|
|
iVar2 = (**(code **)(*DAT_00837ff4 + 0x18))();
|
|
|
|
iVar3 = (**(code **)(*DAT_00837ff4 + 0x1c))();
|
|
|
|
iVar4 = FUN_0069fe00();
|
|
|
|
if (((iVar4 < iVar2) && (iVar4 = FUN_006a0190(), iVar2 < iVar4)) &&
|
|
|
|
((iVar2 = FUN_0069fe30(), iVar2 < iVar3 && (iVar2 = FUN_006a01e0(), iVar3 < iVar2)))) {
|
|
|
|
FUN_004c1010(0x100000bb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1110 at 0x004C1110 (size: 57) ---
|
|
|
|
|
|
void FUN_004c1110(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
|
|
|
|
uVar1 = *(uint *)(param_1 + 0xf8);
|
|
|
|
if (uVar1 == 0) {
|
|
|
|
uVar1 = 1;
|
|
|
|
}
|
|
|
|
*(uint *)(param_1 + 0xd4) = (*(uint *)(param_1 + 0xd4) / uVar1) * param_2;
|
|
|
|
*(int *)(param_1 + 0xf8) = param_2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1150 at 0x004C1150 (size: 183) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c1150(undefined4 *param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
param_1[1] = param_2;
|
|
|
|
*param_1 = &PTR_LAB_007b6128;
|
|
|
|
param_1[2] = 0;
|
|
|
|
param_1[3] = 0;
|
|
|
|
param_1[4] = 0;
|
|
|
|
param_1[5] = 0;
|
|
|
|
param_1[6] = 0;
|
|
|
|
param_1[7] = 0;
|
|
|
|
param_1[8] = 0;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000bd);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[2] = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000bf);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(6);
|
|
|
|
}
|
|
|
|
param_1[3] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c0);
|
|
|
|
param_1[4] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c1);
|
|
|
|
param_1[5] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c2);
|
|
|
|
param_1[6] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c3);
|
|
|
|
param_1[7] = uVar2;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1210 at 0x004C1210 (size: 40) ---
|
|
|
|
|
|
void __fastcall FUN_004c1210(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004e49f0();
|
|
|
|
if (*(int *)(*(int *)(param_1 + 8) + 0x610) != 0) {
|
|
|
|
FUN_0046ed00(0);
|
|
|
|
}
|
|
|
|
FUN_0046ce20();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1240 at 0x004C1240 (size: 203) ---
|
|
|
|
|
|
void __thiscall FUN_004c1240(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 *unaff_ESI;
|
|
|
|
undefined4 *local_8;
|
|
|
|
int *local_4;
|
|
|
|
|
|
|
|
if ((*(int *)(param_1 + 0xc) != 0) &&
|
|
|
|
(piVar2 = (int *)FUN_0046d2f0(param_2,*(undefined4 *)(param_1 + 0x20)), piVar2 != (int *)0x0))
|
|
|
|
{
|
|
|
|
local_8 = (undefined4 *)0x0;
|
|
|
|
local_4 = (int *)0x0;
|
|
|
|
FUN_0042a2d0(0x10000039);
|
|
|
|
if (local_4 != (int *)0x0) {
|
|
|
|
FUN_00429b10();
|
|
|
|
(**(code **)(*local_4 + 0x7c))(param_3);
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar2 + 0xd4))(&local_8);
|
|
|
|
*(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
|
|
|
|
if ((unaff_ESI != (undefined4 *)0x0) &&
|
|
|
|
(iVar1 = unaff_ESI[1], unaff_ESI[1] = iVar1 + -1, iVar1 + -1 == 0)) {
|
|
|
|
(**(code **)*unaff_ESI)(1);
|
|
|
|
}
|
|
|
|
if ((local_8 != (undefined4 *)0x0) &&
|
|
|
|
(iVar1 = local_8[1], local_8[1] = iVar1 + -1, iVar1 + -1 == 0)) {
|
|
|
|
(**(code **)*local_8)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1310 at 0x004C1310 (size: 182) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c1310(undefined4 *param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
param_1[1] = param_2;
|
|
|
|
*param_1 = &PTR_LAB_007b6134;
|
|
|
|
param_1[2] = 0;
|
|
|
|
param_1[3] = 0;
|
|
|
|
param_1[4] = 0;
|
|
|
|
param_1[5] = 0;
|
|
|
|
param_1[6] = 0;
|
|
|
|
param_1[7] = 0;
|
|
|
|
param_1[8] = 0;
|
|
|
|
param_1[9] = 0;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000c5);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[2] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c7);
|
|
|
|
param_1[3] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c8);
|
|
|
|
param_1[4] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000c9);
|
|
|
|
param_1[5] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000ca);
|
|
|
|
param_1[6] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000cb);
|
|
|
|
param_1[7] = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x100000cc);
|
|
|
|
param_1[8] = uVar2;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c13d0 at 0x004C13D0 (size: 233) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c13d0(undefined4 *param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
param_1[1] = param_2;
|
|
|
|
param_1[2] = &PTR_LAB_007acb10;
|
|
|
|
*param_1 = &PTR_FUN_007b6104;
|
|
|
|
param_1[2] = &PTR_LAB_007b6100;
|
|
|
|
param_1[3] = 0;
|
|
|
|
param_1[4] = 0;
|
|
|
|
param_1[5] = 0;
|
|
|
|
param_1[6] = 0;
|
|
|
|
param_1[7] = 0;
|
|
|
|
param_1[8] = 0;
|
|
|
|
param_1[9] = 0;
|
|
|
|
param_1[10] = 0;
|
|
|
|
param_1[0xb] = 0;
|
|
|
|
param_1[0xc] = DAT_00840550;
|
|
|
|
*(undefined2 *)(param_1 + 0xd) = 0xffff;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000ce);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[3] = iVar2;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 2);
|
|
|
|
}
|
|
|
|
uVar3 = FUN_00463c00(0x100000d0);
|
|
|
|
param_1[4] = uVar3;
|
|
|
|
uVar3 = FUN_00463c00(0x100000d1);
|
|
|
|
param_1[5] = uVar3;
|
|
|
|
uVar3 = FUN_00463c00(0x100000d2);
|
|
|
|
param_1[6] = uVar3;
|
|
|
|
uVar3 = FUN_00463c00(0x100000d3);
|
|
|
|
param_1[7] = uVar3;
|
|
|
|
uVar3 = FUN_00463c00(0x100000d4);
|
|
|
|
param_1[8] = uVar3;
|
|
|
|
uVar3 = FUN_00463c00(0x100000d5);
|
|
|
|
param_1[9] = uVar3;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c14c0 at 0x004C14C0 (size: 96) ---
|
|
|
|
|
|
void __thiscall FUN_004c14c0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
iVar2 = FUN_005df0f5(0x18);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2860(param_2);
|
|
|
|
*(undefined4 *)(iVar2 + 0x10) = 0;
|
|
|
|
*(undefined4 *)(iVar2 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1 + 4);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
*(int *)(param_1 + 8) = iVar2;
|
|
|
|
*(int *)(param_1 + 4) = iVar2;
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
*(int *)(iVar1 + 0x14) = iVar2;
|
|
|
|
*(int *)(iVar2 + 0x10) = iVar1;
|
|
|
|
*(int *)(param_1 + 4) = iVar2;
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1520 at 0x004C1520 (size: 99) ---
|
|
|
|
|
|
void __thiscall FUN_004c1520(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
iVar2 = FUN_005df0f5(0x18);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2860(param_2);
|
|
|
|
*(undefined4 *)(iVar2 + 0x10) = 0;
|
|
|
|
*(undefined4 *)(iVar2 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 4) == 0) {
|
|
|
|
*(int *)(param_1 + 4) = iVar2;
|
|
|
|
*(int *)(param_1 + 8) = iVar2;
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1 + 8);
|
|
|
|
*(int *)(iVar1 + 0x10) = iVar2;
|
|
|
|
*(int *)(iVar2 + 0x14) = iVar1;
|
|
|
|
*(int *)(param_1 + 8) = iVar2;
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c16e0 at 0x004C16E0 (size: 115) ---
|
|
|
|
|
|
int __thiscall FUN_004c16e0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
|
|
|
|
*(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
|
|
|
|
*(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 8);
|
|
|
|
*(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_2 + 0xc);
|
|
|
|
*(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_2 + 0x10);
|
|
|
|
*(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x14);
|
|
|
|
*(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(param_2 + 0x18);
|
|
|
|
*(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
|
|
|
|
*(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
|
|
|
|
puVar1 = *(undefined4 **)(param_1 + 0x24);
|
|
|
|
if (puVar1 != *(undefined4 **)(param_2 + 0x24)) {
|
|
|
|
LVar3 = InterlockedDecrement(puVar1 + 1);
|
|
|
|
if ((LVar3 == 0) && (puVar1 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar1)(1);
|
|
|
|
}
|
|
|
|
iVar2 = *(int *)(param_2 + 0x24);
|
|
|
|
*(int *)(param_1 + 0x24) = iVar2;
|
|
|
|
InterlockedIncrement((LONG *)(iVar2 + 4));
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1760 at 0x004C1760 (size: 90) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c1760(int param_1,int param_2,int *param_3,undefined4 *param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
iVar2 = *(int *)(*(int *)(param_1 + 0x610) + 4);
|
|
|
|
while( true ) {
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_005583f0(*(undefined4 *)(iVar2 + 8));
|
|
|
|
if ((iVar1 != 0) && (*(int *)(iVar1 + 0xa4) == param_2)) break;
|
|
|
|
iVar2 = *(int *)(iVar2 + 0x10);
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(iVar2 + 4);
|
|
|
|
if ((iVar1 != -1) && (iVar1 < *param_3)) {
|
|
|
|
*param_3 = iVar1;
|
|
|
|
}
|
|
|
|
*param_4 = *(undefined4 *)(iVar2 + 8);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c17c0 at 0x004C17C0 (size: 52) ---
|
|
|
|
|
|
void FUN_004c17c0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
for (iVar1 = *(int *)(param_1 + 4); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
iVar2 = FUN_005583f0(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_0058cfa0(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1800 at 0x004C1800 (size: 155) ---
|
|
|
|
|
|
void FUN_004c1800(int param_1,int *param_2,int *param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
*param_2 = 0;
|
|
|
|
*param_3 = 0;
|
|
|
|
for (iVar1 = *(int *)(param_1 + 4); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
iVar2 = FUN_005583f0(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
if (*(uint *)(iVar2 + 0xfc) < 2) {
|
|
|
|
if ((((*(uint *)(iVar2 + 0x100) & 0x800000) == 0) && (*(int *)(iVar2 + 200) == 0)) &&
|
|
|
|
(*(int *)(iVar2 + 0xcc) == 0)) {
|
|
|
|
*param_2 = *param_2 + *(int *)(iVar1 + 4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*param_3 = *param_3 + *(int *)(iVar1 + 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((((*(uint *)(iVar2 + 0x100) & 0x800000) == 0) && (*(int *)(iVar2 + 200) == 0)) &&
|
|
|
|
(*(int *)(iVar2 + 0xcc) == 0)) {
|
|
|
|
*param_2 = *param_2 + 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*param_3 = *param_3 + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c18b0 at 0x004C18B0 (size: 202) ---
|
|
|
|
|
|
void __fastcall FUN_004c18b0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iStack_c;
|
|
|
|
|
|
|
|
iVar1 = DAT_00871e54;
|
|
|
|
if ((DAT_00871e54 != 0) && (iVar4 = 0, 0 < *(int *)(*(int *)(param_1 + 8) + 0x610))) {
|
|
|
|
while ((piVar2 = (int *)FUN_0046dc50(iVar4), piVar2 == (int *)0x0 ||
|
|
|
|
((iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 == 0 ||
|
|
|
|
(*(int *)(iVar3 + 0x5fc) != iVar1))))) {
|
|
|
|
iVar4 = iVar4 + 1;
|
|
|
|
if (*(int *)(*(int *)(param_1 + 8) + 0x610) <= iVar4) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_005d2810();
|
|
|
|
for (iVar4 = *(int *)(*(int *)(*(int *)(param_1 + 4) + 0x610) + 4); iVar4 != 0;
|
|
|
|
iVar4 = *(int *)(iVar4 + 0x10)) {
|
|
|
|
if (*(int *)(iVar4 + 8) == iVar1) {
|
|
|
|
FUN_005d2770(iVar4);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (iStack_c < 1) {
|
|
|
|
iStack_c = -1;
|
|
|
|
}
|
|
|
|
FUN_004e1f50(iStack_c);
|
|
|
|
FUN_004e2e60();
|
|
|
|
FUN_005d2830();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1980 at 0x004C1980 (size: 119) ---
|
|
|
|
|
|
undefined4 FUN_004c1980(int param_1,uint param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
uint uVar3;
|
|
|
|
undefined4 local_8;
|
|
|
|
|
|
|
|
FUN_005d2810();
|
|
|
|
for (iVar1 = *(int *)(param_1 + 4); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
FUN_005d2770(iVar1);
|
|
|
|
piVar2 = (int *)FUN_005583f0(local_8);
|
|
|
|
if ((piVar2 != (int *)0x0) && (uVar3 = (**(code **)(*piVar2 + 0x18))(), (param_2 & uVar3) != 0))
|
|
|
|
{
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (iVar1 == 0) break;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1a00 at 0x004C1A00 (size: 137) ---
|
|
|
|
|
|
void __fastcall FUN_004c1a00(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
byte bVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
iVar2 = FUN_004e3c10();
|
|
|
|
if (iVar2 < 1) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x20) + 0x9c))(0xd);
|
|
|
|
uVar3 = 0xd;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x20) + 0x9c))(1);
|
|
|
|
uVar3 = 1;
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x18) + 0x9c))(uVar3);
|
|
|
|
iVar2 = *(int *)(*(int *)(param_1 + 4) + 0x618);
|
|
|
|
do {
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
bVar1 = 0;
|
|
|
|
LAB_004c1a5e:
|
|
|
|
iVar2 = (-(uint)bVar1 & 0xfffffff4) + 0xd;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x1c) + 0x9c))(iVar2);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x14) + 0x9c))(iVar2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(int *)(iVar2 + 8) == DAT_00871e54) {
|
|
|
|
bVar1 = 1;
|
|
|
|
goto LAB_004c1a5e;
|
|
|
|
}
|
|
|
|
iVar2 = *(int *)(iVar2 + 0x10);
|
|
|
|
} while( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1ab0 at 0x004C1AB0 (size: 140) ---
|
|
|
|
|
|
void __fastcall FUN_004c1ab0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
byte bVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
iVar2 = FUN_004e3c10();
|
|
|
|
if (iVar2 < 1) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x24) + 0x9c))(0xd);
|
|
|
|
uVar3 = 0xd;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x24) + 0x9c))(1);
|
|
|
|
uVar3 = 1;
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x1c) + 0x9c))(uVar3);
|
|
|
|
iVar2 = *(int *)(*(int *)(param_1 + 4) + 0x628);
|
|
|
|
do {
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
bVar1 = 0;
|
|
|
|
LAB_004c1b0e:
|
|
|
|
iVar2 = (-(uint)bVar1 & 0xfffffff4) + 0xd;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x20) + 0x9c))(iVar2);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x18) + 0x9c))(iVar2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(int *)(iVar2 + 8) == DAT_00871e54) {
|
|
|
|
bVar1 = 1;
|
|
|
|
goto LAB_004c1b0e;
|
|
|
|
}
|
|
|
|
iVar2 = *(int *)(iVar2 + 0x10);
|
|
|
|
} while( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1b60 at 0x004C1B60 (size: 89) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c1b60(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
void *pvVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 4) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pvVar1 = *(void **)(param_1 + 8);
|
|
|
|
iVar2 = *(int *)((int)pvVar1 + 0x14);
|
|
|
|
*(int *)(param_1 + 8) = iVar2;
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
*(undefined4 *)(param_1 + 4) = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*(undefined4 *)(iVar2 + 0x10) = 0;
|
|
|
|
}
|
|
|
|
FUN_005d2770(pvVar1);
|
|
|
|
if (pvVar1 != (void *)0x0) {
|
|
|
|
FUN_005d2830();
|
|
|
|
operator_delete(pvVar1);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + -1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1bc0 at 0x004C1BC0 (size: 216) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c1bc0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
void *pvVar1;
|
|
|
|
void *pvVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
pvVar1 = *(void **)(param_1 + 4);
|
|
|
|
if (pvVar1 == (void *)0x0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar3 = FUN_005d27f0(param_2);
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
iVar3 = *(int *)((int)pvVar1 + 0x10);
|
|
|
|
while( true ) {
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar3 = FUN_005d27f0(param_2);
|
|
|
|
if (iVar3 != 0) break;
|
|
|
|
pvVar1 = *(void **)((int)pvVar1 + 0x10);
|
|
|
|
iVar3 = *(int *)((int)pvVar1 + 0x10);
|
|
|
|
}
|
|
|
|
FUN_005d2770(*(undefined4 *)((int)pvVar1 + 0x10));
|
|
|
|
pvVar2 = *(void **)((int)pvVar1 + 0x10);
|
|
|
|
iVar3 = *(int *)((int)pvVar2 + 0x10);
|
|
|
|
*(int *)((int)pvVar1 + 0x10) = iVar3;
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
*(void **)(param_1 + 8) = pvVar1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*(void **)(iVar3 + 0x14) = pvVar1;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
operator_delete(pvVar2);
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + -1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_005d2770(*(undefined4 *)(param_1 + 4));
|
|
|
|
iVar3 = *(int *)(*(int *)(param_1 + 4) + 0x10);
|
|
|
|
*(int *)(param_1 + 4) = iVar3;
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
*(undefined4 *)(param_1 + 8) = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*(undefined4 *)(iVar3 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
if (pvVar1 != (void *)0x0) {
|
|
|
|
FUN_005d2830();
|
|
|
|
operator_delete(pvVar1);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + -1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1ca0 at 0x004C1CA0 (size: 111) ---
|
|
|
|
|
|
void __fastcall FUN_004c1ca0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
void *pvVar2;
|
|
|
|
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar1 = *(int *)(param_1 + 4);
|
|
|
|
while (iVar1 != 0) {
|
|
|
|
pvVar2 = *(void **)(param_1 + 4);
|
|
|
|
if (pvVar2 != (void *)0x0) {
|
|
|
|
iVar1 = *(int *)((int)pvVar2 + 0x10);
|
|
|
|
*(int *)(param_1 + 4) = iVar1;
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
*(undefined4 *)(param_1 + 8) = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*(undefined4 *)(iVar1 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
FUN_005d2770(pvVar2);
|
|
|
|
if (pvVar2 != (void *)0x0) {
|
|
|
|
FUN_005d2830();
|
|
|
|
operator_delete(pvVar2);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + -1;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1 + 4);
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1d10 at 0x004C1D10 (size: 141) ---
|
|
|
|
|
|
undefined4 FUN_004c1d10(int *param_1,uint param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
int local_10 [4];
|
|
|
|
|
|
|
|
FUN_004c1ca0();
|
|
|
|
if (param_2 < 4) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)*param_1;
|
|
|
|
*param_1 = (int)((int *)*param_1 + 1);
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar3 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
do {
|
|
|
|
iVar2 = (**(code **)(local_10[0] + 0x10))(param_1,param_2);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
FUN_005d2830();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
FUN_004c1520(local_10);
|
|
|
|
iVar3 = iVar3 + 1;
|
|
|
|
} while (iVar3 < iVar1);
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1da0 at 0x004C1DA0 (size: 162) ---
|
|
|
|
|
|
int * __thiscall FUN_004c1da0(int *param_1,int *param_2,int *param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int iVar4;
|
|
|
|
int *local_4;
|
|
|
|
|
|
|
|
piVar1 = param_3;
|
|
|
|
local_4 = param_1;
|
|
|
|
if (param_3 == (int *)0x0) {
|
|
|
|
piVar3 = (int *)*param_1;
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
*param_1 = 0;
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
param_1[1] = 0;
|
|
|
|
}
|
|
|
|
iVar4 = -0x7fffbffe;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar4 = *param_3;
|
|
|
|
param_3 = (int *)0x0;
|
|
|
|
piVar3 = (int *)(**(code **)(iVar4 + 0xc))(&local_4,&DAT_007b5fa8,¶m_3);
|
|
|
|
piVar2 = param_3;
|
|
|
|
iVar4 = *piVar3;
|
|
|
|
piVar3 = (int *)*param_1;
|
|
|
|
if (iVar4 < 0) {
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
}
|
|
|
|
*param_1 = 0;
|
|
|
|
param_1[1] = 0;
|
|
|
|
*param_2 = iVar4;
|
|
|
|
(**(code **)(*piVar1 + 0x14))();
|
|
|
|
return param_2;
|
|
|
|
}
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
}
|
|
|
|
*param_1 = (int)piVar2;
|
|
|
|
param_1[1] = 0;
|
|
|
|
}
|
|
|
|
*param_2 = iVar4;
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar1 + 0x14))();
|
|
|
|
}
|
|
|
|
return param_2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1e50 at 0x004C1E50 (size: 168) ---
|
|
|
|
|
|
undefined4 FUN_004c1e50(int param_1,int param_2,int param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
int local_c;
|
|
|
|
int local_8;
|
|
|
|
|
|
|
|
FUN_005d2810();
|
|
|
|
for (iVar1 = *(int *)(param_1 + 4); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
FUN_005d2770(iVar1);
|
|
|
|
if (local_8 == param_2) {
|
|
|
|
if ((param_3 != -1) && (param_3 < local_c)) {
|
|
|
|
local_c = local_c - param_3;
|
|
|
|
FUN_005d2770(local_10);
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_004c1bc0(local_10);
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (iVar1 == 0) break;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c1f00 at 0x004C1F00 (size: 414) ---
|
|
|
|
|
|
undefined1 FUN_004c1f00(int param_1,int param_2,int param_3,int param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
bool bVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
uint uVar8;
|
|
|
|
int iVar9;
|
|
|
|
undefined1 local_19;
|
|
|
|
int local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
uint uStack_c;
|
|
|
|
int iStack_8;
|
|
|
|
undefined4 uStack_4;
|
|
|
|
|
|
|
|
FUN_004c1ca0();
|
|
|
|
FUN_005d2810();
|
|
|
|
bVar2 = false;
|
|
|
|
local_19 = 0;
|
|
|
|
local_14 = 0;
|
|
|
|
if (0 < *(int *)(param_1 + 0x610)) {
|
|
|
|
do {
|
|
|
|
piVar3 = (int *)FUN_0046dc50(local_14);
|
|
|
|
if (((piVar3 != (int *)0x0) && (iVar4 = (**(code **)(*piVar3 + 0x94))(0x10000032), iVar4 != 0)
|
|
|
|
) && (iVar4 = *(int *)(iVar4 + 0x5fc), iVar4 != 0)) {
|
|
|
|
uVar8 = 1;
|
|
|
|
if (param_4 != 0) {
|
|
|
|
iVar5 = FUN_005583f0(iVar4);
|
|
|
|
uVar1 = *(uint *)(iVar5 + 0xf8);
|
|
|
|
if ((uVar1 != 0) && (1 < uVar1)) {
|
|
|
|
uVar8 = uVar1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (param_3 == 0) {
|
|
|
|
LAB_004c2004:
|
|
|
|
if (bVar2) {
|
|
|
|
local_19 = 1;
|
|
|
|
goto LAB_004c206c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar5 = *(int *)(param_2 + 4);
|
|
|
|
iVar9 = 0;
|
|
|
|
bVar2 = false;
|
|
|
|
if (iVar5 != 0) {
|
|
|
|
do {
|
|
|
|
FUN_005d2770(iVar5);
|
|
|
|
if (iStack_8 == iVar4) {
|
|
|
|
uStack_c = uStack_c + uVar8;
|
|
|
|
iVar7 = *(int *)(param_2 + 4);
|
|
|
|
bVar2 = true;
|
|
|
|
iVar6 = iVar9;
|
|
|
|
if (0 < iVar9) {
|
|
|
|
do {
|
|
|
|
if (iVar7 != 0) {
|
|
|
|
iVar7 = *(int *)(iVar7 + 0x10);
|
|
|
|
}
|
|
|
|
iVar6 = iVar6 + -1;
|
|
|
|
} while (iVar6 != 0);
|
|
|
|
}
|
|
|
|
if (iVar7 != 0) {
|
|
|
|
FUN_005d2770(local_10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar9 = iVar9 + 1;
|
|
|
|
} while ((iVar5 != 0) && (iVar5 = *(int *)(iVar5 + 0x10), iVar5 != 0));
|
|
|
|
goto LAB_004c2004;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uStack_4 = 0;
|
|
|
|
uStack_c = uVar8;
|
|
|
|
iStack_8 = iVar4;
|
|
|
|
iVar4 = FUN_005df0f5(0x18);
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
iVar4 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2860(local_10);
|
|
|
|
*(undefined4 *)(iVar4 + 0x10) = 0;
|
|
|
|
*(undefined4 *)(iVar4 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_2 + 4) == 0) {
|
|
|
|
*(int *)(param_2 + 4) = iVar4;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar5 = *(int *)(param_2 + 8);
|
|
|
|
*(int *)(iVar5 + 0x10) = iVar4;
|
|
|
|
*(int *)(iVar4 + 0x14) = iVar5;
|
|
|
|
}
|
|
|
|
*(int *)(param_2 + 8) = iVar4;
|
|
|
|
*(int *)(param_2 + 0xc) = *(int *)(param_2 + 0xc) + 1;
|
|
|
|
}
|
|
|
|
LAB_004c206c:
|
|
|
|
local_14 = local_14 + 1;
|
|
|
|
} while (local_14 < *(int *)(param_1 + 0x610));
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return local_19;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c20a0 at 0x004C20A0 (size: 533) ---
|
|
|
|
|
|
int FUN_004c20a0(int param_1,undefined4 param_2,int param_3,int param_4,int param_5,int param_6)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 *puVar4;
|
|
|
|
LONG LVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
int iVar7;
|
|
|
|
int iVar8;
|
|
|
|
int iVar9;
|
|
|
|
undefined4 uVar10;
|
|
|
|
undefined4 uVar11;
|
|
|
|
undefined4 uVar12;
|
|
|
|
undefined4 uVar13;
|
|
|
|
int local_a0;
|
|
|
|
int iStack_98;
|
|
|
|
int iStack_94;
|
|
|
|
undefined1 auStack_90 [144];
|
|
|
|
|
|
|
|
local_a0 = -1;
|
|
|
|
iVar1 = -1;
|
|
|
|
if (param_1 != 0) {
|
|
|
|
if ((param_4 != 0) && (iVar1 = FUN_004e3bc0(param_2), iVar1 != 0)) {
|
|
|
|
iVar1 = FUN_00480780(iVar1);
|
|
|
|
if (iVar1 < param_3) {
|
|
|
|
param_3 = param_3 + -1;
|
|
|
|
}
|
|
|
|
FUN_004c0fc0(param_1,param_2,1);
|
|
|
|
}
|
|
|
|
piVar2 = (int *)FUN_005583f0(param_2);
|
|
|
|
if (((param_6 != 0) && (iVar1 = FUN_005d2b50(piVar2 + 0x26), iVar1 == 0)) &&
|
|
|
|
(iVar1 = (**(code **)(*piVar2 + 0x10))(), iVar1 == 0)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_0058cce0();
|
|
|
|
if ((iVar1 == 0) && (iVar1 = FUN_0058ccf0(), iVar1 == 0)) {
|
|
|
|
if (*(int *)(param_1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(param_2,param_3);
|
|
|
|
local_a0 = param_3;
|
|
|
|
}
|
|
|
|
iVar1 = local_a0;
|
|
|
|
if ((param_5 != 0) && (iVar3 = FUN_0058cce0(), 0 < iVar3)) {
|
|
|
|
puVar4 = (undefined4 *)FUN_0058f8b0(&iStack_94,2,0);
|
|
|
|
FUN_00480980(&iStack_98,0,L"Selling contents of %s",*puVar4);
|
|
|
|
LVar5 = InterlockedDecrement((LONG *)(iStack_94 + -0x10));
|
|
|
|
if ((LVar5 == 0) && ((undefined4 *)(iStack_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(iStack_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&iStack_98,1);
|
|
|
|
FUN_00693500(0x1a,auStack_90);
|
|
|
|
iVar3 = FUN_0058cd20();
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_005aefc0(0);
|
|
|
|
iVar8 = 0;
|
|
|
|
if (0 < *(int *)(iVar3 + 0x10)) {
|
|
|
|
do {
|
|
|
|
uVar13 = 0xffffffff;
|
|
|
|
uVar12 = 1;
|
|
|
|
uVar11 = 1;
|
|
|
|
uVar10 = 0;
|
|
|
|
iVar7 = param_3;
|
|
|
|
iVar9 = param_4;
|
|
|
|
uVar6 = FUN_005aece0(param_3,param_4,0,1,1,0xffffffff);
|
|
|
|
iVar7 = FUN_004c20a0(param_1,uVar6,iVar7,iVar9,uVar10,uVar11,uVar12,uVar13);
|
|
|
|
if (iVar7 != -1) {
|
|
|
|
param_3 = iVar7 + 1;
|
|
|
|
}
|
|
|
|
FUN_005aecb0();
|
|
|
|
iVar8 = iVar8 + 1;
|
|
|
|
} while (iVar8 < *(int *)(iVar3 + 0x10));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
LVar5 = InterlockedDecrement((LONG *)(iStack_98 + -0x10));
|
|
|
|
if ((LVar5 == 0) && ((undefined4 *)(iStack_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(iStack_98 + -0x14))(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return iVar1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c2a90 at 0x004C2A90 (size: 531) ---
|
|
|
|
|
|
void __thiscall FUN_004c2a90(int param_1,uint param_2,char param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int *piVar4;
|
|
|
|
uint uVar5;
|
|
|
|
int iVar6;
|
|
|
|
uint uVar7;
|
|
|
|
uint local_30;
|
|
|
|
int local_2c;
|
|
|
|
undefined4 local_28;
|
|
|
|
int *local_24;
|
|
|
|
uint uStack_1c;
|
|
|
|
int iStack_18;
|
|
|
|
int iStack_c;
|
|
|
|
|
|
|
|
local_2c = 0;
|
|
|
|
FUN_004e49f0();
|
|
|
|
if (*(int *)(*(int *)(param_1 + 4) + 0x608) != 0) {
|
|
|
|
local_30 = 0;
|
|
|
|
if (param_2 == 0) {
|
|
|
|
piVar3 = (int *)FUN_0046ce50();
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
local_28 = 0;
|
|
|
|
local_24 = (int *)0x0;
|
|
|
|
(**(code **)(*piVar3 + 0xd0))(0x10000039,&local_28);
|
|
|
|
if (local_24 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_24 + 0x78))(&local_30);
|
|
|
|
}
|
|
|
|
FUN_004234d0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
local_30 = param_2;
|
|
|
|
}
|
|
|
|
FUN_005d2810();
|
|
|
|
FUN_005d2810();
|
|
|
|
for (piVar3 = *(int **)(*(int *)(*(int *)(param_1 + 4) + 0x610) + 4); local_24 = piVar3,
|
|
|
|
piVar3 != (int *)0x0; piVar3 = (int *)piVar3[4]) {
|
|
|
|
FUN_005d2770(piVar3);
|
|
|
|
piVar4 = (int *)FUN_005583f0(iStack_18);
|
|
|
|
if ((piVar4 != (int *)0x0) &&
|
|
|
|
(uVar5 = (**(code **)(*piVar4 + 0x18))(), uVar7 = uStack_1c, (local_30 & uVar5) != 0)) {
|
|
|
|
if (local_2c == 0) {
|
|
|
|
local_2c = iStack_18;
|
|
|
|
}
|
|
|
|
if (uStack_1c == 0xffffffff) {
|
|
|
|
uVar7 = piVar4[0x3f];
|
|
|
|
if (1 < uVar7) {
|
|
|
|
LAB_004c2bde:
|
|
|
|
FUN_004c1110(piVar4,uVar7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (iVar1 = *(int *)(*(int *)(param_1 + 4) + 0x618); iVar1 != 0;
|
|
|
|
iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
if (*(int *)(iVar1 + 8) == iStack_18) {
|
|
|
|
FUN_005d2770(iVar1);
|
|
|
|
uVar7 = uVar7 - iStack_c;
|
|
|
|
if ((int)uVar7 < 1) goto LAB_004c2c4e;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uVar5 = piVar4[0x3f];
|
|
|
|
if (1 < uVar5) {
|
|
|
|
if ((int)uVar5 < (int)uVar7) {
|
|
|
|
uVar7 = uVar5;
|
|
|
|
}
|
|
|
|
goto LAB_004c2bde;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (DAT_00871e54 == iStack_18) {
|
|
|
|
thunk_FUN_00693810(iStack_18,0);
|
|
|
|
}
|
|
|
|
iVar2 = iStack_18;
|
|
|
|
iVar1 = *(int *)(param_1 + 8);
|
|
|
|
piVar3 = local_24;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_005583f0(iStack_18);
|
|
|
|
iVar6 = FUN_0058cce0();
|
|
|
|
piVar3 = local_24;
|
|
|
|
if ((iVar6 == 0) && (iVar6 = FUN_0058ccf0(), piVar3 = local_24, iVar6 == 0)) {
|
|
|
|
if (*(int *)(iVar1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(iVar2,0xffffffff);
|
|
|
|
piVar3 = local_24;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LAB_004c2c4e:
|
|
|
|
if (piVar3 == (int *)0x0) break;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
FUN_005d2830();
|
|
|
|
}
|
|
|
|
if (param_3 != '\0') {
|
|
|
|
FUN_0058d110(local_2c,0);
|
|
|
|
}
|
|
|
|
if (*(int *)(*(int *)(param_1 + 8) + 0x610) != 0) {
|
|
|
|
FUN_0046ed00(0);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c2cb0 at 0x004C2CB0 (size: 554) ---
|
|
|
|
|
|
undefined4 FUN_004c2cb0(undefined4 param_1,char param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
int local_a4;
|
|
|
|
undefined1 local_a0 [4];
|
|
|
|
undefined1 local_9c [4];
|
|
|
|
undefined1 local_98 [4];
|
|
|
|
undefined1 local_94 [4];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar1 = FUN_005583f0(param_1);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_0058df90();
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
if (param_2 == '\0') {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You can only sell items you are carrying");
|
|
|
|
FUN_0042cbe0(&local_a4,1);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_a4 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_a4 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_a4 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if (0 < iVar2) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_005d2a90(iVar1 + 0x98);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (param_2 != '\0') {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
switch(iVar1) {
|
|
|
|
case 1:
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"That item cannot be sold here");
|
|
|
|
FUN_0042cbe0(&local_a4,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"That item has no value and cannot be sold");
|
|
|
|
FUN_0042cbe0(local_94,1);
|
|
|
|
goto LAB_004c2ea3;
|
|
|
|
case 3:
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"That item is too cheap to sell here");
|
|
|
|
FUN_0042cbe0(local_a0,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"That item is too valuable to sell here");
|
|
|
|
FUN_0042cbe0(local_9c,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You cannot sell that here");
|
|
|
|
FUN_0042cbe0(local_98,1);
|
|
|
|
LAB_004c2ea3:
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c2f30 at 0x004C2F30 (size: 107) ---
|
|
|
|
|
|
int __thiscall FUN_004c2f30(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_004c1ca0();
|
|
|
|
iVar1 = *(int *)(param_2 + 4);
|
|
|
|
while( true ) {
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
iVar3 = FUN_005df0f5(0x18);
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2860(iVar1);
|
|
|
|
*(undefined4 *)(iVar3 + 0x10) = 0;
|
|
|
|
*(undefined4 *)(iVar3 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 4) == 0) {
|
|
|
|
*(int *)(param_1 + 4) = iVar3;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = *(int *)(param_1 + 8);
|
|
|
|
*(int *)(iVar2 + 0x10) = iVar3;
|
|
|
|
*(int *)(iVar3 + 0x14) = iVar2;
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 8) = iVar3;
|
|
|
|
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
|
|
|
|
if (iVar1 == 0) break;
|
|
|
|
iVar1 = *(int *)(iVar1 + 0x10);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c2fa0 at 0x004C2FA0 (size: 42) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c2fa0(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
*param_1 = &PTR_FUN_007b6110;
|
|
|
|
FUN_004c1ca0();
|
|
|
|
*param_1 = &PTR_FUN_0079385c;
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c2fd0 at 0x004C2FD0 (size: 62) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c2fd0(undefined4 *param_1,int *param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
*param_1 = 0;
|
|
|
|
param_1[1] = 0;
|
|
|
|
piVar2 = (int *)*param_2;
|
|
|
|
uVar3 = 0;
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x10))(piVar2,0);
|
|
|
|
}
|
|
|
|
puVar1 = (undefined4 *)FUN_004c1da0(¶m_2,piVar2,uVar3);
|
|
|
|
param_1[1] = *puVar1;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3010 at 0x004C3010 (size: 79) ---
|
|
|
|
|
|
void FUN_004c3010(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
int iVar4;
|
|
|
|
|
|
|
|
iVar4 = param_4;
|
|
|
|
uVar1 = FUN_00403350(¶m_4,0);
|
|
|
|
FUN_005649f0(uVar1,param_2,param_3,iVar4);
|
|
|
|
puVar3 = (undefined4 *)(param_4 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(param_4 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3060 at 0x004C3060 (size: 201) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c3060(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007a6af4;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b405c;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
param_1[0x184] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b6780;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b64d8;
|
|
|
|
param_1[0x17f] = &PTR_FUN_007b64cc;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b64c4;
|
|
|
|
param_1[0x186] = 0;
|
|
|
|
param_1[0x187] = 0;
|
|
|
|
param_1[0x188] = 0;
|
|
|
|
param_1[0x185] = &PTR_FUN_007b6110;
|
|
|
|
param_1[0x18a] = 0;
|
|
|
|
param_1[0x18b] = 0;
|
|
|
|
param_1[0x18c] = 0;
|
|
|
|
param_1[0x189] = &PTR_FUN_007b6110;
|
|
|
|
param_1[0x18d] = 0;
|
|
|
|
param_1[0x18e] = 0;
|
|
|
|
param_1[399] = 0;
|
|
|
|
param_1[400] = 0;
|
|
|
|
param_1[0x191] = 0;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3160 at 0x004C3160 (size: 302) ---
|
|
|
|
|
|
void __fastcall FUN_004c3160(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
|
|
|
|
puVar3 = (undefined4 *)param_1[0x18d];
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
*param_1 = &PTR_FUN_007b6780;
|
|
|
|
*puVar1 = &PTR_FUN_007b64d8;
|
|
|
|
param_1[0x17f] = &PTR_FUN_007b64cc;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b64c4;
|
|
|
|
if (puVar3 != (undefined4 *)0x0) {
|
|
|
|
*puVar3 = &PTR_FUN_007b60f4;
|
|
|
|
operator_delete(puVar3);
|
|
|
|
}
|
|
|
|
puVar3 = (undefined4 *)param_1[0x18e];
|
|
|
|
param_1[0x18d] = 0;
|
|
|
|
if (puVar3 != (undefined4 *)0x0) {
|
|
|
|
*puVar3 = &PTR_FUN_007b60f4;
|
|
|
|
operator_delete(puVar3);
|
|
|
|
}
|
|
|
|
param_1[0x18e] = 0;
|
|
|
|
puVar3 = (undefined4 *)param_1[399];
|
|
|
|
if (puVar3 != (undefined4 *)0x0) {
|
|
|
|
*puVar3 = &PTR_FUN_007b6104;
|
|
|
|
puVar3[2] = &PTR_LAB_007b6100;
|
|
|
|
if (puVar3[3] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
*puVar3 = &PTR_FUN_007b60f4;
|
|
|
|
operator_delete(puVar3);
|
|
|
|
}
|
|
|
|
puVar3 = param_1 + 0x180;
|
|
|
|
param_1[399] = 0;
|
|
|
|
FUN_0055e1d0(puVar3);
|
|
|
|
FUN_0055f930(puVar3);
|
|
|
|
(**(code **)(*DAT_008f958c + 0x14))(param_1 + 0x17f);
|
|
|
|
FUN_00465fb0(3);
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
param_1[0x189] = &PTR_FUN_007b6110;
|
|
|
|
FUN_004c1ca0();
|
|
|
|
param_1[0x189] = &PTR_FUN_0079385c;
|
|
|
|
param_1[0x185] = &PTR_FUN_007b6110;
|
|
|
|
FUN_004c1ca0();
|
|
|
|
param_1[0x185] = &PTR_FUN_0079385c;
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c32c0 at 0x004C32C0 (size: 336) ---
|
|
|
|
|
|
void __thiscall FUN_004c32c0(int param_1,int *param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int *piVar6;
|
|
|
|
undefined4 *puVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x608) != 0) {
|
|
|
|
if ((char)param_2 == '\0') {
|
|
|
|
puVar7 = ¶m_2;
|
|
|
|
puVar4 = local_10;
|
|
|
|
puVar5 = &DAT_007b5fb8;
|
|
|
|
param_2 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007b5fb8,puVar7);
|
|
|
|
FUN_00406570(puVar4,puVar5,puVar7);
|
|
|
|
piVar2 = param_2;
|
|
|
|
uVar8 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar6 = param_2;
|
|
|
|
if (param_2 != (int *)0x0) {
|
|
|
|
(**(code **)(*param_2 + 0x10))(param_2,0);
|
|
|
|
}
|
|
|
|
FUN_004c1da0(local_c,piVar6,uVar8);
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
for (iVar1 = *(int *)(param_1 + 0x628); local_8 = piVar2, iVar1 != 0;
|
|
|
|
iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
iVar3 = FUN_005583f0(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_0058cfa0(0);
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
}
|
|
|
|
for (iVar1 = *(int *)(*(int *)(param_1 + 0x610) + 4); iVar1 != 0;
|
|
|
|
iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
iVar3 = FUN_005583f0(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if ((iVar3 != 0) && (*(int *)(iVar3 + 0xb4) == *(int *)(param_1 + 0x608))) {
|
|
|
|
(**(code **)(piVar2[2] + 0x1c))(*(undefined4 *)(iVar1 + 8));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004c1ca0();
|
|
|
|
FUN_004c1ca0();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x608) = 0;
|
|
|
|
if (*(undefined4 **)(param_1 + 0x60c) != (undefined4 *)0x0) {
|
|
|
|
(**(code **)**(undefined4 **)(param_1 + 0x60c))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = 0;
|
|
|
|
if (*(undefined4 **)(param_1 + 0x610) != (undefined4 *)0x0) {
|
|
|
|
(**(code **)**(undefined4 **)(param_1 + 0x610))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x610) = 0;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3410 at 0x004C3410 (size: 794) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c3410(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
LONG LVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
undefined4 *puVar8;
|
|
|
|
int local_bc;
|
|
|
|
int local_b8;
|
|
|
|
int local_b4;
|
|
|
|
undefined **local_b0;
|
|
|
|
undefined4 local_ac;
|
|
|
|
undefined4 local_a8;
|
|
|
|
undefined4 local_a4;
|
|
|
|
undefined1 local_a0 [4];
|
|
|
|
int local_9c;
|
|
|
|
undefined4 local_98;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar2 = FUN_005583f0(param_2);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if ((*(uint *)(iVar2 + 0xf8) == 0) || (*(uint *)(iVar2 + 0xf8) < 2)) {
|
|
|
|
local_bc = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
local_bc = FUN_00587d30(iVar2);
|
|
|
|
}
|
|
|
|
iVar3 = FUN_005d2b00(iVar2 + 0x98,local_bc);
|
|
|
|
local_b8 = iVar3;
|
|
|
|
FUN_005d2bd0(&local_b4);
|
|
|
|
if (local_b4 == DAT_00840550) {
|
|
|
|
if (*(int *)(param_1 + 0x640) < iVar3) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You don\'t have enough money");
|
|
|
|
FUN_0042cbe0(&local_bc,1);
|
|
|
|
puVar8 = (undefined4 *)(local_bc + -0x14);
|
|
|
|
LVar4 = InterlockedDecrement((LONG *)(local_bc + -0x10));
|
|
|
|
if ((LVar4 == 0) && (puVar8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar8)(1);
|
|
|
|
}
|
|
|
|
goto LAB_004c34f4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (*(int *)(*(int *)(param_1 + 0x60c) + 0x20) - *(int *)(param_1 + 0x644) < iVar3) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You don\'t have enough money");
|
|
|
|
FUN_0042cbe0(&local_bc,1);
|
|
|
|
puVar8 = (undefined4 *)(local_bc + -0x14);
|
|
|
|
LVar4 = InterlockedDecrement((LONG *)(local_bc + -0x10));
|
|
|
|
if ((LVar4 == 0) && (puVar8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar8)(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
iVar6 = FUN_005583f0(uVar5);
|
|
|
|
if ((((((*(uint *)(iVar2 + 0x100) & 0x800000) == 0) && (*(int *)(iVar2 + 200) == 0)) &&
|
|
|
|
(*(int *)(iVar2 + 0xcc) == 0)) ||
|
|
|
|
(iVar1 = *(int *)(iVar6 + 0xcc), iVar7 = FUN_0058ccf0(), iVar3 = local_b8, iVar7 != iVar1)) &&
|
|
|
|
((((*(uint *)(iVar2 + 0x100) & 0x800000) != 0 || (*(int *)(iVar2 + 200) != 0)) ||
|
|
|
|
((*(int *)(iVar2 + 0xcc) != 0 ||
|
|
|
|
(iVar2 = *(int *)(iVar6 + 200), iVar6 = FUN_0058cce0(), iVar6 != iVar2)))))) {
|
|
|
|
FUN_005d2810();
|
|
|
|
local_9c = local_bc;
|
|
|
|
local_98 = param_2;
|
|
|
|
local_b0 = &PTR_FUN_007b6110;
|
|
|
|
local_ac = 0;
|
|
|
|
local_a8 = 0;
|
|
|
|
local_a4 = 0;
|
|
|
|
FUN_004c14c0(local_a0);
|
|
|
|
if (local_b4 != DAT_00840550) {
|
|
|
|
*(int *)(param_1 + 0x644) = iVar3;
|
|
|
|
}
|
|
|
|
puVar8 = (undefined4 *)FUN_005d2bd0(&local_b8);
|
|
|
|
uVar5 = *(undefined4 *)(param_1 + 0x608);
|
|
|
|
FUN_006ab050(uVar5,&local_b0,*puVar8);
|
|
|
|
FUN_0058d050(uVar5,10);
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00565610();
|
|
|
|
local_b0 = &PTR_FUN_007b6110;
|
|
|
|
FUN_004c1ca0();
|
|
|
|
local_b0 = &PTR_FUN_0079385c;
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You must empty some slots in your backpack first");
|
|
|
|
FUN_0042cbe0(&local_bc,1);
|
|
|
|
puVar8 = (undefined4 *)(local_bc + -0x14);
|
|
|
|
LVar4 = InterlockedDecrement((LONG *)(local_bc + -0x10));
|
|
|
|
if ((LVar4 == 0) && (puVar8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar8)(1);
|
|
|
|
}
|
|
|
|
LAB_004c34f4:
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3730 at 0x004C3730 (size: 443) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c3730(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
LONG LVar4;
|
|
|
|
int local_b4;
|
|
|
|
undefined **local_b0;
|
|
|
|
undefined4 local_ac;
|
|
|
|
undefined4 local_a8;
|
|
|
|
undefined4 local_a4;
|
|
|
|
undefined1 local_a0 [4];
|
|
|
|
undefined4 local_9c;
|
|
|
|
undefined4 local_98;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar2 = FUN_005583f0(param_2);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (((((*(uint *)(iVar2 + 0x100) & 0x800000) == 0) && (*(int *)(iVar2 + 200) == 0)) &&
|
|
|
|
(*(int *)(iVar2 + 0xcc) == 0)) ||
|
|
|
|
((iVar3 = FUN_0058cce0(), iVar3 == 0 && (iVar3 = FUN_0058ccf0(), iVar3 == 0)))) {
|
|
|
|
if (((*(uint *)(iVar2 + 0xf8) == 0) || (*(uint *)(iVar2 + 0xf8) < 2)) ||
|
|
|
|
(DAT_0081d7f0 <= DAT_0081d7ec)) {
|
|
|
|
FUN_005d2810();
|
|
|
|
local_98 = param_2;
|
|
|
|
local_9c = 1;
|
|
|
|
local_b0 = &PTR_FUN_007b6110;
|
|
|
|
local_ac = 0;
|
|
|
|
local_a8 = 0;
|
|
|
|
local_a4 = 0;
|
|
|
|
FUN_004c14c0(local_a0);
|
|
|
|
*(undefined4 *)(param_1 + 0x644) = 0;
|
|
|
|
FUN_005d2bd0(&local_b4);
|
|
|
|
uVar1 = *(undefined4 *)(param_1 + 0x608);
|
|
|
|
FUN_006aaf60(uVar1,&local_b0);
|
|
|
|
FUN_0058d050(uVar1,10);
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00565610();
|
|
|
|
local_b0 = &PTR_FUN_007b6110;
|
|
|
|
FUN_004c1ca0();
|
|
|
|
local_b0 = &PTR_FUN_0079385c;
|
|
|
|
FUN_005d2830();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"Cannot sell part of a stack");
|
|
|
|
FUN_0042cbe0(&local_b4,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"Cannot sell container that isn\'t empty");
|
|
|
|
FUN_0042cbe0(&local_b4,1);
|
|
|
|
LVar4 = InterlockedDecrement((LONG *)(local_b4 + -0x10));
|
|
|
|
if ((LVar4 == 0) && ((undefined4 *)(local_b4 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_b4 + -0x14))(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c38f0 at 0x004C38F0 (size: 395) ---
|
|
|
|
|
|
void FUN_004c38f0(int param_1,int param_2,char param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
uint uVar4;
|
|
|
|
int local_c;
|
|
|
|
int local_8;
|
|
|
|
|
|
|
|
FUN_004e49f0();
|
|
|
|
FUN_005d2810();
|
|
|
|
for (iVar1 = *(int *)(param_2 + 4); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
FUN_005d2770(iVar1);
|
|
|
|
if (param_3 == '\0') {
|
|
|
|
LAB_004c39f4:
|
|
|
|
iVar2 = 0;
|
|
|
|
if (0 < local_c) {
|
|
|
|
do {
|
|
|
|
if (param_1 != 0) {
|
|
|
|
FUN_005583f0(local_8);
|
|
|
|
iVar3 = FUN_0058cce0();
|
|
|
|
if ((iVar3 == 0) && (iVar3 = FUN_0058ccf0(), iVar3 == 0)) {
|
|
|
|
if (*(int *)(param_1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(local_8,0xffffffff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar2 = iVar2 + 1;
|
|
|
|
} while (iVar2 < local_c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = FUN_005583f0(local_8);
|
|
|
|
if (*(uint *)(iVar2 + 0xfc) < 2) goto LAB_004c39f4;
|
|
|
|
uVar4 = 1;
|
|
|
|
if (*(uint *)(iVar2 + 0xf8) != 0) {
|
|
|
|
uVar4 = *(uint *)(iVar2 + 0xf8);
|
|
|
|
}
|
|
|
|
*(int *)(iVar2 + 0xf8) = local_c;
|
|
|
|
*(uint *)(iVar2 + 0xd4) = (*(uint *)(iVar2 + 0xd4) / uVar4) * local_c;
|
|
|
|
if (DAT_00871e54 == local_8) {
|
|
|
|
thunk_FUN_00693810(local_8,0);
|
|
|
|
}
|
|
|
|
if (param_1 != 0) {
|
|
|
|
FUN_005583f0(local_8);
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if ((iVar2 == 0) && (iVar2 = FUN_0058ccf0(), iVar2 == 0)) {
|
|
|
|
if (*(int *)(param_1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(local_8,0xffffffff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (iVar1 == 0) break;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3a80 at 0x004C3A80 (size: 281) ---
|
|
|
|
|
|
void FUN_004c3a80(int param_1,int *param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 *local_4;
|
|
|
|
|
|
|
|
local_4 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
FUN_0055e1d0();
|
|
|
|
FUN_0055e220();
|
|
|
|
FUN_00586ec0(param_1,&local_4);
|
|
|
|
if (*(int *)(*param_2 + -4) == 1) {
|
|
|
|
FUN_00401340("There was not enough: ");
|
|
|
|
if (*(int *)(param_1 + -4) != 1) {
|
|
|
|
FUN_00404ef0(param_1,*(int *)(param_1 + -4) + -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_00401340(&DAT_00795334);
|
|
|
|
if (*(int *)(param_1 + -4) != 1) {
|
|
|
|
FUN_00404ef0(param_1,*(int *)(param_1 + -4) + -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(param_1 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(param_1 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(param_1 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00401340(local_4 + 5);
|
|
|
|
if (*(int *)(param_1 + -4) != 1) {
|
|
|
|
FUN_00404ef0(param_1,*(int *)(param_1 + -4) + -1);
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(param_1 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(param_1 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(param_1 + -0x14))(1);
|
|
|
|
}
|
|
|
|
puVar1 = local_4;
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar1 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar1)(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3ba0 at 0x004C3BA0 (size: 35) ---
|
|
|
|
|
|
void __fastcall FUN_004c3ba0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c38f0(*(undefined4 *)(param_1 + 0xc),*(int *)(param_1 + 4) + 0x624,0);
|
|
|
|
FUN_004c1ab0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3bd0 at 0x004C3BD0 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004c3bd0(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c3160();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3bf0 at 0x004C3BF0 (size: 19) ---
|
|
|
|
|
|
void FUN_004c3bf0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000017,&LAB_004c3290);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3c10 at 0x004C3C10 (size: 88) ---
|
|
|
|
|
|
void __thiscall FUN_004c3c10(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if ((char)param_2 == '\0') {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x634) + 4))();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x63c) + 4))();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x638) + 4))();
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1 + 0x608);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
param_1 = param_1 + 0x600;
|
|
|
|
FUN_0055e1d0(param_1,iVar1);
|
|
|
|
FUN_0055f900(param_1,iVar1);
|
|
|
|
}
|
|
|
|
FUN_004c32c0(param_2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3d40 at 0x004C3D40 (size: 631) ---
|
|
|
|
|
|
void __fastcall FUN_004c3d40(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG *lpAddend;
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
wchar_t *pwVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
char *pcVar6;
|
|
|
|
int iVar7;
|
|
|
|
int iVar8;
|
|
|
|
undefined4 *puVar9;
|
|
|
|
undefined4 *puVar10;
|
|
|
|
int iVar11;
|
|
|
|
undefined4 *puStack_10;
|
|
|
|
undefined4 *local_c;
|
|
|
|
int local_8;
|
|
|
|
int iStack_4;
|
|
|
|
|
|
|
|
puVar9 = (undefined4 *)0x0;
|
|
|
|
*(undefined4 *)(param_1 + 0x24) = 0;
|
|
|
|
iVar11 = 0;
|
|
|
|
local_c = (undefined4 *)0x0;
|
|
|
|
puVar10 = local_c;
|
|
|
|
if (0 < *(int *)(*(int *)(param_1 + 8) + 0x610)) {
|
|
|
|
do {
|
|
|
|
piVar1 = (int *)FUN_0046dc50(iVar11);
|
|
|
|
if ((((piVar1 != (int *)0x0) &&
|
|
|
|
(iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032), iVar2 != 0)) &&
|
|
|
|
(*(int *)(iVar2 + 0x5fc) != 0)) &&
|
|
|
|
(iVar2 = FUN_005583f0(*(int *)(iVar2 + 0x5fc)), iVar2 != 0)) {
|
|
|
|
iVar8 = *(int *)(iVar2 + 0xf8);
|
|
|
|
iVar7 = iVar8;
|
|
|
|
if (iVar8 == 0) {
|
|
|
|
iVar7 = 1;
|
|
|
|
}
|
|
|
|
puVar9 = (undefined4 *)((int)puVar9 + iVar7);
|
|
|
|
if (iVar8 == 0) {
|
|
|
|
iVar8 = 1;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005d2b00(iVar2 + 0x98,iVar8);
|
|
|
|
*(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + iVar2;
|
|
|
|
}
|
|
|
|
iVar11 = iVar11 + 1;
|
|
|
|
puVar10 = puVar9;
|
|
|
|
} while (iVar11 < *(int *)(*(int *)(param_1 + 8) + 0x610));
|
|
|
|
}
|
|
|
|
local_c = puVar10;
|
|
|
|
puVar9 = local_c;
|
|
|
|
FUN_005d2bd0(&local_8);
|
|
|
|
puVar10 = DAT_008ef11c;
|
|
|
|
if (local_8 == DAT_00840550) {
|
|
|
|
lpAddend = DAT_008ef11c + 1;
|
|
|
|
puStack_10 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
iStack_4 = *(int *)(param_1 + 0x24);
|
|
|
|
if (puVar10 != DAT_008ef11c) {
|
|
|
|
LVar3 = InterlockedDecrement(lpAddend);
|
|
|
|
if ((LVar3 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
puStack_10 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(iStack_4);
|
|
|
|
FUN_004ac880();
|
|
|
|
pwVar4 = L"item";
|
|
|
|
if (local_c != (undefined4 *)0x1) {
|
|
|
|
pwVar4 = L"items";
|
|
|
|
}
|
|
|
|
uVar5 = FUN_00480980(&iStack_4,0,L"Buying %d %s worth %hsp",local_c,pwVar4,puStack_10 + 5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
puVar10 = (undefined4 *)(iStack_4 + -0x14);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(iStack_4 + -0x10));
|
|
|
|
if ((LVar3 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
LVar3 = InterlockedDecrement(puStack_10 + 1);
|
|
|
|
if ((LVar3 == 0) && (puStack_10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_10)(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
puVar10 = *(undefined4 **)(*(int *)(*(int *)(param_1 + 4) + 0x60c) + 0x24);
|
|
|
|
InterlockedIncrement(puVar10 + 1);
|
|
|
|
local_c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
pcVar6 = "item";
|
|
|
|
if (puVar9 != (undefined4 *)0x1) {
|
|
|
|
pcVar6 = "items";
|
|
|
|
}
|
|
|
|
FUN_00487620(&local_c,"Buying %d %s worth %d %s.",puVar9,pcVar6,*(undefined4 *)(param_1 + 0x24),
|
|
|
|
puVar10 + 5);
|
|
|
|
puVar9 = local_c;
|
|
|
|
uVar5 = FUN_00480980(&iStack_4,0,&DAT_007a0440,local_c + 5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(iStack_4 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(iStack_4 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(iStack_4 + -0x14))(1);
|
|
|
|
}
|
|
|
|
LVar3 = InterlockedDecrement(puVar9 + 1);
|
|
|
|
if ((LVar3 == 0) && (puVar9 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar9)(1);
|
|
|
|
}
|
|
|
|
LVar3 = InterlockedDecrement(puVar10 + 1);
|
|
|
|
if ((LVar3 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c3fc0 at 0x004C3FC0 (size: 476) ---
|
|
|
|
|
|
void __fastcall FUN_004c3fc0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG *lpAddend;
|
|
|
|
undefined4 *puVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
undefined4 *puVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
undefined4 *local_c;
|
|
|
|
undefined4 *local_8;
|
|
|
|
int local_4;
|
|
|
|
|
|
|
|
local_8 = DAT_00840550;
|
|
|
|
if (*(int *)(*(int *)(param_1 + 4) + 0x60c) != 0) {
|
|
|
|
local_8 = (undefined4 *)FUN_005d2bd0(&local_4);
|
|
|
|
local_8 = (undefined4 *)*local_8;
|
|
|
|
}
|
|
|
|
puVar4 = DAT_008ef11c;
|
|
|
|
lpAddend = DAT_008ef11c + 1;
|
|
|
|
local_c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
local_4 = *(int *)(*(int *)(param_1 + 4) + 0x640);
|
|
|
|
if (puVar4 != DAT_008ef11c) {
|
|
|
|
LVar2 = InterlockedDecrement(lpAddend);
|
|
|
|
if ((LVar2 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
local_c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(local_4);
|
|
|
|
FUN_004ac880();
|
|
|
|
if (local_8 == DAT_00840550) {
|
|
|
|
uVar3 = FUN_00480980(&local_4,0,L"You have %hsp",local_c + 5);
|
|
|
|
FUN_0046a740(uVar3);
|
|
|
|
puVar4 = (undefined4 *)(local_4 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
puVar4 = *(undefined4 **)(*(int *)(*(int *)(param_1 + 4) + 0x60c) + 0x24);
|
|
|
|
InterlockedIncrement(puVar4 + 1);
|
|
|
|
local_8 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
FUN_00487620(&local_8,"You have %d %s.",
|
|
|
|
*(int *)(*(int *)(*(int *)(param_1 + 4) + 0x60c) + 0x20) -
|
|
|
|
*(int *)(*(int *)(param_1 + 4) + 0x644),puVar4 + 5);
|
|
|
|
puVar1 = local_8;
|
|
|
|
uVar3 = FUN_00480980(&local_4,0,&DAT_007a0440,local_8 + 5);
|
|
|
|
FUN_0046a740(uVar3);
|
|
|
|
puVar5 = (undefined4 *)(local_4 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (puVar5 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar5)(1);
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement(puVar1 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar1 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar1)(1);
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement(puVar4 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement(local_c + 1);
|
|
|
|
if ((LVar2 == 0) && (local_c != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*local_c)(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c41a0 at 0x004C41A0 (size: 409) ---
|
|
|
|
|
|
void __fastcall FUN_004c41a0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG *lpAddend;
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
LONG LVar4;
|
|
|
|
wchar_t *pwVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
int iVar7;
|
|
|
|
int iVar8;
|
|
|
|
undefined4 *puVar9;
|
|
|
|
int iVar10;
|
|
|
|
undefined4 *local_c;
|
|
|
|
int local_8;
|
|
|
|
int iStack_4;
|
|
|
|
|
|
|
|
iVar10 = 0;
|
|
|
|
*(undefined4 *)(param_1 + 0x28) = 0;
|
|
|
|
iVar8 = 0;
|
|
|
|
local_8 = 0;
|
|
|
|
iVar1 = FUN_005583f0(*(undefined4 *)(*(int *)(param_1 + 4) + 0x608));
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
if (0 < *(int *)(*(int *)(param_1 + 0xc) + 0x610)) {
|
|
|
|
do {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar10);
|
|
|
|
if ((((piVar2 != (int *)0x0) &&
|
|
|
|
(iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0)) &&
|
|
|
|
(*(int *)(iVar3 + 0x5fc) != 0)) &&
|
|
|
|
(iVar3 = FUN_005583f0(*(int *)(iVar3 + 0x5fc)), iVar3 != 0)) {
|
|
|
|
iVar7 = *(int *)(iVar3 + 0xf8);
|
|
|
|
if (iVar7 == 0) {
|
|
|
|
iVar7 = 1;
|
|
|
|
}
|
|
|
|
iVar8 = iVar8 + iVar7;
|
|
|
|
iVar3 = FUN_005d2b70(iVar1 + 0x98,iVar3 + 0x98);
|
|
|
|
*(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + iVar3;
|
|
|
|
}
|
|
|
|
iVar10 = iVar10 + 1;
|
|
|
|
local_8 = iVar8;
|
|
|
|
} while (iVar10 < *(int *)(*(int *)(param_1 + 0xc) + 0x610));
|
|
|
|
}
|
|
|
|
puVar9 = DAT_008ef11c;
|
|
|
|
lpAddend = DAT_008ef11c + 1;
|
|
|
|
local_c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
iStack_4 = *(int *)(param_1 + 0x28);
|
|
|
|
if (puVar9 != DAT_008ef11c) {
|
|
|
|
LVar4 = InterlockedDecrement(lpAddend);
|
|
|
|
if ((LVar4 == 0) && (puVar9 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar9)(1);
|
|
|
|
}
|
|
|
|
local_c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(iStack_4);
|
|
|
|
FUN_004ac880();
|
|
|
|
pwVar5 = L"item";
|
|
|
|
if (local_8 != 1) {
|
|
|
|
pwVar5 = L"items";
|
|
|
|
}
|
|
|
|
uVar6 = FUN_00480980(&iStack_4,0,L"Selling %d %s worth %hsp",local_8,pwVar5,local_c + 5);
|
|
|
|
FUN_0046a740(uVar6);
|
|
|
|
puVar9 = (undefined4 *)(iStack_4 + -0x14);
|
|
|
|
LVar4 = InterlockedDecrement((LONG *)(iStack_4 + -0x10));
|
|
|
|
if ((LVar4 == 0) && (puVar9 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar9)(1);
|
|
|
|
}
|
|
|
|
LVar4 = InterlockedDecrement(local_c + 1);
|
|
|
|
if ((LVar4 == 0) && (local_c != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*local_c)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4340 at 0x004C4340 (size: 205) ---
|
|
|
|
|
|
void __fastcall FUN_004c4340(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG *lpAddend;
|
|
|
|
undefined4 *puVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
undefined4 *puVar4;
|
|
|
|
undefined4 *local_4;
|
|
|
|
|
|
|
|
puVar1 = DAT_008ef11c;
|
|
|
|
lpAddend = DAT_008ef11c + 1;
|
|
|
|
local_4 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
uVar3 = *(undefined4 *)(*(int *)(param_1 + 4) + 0x640);
|
|
|
|
if (puVar1 != DAT_008ef11c) {
|
|
|
|
LVar2 = InterlockedDecrement(lpAddend);
|
|
|
|
if ((LVar2 == 0) && (puVar1 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar1)(1);
|
|
|
|
}
|
|
|
|
local_4 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(uVar3);
|
|
|
|
FUN_004ac880();
|
|
|
|
puVar1 = local_4;
|
|
|
|
uVar3 = FUN_00480980(&local_4,0,L"You have %hsp",local_4 + 5);
|
|
|
|
FUN_0046a740(uVar3);
|
|
|
|
puVar4 = local_4 + -5;
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + -4);
|
|
|
|
if ((LVar2 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement(puVar1 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar1 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar1)(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4410 at 0x004C4410 (size: 182) ---
|
|
|
|
|
|
void __thiscall FUN_004c4410(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
|
|
|
|
FUN_00463830(param_2);
|
|
|
|
if (((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) && ((char)param_2 == '\0')) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x634) + 4))();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x63c) + 4))();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x638) + 4))();
|
|
|
|
iVar3 = *(int *)(param_1 + 0x608);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
iVar2 = param_1 + 0x600;
|
|
|
|
FUN_0055e1d0(iVar2,iVar3);
|
|
|
|
FUN_0055f900(iVar2,iVar3);
|
|
|
|
}
|
|
|
|
FUN_004c32c0(0);
|
|
|
|
uVar4 = 0;
|
|
|
|
FUN_00564d30(0);
|
|
|
|
FUN_00564e10(uVar4);
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
(**(code **)(*piVar1 + 8))(0x4dd264,param_1 + 0x5f8);
|
|
|
|
if (DAT_00840534 != 0) {
|
|
|
|
FUN_00478560(DAT_00840534);
|
|
|
|
DAT_00840534 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c44d0 at 0x004C44D0 (size: 1010) ---
|
|
|
|
|
|
void __fastcall FUN_004c44d0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
uint uVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
LONG LVar6;
|
|
|
|
wchar_t *pwVar7;
|
|
|
|
undefined4 *puVar8;
|
|
|
|
int iVar9;
|
|
|
|
undefined4 *puVar10;
|
|
|
|
undefined4 *puStack_24;
|
|
|
|
undefined4 *puStack_20;
|
|
|
|
undefined4 *puStack_1c;
|
|
|
|
int iStack_18;
|
|
|
|
int aiStack_14 [5];
|
|
|
|
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar3 = DAT_00871e54;
|
|
|
|
if ((DAT_00871e54 != 0) && (iVar9 = 0, 0 < *(int *)(*(int *)(param_1 + 8) + 0x610))) {
|
|
|
|
do {
|
|
|
|
piVar1 = (int *)FUN_0046dc50(iVar9);
|
|
|
|
if ((piVar1 != (int *)0x0) &&
|
|
|
|
((iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032), iVar2 != 0 &&
|
|
|
|
(*(int *)(iVar2 + 0x5fc) == iVar3)))) {
|
|
|
|
iVar3 = FUN_005583f0(iVar3);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
uVar4 = FUN_00587d30(iVar3);
|
|
|
|
if (uVar4 < 2) {
|
|
|
|
uVar5 = FUN_0058f510(0,0);
|
|
|
|
uVar5 = FUN_00404a40(0,uVar5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = FUN_0058f510(1,0);
|
|
|
|
uVar5 = FUN_00587d30(iVar3,uVar5);
|
|
|
|
uVar5 = FUN_00480980(&iStack_18,0,L"%d %hs",uVar5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
}
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(iStack_18 + -0x10));
|
|
|
|
if ((LVar6 == 0) && ((undefined4 *)(iStack_18 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(iStack_18 + -0x14))(1);
|
|
|
|
}
|
|
|
|
puVar10 = DAT_008ef11c;
|
|
|
|
puStack_20 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
iStack_18 = *(int *)(*(int *)(param_1 + 4) + 0x60c);
|
|
|
|
uVar5 = FUN_00587d30(iVar3);
|
|
|
|
iStack_18 = FUN_005d2b00(iVar3 + 0x98,uVar5);
|
|
|
|
if (puVar10 != DAT_008ef11c) {
|
|
|
|
LVar6 = InterlockedDecrement(puVar10 + 1);
|
|
|
|
if ((LVar6 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
puStack_20 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(iStack_18);
|
|
|
|
FUN_004ac880();
|
|
|
|
puVar10 = DAT_008ef11c;
|
|
|
|
puStack_24 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
puStack_1c = *(undefined4 **)(*(int *)(param_1 + 4) + 0x640);
|
|
|
|
if (puVar10 != DAT_008ef11c) {
|
|
|
|
LVar6 = InterlockedDecrement(puVar10 + 1);
|
|
|
|
if ((LVar6 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
puStack_24 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
}
|
|
|
|
FUN_004ac810(puStack_1c);
|
|
|
|
FUN_004ac880();
|
|
|
|
FUN_005d2bd0(aiStack_14);
|
|
|
|
if (aiStack_14[0] == DAT_00840550) {
|
|
|
|
uVar4 = FUN_00587d30(iVar3);
|
|
|
|
pwVar7 = L"cost";
|
|
|
|
if (uVar4 < 2) {
|
|
|
|
pwVar7 = L"costs";
|
|
|
|
}
|
|
|
|
uVar5 = FUN_00480980(&iStack_18,0,L"%s %hsp (you have %hsp)",pwVar7,puStack_20 + 5,
|
|
|
|
puStack_24 + 5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
puVar10 = (undefined4 *)(iStack_18 + -0x14);
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(iStack_18 + -0x10));
|
|
|
|
if ((LVar6 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
puVar10 = *(undefined4 **)(*(int *)(*(int *)(param_1 + 4) + 0x60c) + 0x24);
|
|
|
|
InterlockedIncrement(puVar10 + 1);
|
|
|
|
puStack_1c = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
FUN_00487620(&puStack_1c,"This item costs %d %s. You have %d %s.",iStack_18,puVar10 + 5,
|
|
|
|
*(int *)(*(int *)(*(int *)(param_1 + 4) + 0x60c) + 0x20) -
|
|
|
|
*(int *)(*(int *)(param_1 + 4) + 0x644),puVar10 + 5);
|
|
|
|
uVar5 = FUN_00480980(&iStack_18,0,&DAT_007a0440,puStack_1c + 5);
|
|
|
|
FUN_0046a740(uVar5);
|
|
|
|
puVar8 = (undefined4 *)(iStack_18 + -0x14);
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(iStack_18 + -0x10));
|
|
|
|
if ((LVar6 == 0) && (puVar8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar8)(1);
|
|
|
|
}
|
|
|
|
puVar8 = puStack_1c;
|
|
|
|
LVar6 = InterlockedDecrement(puStack_1c + 1);
|
|
|
|
if ((LVar6 == 0) && (puVar8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar8)(1);
|
|
|
|
}
|
|
|
|
LVar6 = InterlockedDecrement(puVar10 + 1);
|
|
|
|
if ((LVar6 == 0) && (puVar10 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar10)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x18) + 0x9c))(1);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x1c) + 0x9c))(1);
|
|
|
|
LVar6 = InterlockedDecrement(puStack_24 + 1);
|
|
|
|
if ((LVar6 == 0) && (puStack_24 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_24)(1);
|
|
|
|
}
|
|
|
|
LVar6 = InterlockedDecrement(puStack_20 + 1);
|
|
|
|
if ((LVar6 == 0) && (puStack_20 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_20)(1);
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
goto LAB_004c455d;
|
|
|
|
}
|
|
|
|
iVar9 = iVar9 + 1;
|
|
|
|
} while (iVar9 < *(int *)(*(int *)(param_1 + 8) + 0x610));
|
|
|
|
}
|
|
|
|
FUN_00467ae0();
|
|
|
|
FUN_00467ae0();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x18) + 0x9c))(0xd);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x1c) + 0x9c))(0xd);
|
|
|
|
LAB_004c455d:
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c48d0 at 0x004C48D0 (size: 222) ---
|
|
|
|
|
|
void __thiscall FUN_004c48d0(int param_1,int param_2,int param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
uint uVar2;
|
|
|
|
uint uVar3;
|
|
|
|
int local_c;
|
|
|
|
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar1 = *(int *)(*(int *)(*(int *)(param_1 + 4) + 0x610) + 4);
|
|
|
|
do {
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
LAB_004c490f:
|
|
|
|
if (local_c != -1) {
|
|
|
|
uVar2 = local_c - param_3;
|
|
|
|
if ((int)uVar2 < 1) {
|
|
|
|
FUN_004c0fc0(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_2 + 8),1);
|
|
|
|
FUN_0058d110(0,0);
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
uVar3 = *(uint *)(param_2 + 0xfc);
|
|
|
|
if (1 < uVar3) {
|
|
|
|
if ((int)uVar3 < (int)uVar2) {
|
|
|
|
uVar2 = uVar3;
|
|
|
|
}
|
|
|
|
uVar3 = *(uint *)(param_2 + 0xf8);
|
|
|
|
if (uVar3 == 0) {
|
|
|
|
uVar3 = 1;
|
|
|
|
}
|
|
|
|
if (uVar3 != uVar2) {
|
|
|
|
FUN_004c1110(param_2,uVar2);
|
|
|
|
if (DAT_00871e54 == *(int *)(param_2 + 8)) {
|
|
|
|
thunk_FUN_00693810(*(int *)(param_2 + 8),0);
|
|
|
|
}
|
|
|
|
FUN_004c44d0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(int *)(iVar1 + 8) == *(int *)(param_2 + 8)) {
|
|
|
|
FUN_005d2770(iVar1);
|
|
|
|
goto LAB_004c490f;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(iVar1 + 0x10);
|
|
|
|
} while( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c49b0 at 0x004C49B0 (size: 427) ---
|
|
|
|
|
|
void __thiscall FUN_004c49b0(int param_1,int param_2,int param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
size_t sVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
wchar_t *local_a4;
|
|
|
|
undefined1 local_a0 [4];
|
|
|
|
int local_9c;
|
|
|
|
int local_98;
|
|
|
|
undefined4 local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar5 = 0;
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar4 = *(int *)(*(int *)(param_1 + 4) + 0x618);
|
|
|
|
joined_r0x004c49d1:
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
FUN_005d2770(iVar4);
|
|
|
|
if (local_98 == *(int *)(param_2 + 8)) {
|
|
|
|
param_3 = param_3 + local_9c;
|
|
|
|
if (param_3 < 0x1389) {
|
|
|
|
iVar4 = *(int *)(*(int *)(param_1 + 4) + 0x618);
|
|
|
|
if (0 < iVar5) {
|
|
|
|
do {
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
iVar4 = *(int *)(iVar4 + 0x10);
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + -1;
|
|
|
|
} while (iVar5 != 0);
|
|
|
|
}
|
|
|
|
local_9c = param_3;
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
FUN_005d2770(local_a0);
|
|
|
|
param_3 = local_9c;
|
|
|
|
}
|
|
|
|
goto LAB_004c4b36;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
sVar2 = wcslen(L"I can\'t possibly sell you that much! Please be a little more reasonable.");
|
|
|
|
FUN_004022d0(sVar2);
|
|
|
|
wcscpy(local_a4,L"I can\'t possibly sell you that much! Please be a little more reasonable.");
|
|
|
|
FUN_0042cbe0(&local_a4,1);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_a4 + -8));
|
|
|
|
if ((LVar3 == 0) && (local_a4 + -10 != (wchar_t *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_a4 + -10))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
goto LAB_004c4b46;
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
if (iVar4 != 0) goto code_r0x004c49f2;
|
|
|
|
}
|
|
|
|
local_98 = *(int *)(param_2 + 8);
|
|
|
|
iVar4 = *(int *)(param_1 + 4);
|
|
|
|
local_9c = param_3;
|
|
|
|
local_94 = 0;
|
|
|
|
iVar5 = FUN_005df0f5(0x18);
|
|
|
|
if (iVar5 == 0) {
|
|
|
|
iVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2860(local_a0);
|
|
|
|
*(undefined4 *)(iVar5 + 0x10) = 0;
|
|
|
|
*(undefined4 *)(iVar5 + 0x14) = 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(iVar4 + 0x618) == 0) {
|
|
|
|
*(int *)(iVar4 + 0x618) = iVar5;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = *(int *)(iVar4 + 0x61c);
|
|
|
|
*(int *)(iVar1 + 0x10) = iVar5;
|
|
|
|
*(int *)(iVar5 + 0x14) = iVar1;
|
|
|
|
}
|
|
|
|
*(int *)(iVar4 + 0x620) = *(int *)(iVar4 + 0x620) + 1;
|
|
|
|
*(int *)(iVar4 + 0x61c) = iVar5;
|
|
|
|
LAB_004c4b36:
|
|
|
|
FUN_004c48d0(param_2,param_3);
|
|
|
|
LAB_004c4b46:
|
|
|
|
FUN_005d2830();
|
|
|
|
return;
|
|
|
|
code_r0x004c49f2:
|
|
|
|
iVar4 = *(int *)(iVar4 + 0x10);
|
|
|
|
goto joined_r0x004c49d1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4b60 at 0x004C4B60 (size: 46) ---
|
|
|
|
|
|
void __fastcall FUN_004c4b60(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c38f0(*(undefined4 *)(param_1 + 8),*(int *)(param_1 + 4) + 0x614,1);
|
|
|
|
FUN_004c1a00();
|
|
|
|
FUN_004c3d40();
|
|
|
|
FUN_004c3fc0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4b90 at 0x004C4B90 (size: 46) ---
|
|
|
|
|
|
void __fastcall FUN_004c4b90(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c38f0(*(undefined4 *)(param_1 + 0xc),*(int *)(param_1 + 4) + 0x624,1);
|
|
|
|
FUN_004c1ab0();
|
|
|
|
FUN_004c41a0();
|
|
|
|
FUN_004c4340();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4bc0 at 0x004C4BC0 (size: 244) ---
|
|
|
|
|
|
void __thiscall FUN_004c4bc0(int param_1,undefined4 param_2,byte param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
if ((((*(int *)(param_1 + 0x2c) != 0) && ((param_3 & 1) != 0)) &&
|
|
|
|
(iVar1 = FUN_005583f0(param_2), iVar1 != 0)) &&
|
|
|
|
(*(int *)(iVar1 + 0xa4) == *(int *)(param_1 + 0x30))) {
|
|
|
|
iVar1 = *(int *)(iVar1 + 0xf8);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
iVar1 = 1;
|
|
|
|
}
|
|
|
|
if ((short)iVar1 == *(short *)(param_1 + 0x34)) {
|
|
|
|
iVar1 = *(int *)(param_1 + 0xc);
|
|
|
|
uVar2 = FUN_00480780(*(undefined4 *)(param_1 + 0x2c));
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_005583f0(param_2);
|
|
|
|
iVar3 = FUN_0058cce0();
|
|
|
|
if ((iVar3 == 0) && (iVar3 = FUN_0058ccf0(), iVar3 == 0)) {
|
|
|
|
if (*(int *)(iVar1 + 0x2e4) == 0x100000ce) {
|
|
|
|
FUN_0058cfa0(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(param_2,uVar2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004c0fc0(*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(*(int *)(param_1 + 0x2c) + 0x5fc),
|
|
|
|
1);
|
|
|
|
*(undefined4 *)(param_1 + 0x2c) = 0;
|
|
|
|
FUN_004c1f00(*(undefined4 *)(param_1 + 0xc),*(int *)(param_1 + 4) + 0x624,0,1);
|
|
|
|
FUN_004c4b90();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c4cc0 at 0x004C4CC0 (size: 688) ---
|
|
|
|
|
|
void __thiscall FUN_004c4cc0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
undefined1 auStack_98 [4];
|
|
|
|
undefined1 auStack_94 [148];
|
|
|
|
|
|
|
|
iVar3 = *(int *)(*(int *)(param_1 + 0x634) + 8);
|
|
|
|
if ((iVar3 == 0) || (cVar1 = FUN_0045fbb0(iVar3), cVar1 == '\0')) {
|
|
|
|
iVar3 = *(int *)(*(int *)(param_1 + 0x638) + 8);
|
|
|
|
if ((iVar3 == 0) || (cVar1 = FUN_0045fbb0(iVar3), cVar1 == '\0')) {
|
|
|
|
iVar3 = *(int *)(*(int *)(param_1 + 0x63c) + 0xc);
|
|
|
|
if (((iVar3 != 0) &&
|
|
|
|
((cVar1 = FUN_0045fbb0(iVar3), cVar1 != '\0' &&
|
|
|
|
(piVar2 = (int *)FUN_0046e5e0(), piVar2 != (int *)0x0)))) &&
|
|
|
|
((iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0 &&
|
|
|
|
((*(int *)(param_2 + 0xc) == 10 && (*(int *)(iVar3 + 0x5fc) != 0)))))) {
|
|
|
|
iVar4 = FUN_005583f0(*(int *)(iVar3 + 0x5fc));
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
puVar5 = (undefined4 *)FUN_0058f8b0(auStack_98,2,0);
|
|
|
|
FUN_00480980(&stack0xffffff64,0,L"Removing %s from shopping list",*puVar5);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&stack0xffffff64,1);
|
|
|
|
FUN_00693500(0x1a,auStack_94);
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
FUN_004c0fa0(*(undefined4 *)(iVar3 + 0x5fc),0);
|
|
|
|
FUN_004c1e50(param_1 + 0x624,*(undefined4 *)(iVar3 + 0x5fc),0xffffffff);
|
|
|
|
FUN_004c4b90();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = (int *)FUN_0046e5e0();
|
|
|
|
if ((((piVar2 != (int *)0x0) &&
|
|
|
|
(iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0)) &&
|
|
|
|
(*(int *)(param_2 + 0xc) == 10)) && (*(int *)(iVar3 + 0x5fc) != 0)) {
|
|
|
|
iVar4 = FUN_005583f0(*(int *)(iVar3 + 0x5fc));
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
puVar5 = (undefined4 *)FUN_0058f8b0(auStack_98,2,0);
|
|
|
|
FUN_00480980(&stack0xffffff64,0,L"Removing %s from shopping list",*puVar5);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&stack0xffffff64,1);
|
|
|
|
FUN_00693500(0x1a,auStack_94);
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
FUN_004c1e50(param_1 + 0x614,*(undefined4 *)(iVar3 + 0x5fc),1);
|
|
|
|
FUN_004c4b60();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = (int *)FUN_0046e5e0();
|
|
|
|
if ((piVar2 != (int *)0x0) &&
|
|
|
|
(((iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0 &&
|
|
|
|
(*(int *)(param_2 + 0xc) == 10)) && (*(int *)(iVar3 + 0x5fc) != 0)))) {
|
|
|
|
FUN_004c3410(*(int *)(iVar3 + 0x5fc));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5090 at 0x004C5090 (size: 79) ---
|
|
|
|
|
|
void __thiscall FUN_004c5090(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
iVar1 = FUN_004e3b60(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar1 = FUN_0058df90();
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
FUN_004c1e50(param_1 + 0x2c,param_2,0xffffffff);
|
|
|
|
FUN_004c4b90();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c50f0 at 0x004C50F0 (size: 60) ---
|
|
|
|
|
|
void __fastcall FUN_004c50f0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
cVar1 = FUN_004603a0();
|
|
|
|
if (((cVar1 != '\0') && (*(int *)(param_1 + 0x3c) != 0)) && (DAT_00871e54 != 0)) {
|
|
|
|
iVar2 = FUN_004e3b60(DAT_00871e54);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_004c44d0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5130 at 0x004C5130 (size: 923) ---
|
|
|
|
|
|
void __thiscall FUN_004c5130(int param_1,int param_2,undefined *param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
undefined *puVar2;
|
|
|
|
char cVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
undefined4 *puVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
LONG LVar8;
|
|
|
|
code *pcVar9;
|
|
|
|
undefined4 uVar10;
|
|
|
|
undefined4 uVar11;
|
|
|
|
undefined4 uVar12;
|
|
|
|
undefined *local_48;
|
|
|
|
int local_44;
|
|
|
|
int local_40;
|
|
|
|
int local_3c;
|
|
|
|
int local_38;
|
|
|
|
undefined4 local_34;
|
|
|
|
undefined1 local_30 [4];
|
|
|
|
undefined4 *local_2c;
|
|
|
|
int local_28;
|
|
|
|
uint local_24;
|
|
|
|
undefined1 local_20 [4];
|
|
|
|
int local_1c;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined4 *local_c;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x608) == 0) {
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00404a40(0,"You need an open vendor.");
|
|
|
|
FUN_005649f0(¶m_3,0x1a,1,0);
|
|
|
|
puVar2 = param_3;
|
|
|
|
iVar4 = InterlockedDecrement((LONG *)(param_3 + -0x10));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_004c2a90(0x1000,0);
|
|
|
|
FUN_0055e1d0();
|
|
|
|
local_34 = FUN_0055e220();
|
|
|
|
FUN_0055e1d0();
|
|
|
|
FUN_005d5490(local_30);
|
|
|
|
FUN_0055e1d0();
|
|
|
|
FUN_005d54d0(local_10);
|
|
|
|
local_48 = PTR_DAT_00818344;
|
|
|
|
local_44 = 0;
|
|
|
|
InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));
|
|
|
|
pcVar9 = InterlockedDecrement_exref;
|
|
|
|
if (local_c != local_2c) {
|
|
|
|
do {
|
|
|
|
if (((int)param_3 <= local_44) && (param_3 != (undefined *)0x0)) {
|
|
|
|
FUN_005d2810();
|
|
|
|
FUN_004c1b60(local_20);
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00404a40(0,"Buying aborted; max price reached.\n");
|
|
|
|
FUN_005649f0(¶m_3,0,1,0);
|
|
|
|
pcVar9 = InterlockedDecrement_exref;
|
|
|
|
puVar6 = (undefined4 *)(param_3 + -0x14);
|
|
|
|
LVar8 = InterlockedDecrement((LONG *)(param_3 + -0x10));
|
|
|
|
if ((LVar8 == 0) && (puVar6 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar6)(1);
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
uVar7 = *local_2c;
|
|
|
|
iVar4 = local_2c[1];
|
|
|
|
local_40 = 0;
|
|
|
|
FUN_00586e10(uVar7,&local_40);
|
|
|
|
iVar5 = FUN_00586d80(uVar7);
|
|
|
|
if (((iVar5 == param_2) || (param_2 == 8)) && (local_40 < iVar4)) {
|
|
|
|
iVar4 = iVar4 - local_40;
|
|
|
|
local_3c = iVar4;
|
|
|
|
cVar3 = FUN_004c1760(uVar7,&local_3c,&local_38);
|
|
|
|
if (cVar3 == '\0') {
|
|
|
|
FUN_004c3a80(uVar7,&local_48);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005d2810();
|
|
|
|
for (iVar5 = *(int *)(param_1 + 0x618); iVar5 != 0; iVar5 = *(int *)(iVar5 + 0x10)) {
|
|
|
|
if (*(int *)(iVar5 + 8) == local_38) {
|
|
|
|
FUN_005d2770(iVar5);
|
|
|
|
iVar4 = iVar4 - local_1c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar5 = local_3c;
|
|
|
|
if (local_3c < iVar4) {
|
|
|
|
FUN_004c3a80(uVar7,&local_48);
|
|
|
|
iVar4 = iVar5;
|
|
|
|
}
|
|
|
|
iVar5 = FUN_005583f0(local_38);
|
|
|
|
if (iVar5 != 0) {
|
|
|
|
FUN_004c49b0(iVar5,iVar4);
|
|
|
|
iVar4 = FUN_005d2b00(iVar5 + 0x98,iVar4);
|
|
|
|
local_44 = local_44 + iVar4;
|
|
|
|
}
|
|
|
|
FUN_005d2830();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puVar6 = (undefined4 *)local_2c[2];
|
|
|
|
if (puVar6 == (undefined4 *)0x0) {
|
|
|
|
uVar1 = local_2c[3];
|
|
|
|
do {
|
|
|
|
uVar1 = uVar1 + 1;
|
|
|
|
if (local_24 <= uVar1) {
|
|
|
|
puVar6 = (undefined4 *)0x0;
|
|
|
|
goto LAB_004c5331;
|
|
|
|
}
|
|
|
|
} while (*(int *)(local_28 + uVar1 * 4) == 0);
|
|
|
|
puVar6 = *(undefined4 **)(local_28 + uVar1 * 4);
|
|
|
|
}
|
|
|
|
LAB_004c5331:
|
|
|
|
pcVar9 = InterlockedDecrement_exref;
|
|
|
|
local_2c = puVar6;
|
|
|
|
} while (local_c != puVar6);
|
|
|
|
}
|
|
|
|
if (*(int *)(local_48 + -4) != 1) {
|
|
|
|
FUN_00564d30();
|
|
|
|
uVar12 = 0;
|
|
|
|
uVar11 = 1;
|
|
|
|
uVar10 = 0;
|
|
|
|
uVar7 = FUN_00403350(¶m_3,0);
|
|
|
|
FUN_005649f0(uVar7,uVar10,uVar11,uVar12);
|
|
|
|
puVar6 = (undefined4 *)(param_3 + -0x14);
|
|
|
|
iVar4 = (*pcVar9)(param_3 + -0x10);
|
|
|
|
if ((iVar4 == 0) && (puVar6 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar6)(1);
|
|
|
|
}
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00404a40(0,&DAT_00795508);
|
|
|
|
FUN_005649f0(¶m_2,0,1,0);
|
|
|
|
puVar6 = (undefined4 *)(param_2 + -0x14);
|
|
|
|
iVar4 = (*pcVar9)(param_2 + -0x10);
|
|
|
|
if ((iVar4 == 0) && (puVar6 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar6)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004c38f0(*(undefined4 *)(*(int *)(param_1 + 0x638) + 8),
|
|
|
|
*(int *)(*(int *)(param_1 + 0x638) + 4) + 0x614,1);
|
|
|
|
FUN_004c1a00();
|
|
|
|
FUN_004c3d40();
|
|
|
|
FUN_004c3fc0();
|
|
|
|
if (*(int *)(param_1 + 0x604) != 0) {
|
|
|
|
*(undefined4 *)(param_1 + 0x644) = 0;
|
|
|
|
FUN_0046c110(0x100000ba);
|
|
|
|
}
|
|
|
|
puVar2 = local_48;
|
|
|
|
iVar4 = (*pcVar9)(local_48 + -0x10);
|
|
|
|
}
|
|
|
|
if ((iVar4 == 0) && ((undefined4 *)(puVar2 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(puVar2 + -0x14))(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c54d0 at 0x004C54D0 (size: 197) ---
|
|
|
|
|
|
void __fastcall FUN_004c54d0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int **ppiVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
int *local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
ppiVar6 = &local_14;
|
|
|
|
puVar4 = local_10;
|
|
|
|
puVar5 = &DAT_007b5f98;
|
|
|
|
local_14 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007b5f98,ppiVar6);
|
|
|
|
FUN_00406570(puVar4,puVar5,ppiVar6);
|
|
|
|
piVar2 = local_14;
|
|
|
|
uVar7 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar3 = local_14;
|
|
|
|
if (local_14 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_14 + 0x10))(local_14,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_0048bb00(local_c,piVar3,uVar7);
|
|
|
|
iVar1 = *piVar3;
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
if ((local_8 == (int *)0x0) || (iVar1 < 0)) {
|
|
|
|
*(undefined4 *)(param_1 + 0x640) = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_00590c20(0x14,param_1 + 0x640,0,0);
|
|
|
|
}
|
|
|
|
FUN_004c44d0();
|
|
|
|
FUN_004c3fc0();
|
|
|
|
FUN_004c4340();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c55a0 at 0x004C55A0 (size: 19) ---
|
|
|
|
|
|
void FUN_004c55a0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c44d0();
|
|
|
|
FUN_004c18b0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5610 at 0x004C5610 (size: 147) ---
|
|
|
|
|
|
void __thiscall FUN_004c5610(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (*(int *)(*(int *)(param_1 + 4) + 0x604) != 0) {
|
|
|
|
*(undefined4 *)(*(int *)(param_1 + 4) + 0x644) = 0;
|
|
|
|
FUN_0046c110(0x100000bb);
|
|
|
|
}
|
|
|
|
FUN_0058d110(param_2,0);
|
|
|
|
FUN_004c20a0(*(undefined4 *)(param_1 + 0xc),param_2,0xffffffff,1,1,0,1,0xffffffff);
|
|
|
|
FUN_004c1f00(*(undefined4 *)(param_1 + 0xc),*(int *)(param_1 + 4) + 0x624,0,1);
|
|
|
|
FUN_004c38f0(*(undefined4 *)(param_1 + 0xc),*(int *)(param_1 + 4) + 0x624,1);
|
|
|
|
FUN_004c1ab0();
|
|
|
|
FUN_004c41a0();
|
|
|
|
FUN_004c4340();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c56d0 at 0x004C56D0 (size: 116) ---
|
|
|
|
|
|
void __thiscall FUN_004c56d0(int param_1,undefined4 param_2,undefined4 param_3,int param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
iVar1 = param_4;
|
|
|
|
if (param_4 == 0x14) {
|
|
|
|
FUN_004c54d0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x10) != 0) {
|
|
|
|
FUN_005d2bd0(¶m_4);
|
|
|
|
iVar2 = DAT_00840550;
|
|
|
|
if ((iVar1 == 5) && (param_4 != DAT_00840550)) {
|
|
|
|
iVar1 = FUN_005583f0(DAT_00871e54);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar2 = *(int *)(iVar1 + 0xa4);
|
|
|
|
}
|
|
|
|
if (iVar2 == param_4) {
|
|
|
|
(**(code **)(*(int *)(param_1 + -0x5fc) + 0x18))(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5790 at 0x004C5790 (size: 852) ---
|
|
|
|
|
|
void __thiscall
|
|
|
|
FUN_004c5790(int *param_1,int *param_2,undefined4 param_3,undefined4 param_4,int param_5)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 *puVar2;
|
|
|
|
int iVar3;
|
|
|
|
int *piVar4;
|
|
|
|
int iVar5;
|
|
|
|
bool bVar6;
|
|
|
|
int *piVar7;
|
|
|
|
double dVar8;
|
|
|
|
undefined4 uVar9;
|
|
|
|
undefined4 uVar10;
|
|
|
|
undefined4 uVar11;
|
|
|
|
undefined4 uVar12;
|
|
|
|
undefined4 *puVar13;
|
|
|
|
undefined4 uVar14;
|
|
|
|
undefined *puVar15;
|
|
|
|
undefined4 uVar16;
|
|
|
|
undefined4 uVar17;
|
|
|
|
undefined1 auStack_10 [16];
|
|
|
|
|
|
|
|
FUN_004c54d0();
|
|
|
|
iVar1 = (int)param_2;
|
|
|
|
if ((DAT_00871ed0 == 10) && ((int *)DAT_00871ed4 == param_2)) {
|
|
|
|
FUN_0058d8e0(param_2);
|
|
|
|
}
|
|
|
|
iVar3 = param_1[0x182];
|
|
|
|
bVar6 = iVar3 == iVar1;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_004c3c10(CONCAT31((int3)((uint)iVar3 >> 8),bVar6));
|
|
|
|
}
|
|
|
|
param_1[0x182] = iVar1;
|
|
|
|
iVar1 = FUN_005583f0(iVar1);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
uVar17 = *(undefined4 *)(iVar1 + 8);
|
|
|
|
uVar16 = 0;
|
|
|
|
uVar14 = 0;
|
|
|
|
uVar10 = 0;
|
|
|
|
uVar9 = 1;
|
|
|
|
dVar8 = (double)*(float *)(iVar1 + 0xdc);
|
|
|
|
piVar7 = param_1 + 0x180;
|
|
|
|
uVar11 = DAT_007b60c0;
|
|
|
|
uVar12 = DAT_007b60c4;
|
|
|
|
FUN_0055e1d0(piVar7,uVar17,dVar8,1,0,DAT_007b60c0,DAT_007b60c4,0,0);
|
|
|
|
FUN_00561040(piVar7,uVar17,dVar8,uVar9,uVar10,uVar11,uVar12,uVar14,uVar16);
|
|
|
|
}
|
|
|
|
iVar1 = FUN_005df0f5(0x28);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
iVar1 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = FUN_005d2be0();
|
|
|
|
}
|
|
|
|
param_1[0x183] = iVar1;
|
|
|
|
FUN_004c16e0(param_3);
|
|
|
|
puVar2 = (undefined4 *)FUN_005df0f5(0x10);
|
|
|
|
if (puVar2 == (undefined4 *)0x0) {
|
|
|
|
puVar2 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*puVar2 = &PTR_FUN_007b6110;
|
|
|
|
puVar2[1] = 0;
|
|
|
|
puVar2[2] = 0;
|
|
|
|
puVar2[3] = 0;
|
|
|
|
}
|
|
|
|
param_1[0x184] = (int)puVar2;
|
|
|
|
FUN_004c2f30(param_4);
|
|
|
|
puVar2 = ¶m_2;
|
|
|
|
puVar13 = ¶m_3;
|
|
|
|
puVar15 = &DAT_007b5fb8;
|
|
|
|
param_2 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar13,&DAT_007b5fb8,puVar2);
|
|
|
|
FUN_00406570(puVar13,puVar15,puVar2);
|
|
|
|
piVar7 = param_2;
|
|
|
|
uVar17 = 0;
|
|
|
|
piVar4 = param_2;
|
|
|
|
if (param_2 != (int *)0x0) {
|
|
|
|
(**(code **)(*param_2 + 0x10))(param_2,0);
|
|
|
|
}
|
|
|
|
FUN_004c1da0(¶m_4,piVar4,uVar17);
|
|
|
|
if (piVar7 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar7 + 0x14))();
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1[0x184] + 4);
|
|
|
|
param_2 = (int *)0x0;
|
|
|
|
for (; iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
if (*(int *)(iVar1 + 0xc) != 0) {
|
|
|
|
iVar3 = FUN_005583f0(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
uVar17 = FUN_0054bb30(*(undefined4 *)(iVar1 + 8));
|
|
|
|
FUN_00508850(uVar17);
|
|
|
|
FUN_005adb20(*(undefined4 *)(iVar1 + 0xc));
|
|
|
|
FUN_0058cca0();
|
|
|
|
FUN_0058f170();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = FUN_0058df90();
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
FUN_005adb20(*(undefined4 *)(iVar1 + 0xc));
|
|
|
|
}
|
|
|
|
FUN_00508f10(*(undefined4 *)(iVar1 + 8));
|
|
|
|
}
|
|
|
|
iVar3 = *(int *)(param_1[0x184] + 4);
|
|
|
|
for (iVar5 = 0; (iVar3 != 0 && ((int *)iVar5 != param_2)); iVar5 = iVar5 + 1) {
|
|
|
|
iVar3 = *(int *)(iVar3 + 0x10);
|
|
|
|
}
|
|
|
|
FUN_005d2750();
|
|
|
|
}
|
|
|
|
param_2 = (int *)((int)param_2 + 1);
|
|
|
|
}
|
|
|
|
if (bVar6) {
|
|
|
|
LAB_004c59d0:
|
|
|
|
for (iVar1 = param_1[0x186]; iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x10)) {
|
|
|
|
FUN_005d2810();
|
|
|
|
iVar3 = *(int *)(param_1[0x184] + 4);
|
|
|
|
while( true ) {
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
FUN_005d2860(iVar1);
|
|
|
|
FUN_004c1bc0(auStack_10);
|
|
|
|
FUN_005d2830();
|
|
|
|
FUN_005d2830();
|
|
|
|
goto LAB_004c59d0;
|
|
|
|
}
|
|
|
|
if (*(int *)(iVar3 + 8) == *(int *)(iVar1 + 8)) break;
|
|
|
|
iVar3 = *(int *)(iVar3 + 0x10);
|
|
|
|
}
|
|
|
|
FUN_005d2770(iVar3);
|
|
|
|
FUN_005d2830();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (param_5 == 2) {
|
|
|
|
if (param_1[0x181] == 0) goto LAB_004c5a8d;
|
|
|
|
uVar17 = 0x100000b9;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ((param_5 != 3) || (param_1[0x181] == 0)) goto LAB_004c5a8d;
|
|
|
|
uVar17 = 0x100000bb;
|
|
|
|
}
|
|
|
|
param_1[0x191] = 0;
|
|
|
|
FUN_0046c110(uVar17);
|
|
|
|
}
|
|
|
|
LAB_004c5a8d:
|
|
|
|
piVar4 = (int *)(uint)bVar6;
|
|
|
|
piVar7 = piVar4;
|
|
|
|
(*(code *)**(undefined4 **)param_1[0x18d])();
|
|
|
|
(*(code *)**(undefined4 **)param_1[399])(piVar4);
|
|
|
|
(*(code *)**(undefined4 **)param_1[0x18e])(piVar4);
|
|
|
|
piVar4 = (int *)FUN_0043c680();
|
|
|
|
(**(code **)(*piVar4 + 4))(0x4dd264,param_1 + 0x17e);
|
|
|
|
(**(code **)(*param_1 + 0x18))(1);
|
|
|
|
if (piVar7 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar7 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5af0 at 0x004C5AF0 (size: 454) ---
|
|
|
|
|
|
undefined1 __thiscall FUN_004c5af0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
bool bVar1;
|
|
|
|
char cVar2;
|
|
|
|
undefined2 uVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
undefined4 *puVar6;
|
|
|
|
int *piVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
undefined1 local_98 [4];
|
|
|
|
undefined1 local_94 [4];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
cVar2 = FUN_004c2cb0(param_2,0);
|
|
|
|
if (cVar2 == '\0') {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar4 = FUN_005583f0(param_2);
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
bVar1 = false;
|
|
|
|
if (DAT_0081d7ec == DAT_0081d7f0) {
|
|
|
|
FUN_0058cf00(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar8 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar8 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
iVar5 = FUN_00588f70(param_2,uVar8,*(undefined4 *)(iVar4 + 0xb4),0,0);
|
|
|
|
if (iVar5 == 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"Cannot split the stack to sell it");
|
|
|
|
FUN_0042cbe0(local_98,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x2c) = 0;
|
|
|
|
bVar1 = true;
|
|
|
|
*(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(iVar4 + 0xa4);
|
|
|
|
uVar3 = FUN_00587d30(iVar4);
|
|
|
|
*(undefined2 *)(param_1 + 0x34) = uVar3;
|
|
|
|
puVar6 = (undefined4 *)FUN_0058f8b0(local_94,2,0);
|
|
|
|
FUN_00480980(local_98,0,L"Splitting the %s before selling them",*puVar6);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(local_98,1);
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
FUN_004c5610(param_2);
|
|
|
|
if (bVar1) {
|
|
|
|
iVar4 = FUN_004e3c10();
|
|
|
|
piVar7 = (int *)FUN_0046dc50(iVar4 + -1);
|
|
|
|
if (piVar7 != (int *)0x0) {
|
|
|
|
uVar8 = (**(code **)(*piVar7 + 0x94))(0x10000032);
|
|
|
|
*(undefined4 *)(param_1 + 0x2c) = uVar8;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x2c) = 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c5cc0 at 0x004C5CC0 (size: 1374) ---
|
|
|
|
|
|
void __thiscall FUN_004c5cc0(int *param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
bool bVar2;
|
|
|
|
char cVar3;
|
|
|
|
int iVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
undefined4 *puVar8;
|
|
|
|
uint local_130 [2];
|
|
|
|
undefined1 local_128 [4];
|
|
|
|
int local_124;
|
|
|
|
undefined1 local_120 [4];
|
|
|
|
undefined1 local_11c [4];
|
|
|
|
undefined1 local_118 [4];
|
|
|
|
uint local_114;
|
|
|
|
undefined1 local_110 [4];
|
|
|
|
undefined1 local_10c [4];
|
|
|
|
undefined1 local_108 [144];
|
|
|
|
undefined1 local_78 [120];
|
|
|
|
|
|
|
|
FUN_005d2bd0(&local_124);
|
|
|
|
uVar5 = DAT_00871e54;
|
|
|
|
switch(param_2) {
|
|
|
|
case 0x100000c2:
|
|
|
|
FUN_004c3410(DAT_00871e54);
|
|
|
|
return;
|
|
|
|
case 0x100000c3:
|
|
|
|
iVar4 = FUN_005583f0(DAT_00871e54);
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
if ((*(uint *)(iVar4 + 0xf8) != 0) && (1 < *(uint *)(iVar4 + 0xf8))) {
|
|
|
|
uVar5 = FUN_00587d30(iVar4);
|
|
|
|
FUN_004c49b0(iVar4,uVar5);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FUN_004c49b0(iVar4,1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0x100000c4:
|
|
|
|
case 0x100000c5:
|
|
|
|
case 0x100000c6:
|
|
|
|
case 0x100000c7:
|
|
|
|
case 0x100000c8:
|
|
|
|
case 0x100000cd:
|
|
|
|
case 0x100000ce:
|
|
|
|
case 0x100000cf:
|
|
|
|
case 0x100000d0:
|
|
|
|
case 0x100000d1:
|
|
|
|
break;
|
|
|
|
case 0x100000c9:
|
|
|
|
iVar4 = FUN_005583f0(DAT_00871e54);
|
|
|
|
bVar2 = false;
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
bVar2 = 1 < *(uint *)(iVar4 + 0xfc);
|
|
|
|
}
|
|
|
|
cVar3 = FUN_004c3410(DAT_00871e54);
|
|
|
|
if (cVar3 != '\0') goto LAB_004c5ed8;
|
|
|
|
break;
|
|
|
|
case 0x100000ca:
|
|
|
|
iVar4 = param_1[0x18e];
|
|
|
|
if (local_124 == DAT_00840550) {
|
|
|
|
if (param_1[400] < *(int *)(iVar4 + 0x24)) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You don\'t have enough money");
|
|
|
|
FUN_0042cbe0(local_128,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_00693500(0x1a,local_108);
|
|
|
|
FUN_0042e590();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (*(int *)(param_1[0x183] + 0x20) - param_1[0x191] < *(int *)(iVar4 + 0x24)) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You don\'t have enough money");
|
|
|
|
FUN_0042cbe0(local_11c,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
goto LAB_004c5fc8;
|
|
|
|
}
|
|
|
|
piVar1 = param_1 + 0x185;
|
|
|
|
FUN_004c1f00(*(undefined4 *)(iVar4 + 8),piVar1,1,1);
|
|
|
|
FUN_004c1800(piVar1,local_130,&local_114);
|
|
|
|
uVar5 = FUN_0048e5f0();
|
|
|
|
iVar6 = FUN_005583f0(uVar5);
|
|
|
|
iVar4 = *(int *)(iVar6 + 0xcc);
|
|
|
|
iVar7 = FUN_0058ccf0();
|
|
|
|
if (((uint)(iVar4 - iVar7) < local_114) ||
|
|
|
|
(iVar4 = *(int *)(iVar6 + 200), iVar6 = FUN_0058cce0(), (uint)(iVar4 - iVar6) < local_130[0])
|
|
|
|
) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You must empty some slots in your backpack first");
|
|
|
|
FUN_0042cbe0(local_120,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
LAB_004c5fc8:
|
|
|
|
FUN_00693500(0x1a,local_108);
|
|
|
|
FUN_0042e590();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (local_124 != DAT_00840550) {
|
|
|
|
param_1[0x191] = *(int *)(param_1[0x18e] + 0x24);
|
|
|
|
}
|
|
|
|
puVar8 = (undefined4 *)FUN_005d2bd0(local_10c);
|
|
|
|
FUN_004c0ea0(param_1[0x182],piVar1,*puVar8,0);
|
|
|
|
FUN_004c1ca0();
|
|
|
|
goto LAB_004c5edf;
|
|
|
|
case 0x100000cb:
|
|
|
|
iVar4 = FUN_005583f0(DAT_00871e54);
|
|
|
|
bVar2 = false;
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
bVar2 = 1 < *(uint *)(iVar4 + 0xfc);
|
|
|
|
}
|
|
|
|
LAB_004c5ed8:
|
|
|
|
FUN_004c1e50(param_1 + 0x185,DAT_00871e54,(uint)!bVar2 * 2 + -1);
|
|
|
|
LAB_004c5edf:
|
|
|
|
FUN_004c4b60();
|
|
|
|
return;
|
|
|
|
case 0x100000cc:
|
|
|
|
FUN_004c1ca0();
|
|
|
|
FUN_004c4b60();
|
|
|
|
return;
|
|
|
|
case 0x100000d2:
|
|
|
|
cVar3 = FUN_004c3730(DAT_00871e54);
|
|
|
|
if (cVar3 != '\0') {
|
|
|
|
FUN_004c0fa0(uVar5,0);
|
|
|
|
FUN_004c1e50(param_1 + 0x189,uVar5,0xffffffff);
|
|
|
|
goto LAB_004c6206;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0x100000d3:
|
|
|
|
cVar3 = FUN_004c1f00(*(undefined4 *)(param_1[399] + 0xc),param_1 + 0x189,1,1);
|
|
|
|
if (cVar3 == '\0') {
|
|
|
|
param_1[0x191] = 0;
|
|
|
|
FUN_005d2bd0(local_110);
|
|
|
|
iVar4 = param_1[0x182];
|
|
|
|
FUN_006aaf60(iVar4,param_1 + 0x189);
|
|
|
|
FUN_0058d050(iVar4,10);
|
|
|
|
FUN_00564d30();
|
|
|
|
FUN_00565610();
|
|
|
|
goto LAB_004c61f7;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0x100000d4:
|
|
|
|
FUN_004c0fa0(DAT_00871e54,0);
|
|
|
|
FUN_004c1e50(param_1 + 0x189,DAT_00871e54,0xffffffff);
|
|
|
|
goto LAB_004c6206;
|
|
|
|
case 0x100000d5:
|
|
|
|
LAB_004c61f7:
|
|
|
|
FUN_004c17c0(param_1 + 0x189);
|
|
|
|
FUN_004c1ca0();
|
|
|
|
LAB_004c6206:
|
|
|
|
FUN_004c4b90();
|
|
|
|
break;
|
|
|
|
case 0x100000d6:
|
|
|
|
if ((param_1[0x186] == 0) && (param_1[0x18a] == 0)) {
|
|
|
|
(**(code **)(*param_1 + 0x18))(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (DAT_00840534 == 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(
|
|
|
|
L"You have not completed all transactions. Are you sure you want to leave this vendor?"
|
|
|
|
);
|
|
|
|
FUN_0042cbe0(local_118,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_006823d0();
|
|
|
|
local_130[0] = 0;
|
|
|
|
local_130[1] = 0;
|
|
|
|
FUN_0042a2d0(0x8e);
|
|
|
|
FUN_00429bc0(1);
|
|
|
|
FUN_004753d0(local_130);
|
|
|
|
FUN_0042a2d0(0xc5);
|
|
|
|
FUN_00429c00(local_108);
|
|
|
|
FUN_004753d0(local_130);
|
|
|
|
DAT_00840534 = FUN_00478830(local_78,&LAB_004c3c70);
|
|
|
|
FUN_004234d0();
|
|
|
|
FUN_00681f60();
|
|
|
|
FUN_0042e590();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto switchD_004c5d01_default;
|
|
|
|
}
|
|
|
|
switchD_004c5d01_default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6270 at 0x004C6270 (size: 108) ---
|
|
|
|
|
|
void __thiscall FUN_004c6270(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
char cVar2;
|
|
|
|
byte local_8 [4];
|
|
|
|
undefined1 local_4 [4];
|
|
|
|
|
|
|
|
iVar1 = *(int *)(*(int *)(param_2 + 0xc) + 8);
|
|
|
|
if ((iVar1 != 0) && (*(int *)(*(int *)(param_2 + 0xc) + 0x10) != 0)) {
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(*(int *)(param_1 + 0x63c) + 0xc));
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
FUN_004e3380(iVar1,¶m_2,local_4,local_8);
|
|
|
|
if ((param_2 != 0) && ((local_8[0] & 0xe) == 0)) {
|
|
|
|
FUN_004c5af0(param_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6400 at 0x004C6400 (size: 94) ---
|
|
|
|
|
|
undefined4 FUN_004c6400(uint param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((param_1 < 0x100005c3) && (param_1 != 0x100005c2)) {
|
|
|
|
switch(param_1) {
|
|
|
|
case 0x100000a3:
|
|
|
|
return 0x100000a4;
|
|
|
|
case 0x100000a4:
|
|
|
|
return 0x100000a5;
|
|
|
|
case 0x100000a5:
|
|
|
|
return 0x100000a6;
|
|
|
|
case 0x100000a6:
|
|
|
|
return 0x100000a7;
|
|
|
|
case 0x100000a7:
|
|
|
|
return 0x100000a8;
|
|
|
|
case 0x100000a8:
|
|
|
|
return 0x100000a9;
|
|
|
|
case 0x100000a9:
|
|
|
|
return 0x100005c2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0x100000a3;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6480 at 0x004C6480 (size: 94) ---
|
|
|
|
|
|
undefined4 FUN_004c6480(uint param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (param_1 < 0x100005c3) {
|
|
|
|
if (param_1 == 0x100005c2) {
|
|
|
|
return 0x100000a9;
|
|
|
|
}
|
|
|
|
switch(param_1) {
|
|
|
|
case 0x100000a3:
|
|
|
|
return 0x100005c2;
|
|
|
|
case 0x100000a5:
|
|
|
|
return 0x100000a4;
|
|
|
|
case 0x100000a6:
|
|
|
|
return 0x100000a5;
|
|
|
|
case 0x100000a7:
|
|
|
|
return 0x100000a6;
|
|
|
|
case 0x100000a8:
|
|
|
|
return 0x100000a7;
|
|
|
|
case 0x100000a9:
|
|
|
|
return 0x100000a8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0x100000a3;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6500 at 0x004C6500 (size: 87) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c6500(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x5fc) != 0) {
|
|
|
|
uVar1 = *(uint *)(*(int *)(param_1 + 0x5fc) + 0x6d8);
|
|
|
|
if (uVar1 < 0x100005c4) {
|
|
|
|
if (uVar1 == 0x100005c3) {
|
|
|
|
return 7;
|
|
|
|
}
|
|
|
|
switch(uVar1) {
|
|
|
|
case 0x100000ab:
|
|
|
|
return 1;
|
|
|
|
case 0x100000ac:
|
|
|
|
return 2;
|
|
|
|
case 0x100000ad:
|
|
|
|
return 3;
|
|
|
|
case 0x100000ae:
|
|
|
|
return 4;
|
|
|
|
case 0x100000af:
|
|
|
|
return 5;
|
|
|
|
case 0x100000b0:
|
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c65a0 at 0x004C65A0 (size: 50) ---
|
|
|
|
|
|
void __fastcall FUN_004c65a0(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
void *pvVar1;
|
|
|
|
void *pvVar2;
|
|
|
|
|
|
|
|
pvVar2 = (void *)*param_1;
|
|
|
|
while (pvVar2 != (void *)0x0) {
|
|
|
|
pvVar1 = *(void **)((int)pvVar2 + 4);
|
|
|
|
operator_delete(pvVar2);
|
|
|
|
pvVar2 = pvVar1;
|
|
|
|
}
|
|
|
|
*param_1 = 0;
|
|
|
|
param_1[1] = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c65e0 at 0x004C65E0 (size: 100) ---
|
|
|
|
|
|
void __fastcall FUN_004c65e0(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
*param_1 = &PTR_FUN_007b7298;
|
|
|
|
*puVar1 = &PTR_FUN_007b6ff0;
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
param_1 = param_1 + 0x1c2;
|
|
|
|
iVar3 = 8;
|
|
|
|
do {
|
|
|
|
piVar2 = param_1 + -6;
|
|
|
|
param_1 = param_1 + -7;
|
|
|
|
*param_1 = &PTR_LAB_007b6fec;
|
|
|
|
if (*piVar2 != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
iVar3 = iVar3 + -1;
|
|
|
|
} while (iVar3 != 0);
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6680 at 0x004C6680 (size: 101) ---
|
|
|
|
|
|
void __thiscall
|
|
|
|
FUN_004c6680(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5
|
|
|
|
)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
iVar1 = FUN_00463c00(param_3);
|
|
|
|
*(undefined4 *)(param_1 + 0x14) = param_5;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
piVar2 = (int *)FUN_00463c00(0x100000b6);
|
|
|
|
if (piVar2 == (int *)0x0) {
|
|
|
|
iVar1 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = (**(code **)(*piVar2 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 4) = iVar1;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004e3220(param_1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uVar3 = FUN_00463c00(param_4);
|
|
|
|
*(undefined4 *)(param_1 + 8) = uVar3;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c66f0 at 0x004C66F0 (size: 136) ---
|
|
|
|
|
|
void __thiscall FUN_004c66f0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
iVar3 = 0;
|
|
|
|
if (*(int *)(*(int *)(param_1 + 4) + 0x610) < 1) {
|
|
|
|
*(int *)(param_1 + 0xc) = param_2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
do {
|
|
|
|
piVar1 = (int *)FUN_0046dc50(iVar3);
|
|
|
|
if ((piVar1 != (int *)0x0) && (iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032), iVar2 != 0)) {
|
|
|
|
if ((param_2 == 0) || (*(int *)(iVar2 + 0x600) != param_2)) {
|
|
|
|
FUN_004e1ed0(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_004e1ed0(1);
|
|
|
|
*(undefined1 *)(param_1 + 0x18) = 0;
|
|
|
|
FUN_0046edb0(iVar3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar3 = iVar3 + 1;
|
|
|
|
} while (iVar3 < *(int *)(*(int *)(param_1 + 4) + 0x610));
|
|
|
|
*(int *)(param_1 + 0xc) = param_2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6780 at 0x004C6780 (size: 73) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c6780(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 4) != 0) {
|
|
|
|
piVar1 = (int *)FUN_0046dc50(param_2);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032);
|
|
|
|
if ((iVar2 != 0) && (*(int *)(iVar2 + 0x600) != 0)) {
|
|
|
|
FUN_004c66f0(*(int *)(iVar2 + 0x600));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c67d0 at 0x004C67D0 (size: 94) ---
|
|
|
|
|
|
void __fastcall FUN_004c67d0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
if ((*(int *)(param_1 + 4) != 0) && (iVar3 = 0, 0 < *(int *)(*(int *)(param_1 + 4) + 0x610))) {
|
|
|
|
do {
|
|
|
|
piVar1 = (int *)FUN_0046dc50(iVar3);
|
|
|
|
if ((piVar1 != (int *)0x0) && (iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032), iVar2 != 0))
|
|
|
|
{
|
|
|
|
if ((iVar3 < 0) || (iVar2 = iVar3, 8 < iVar3)) {
|
|
|
|
iVar2 = -1;
|
|
|
|
}
|
|
|
|
FUN_004e2220(iVar2,0);
|
|
|
|
}
|
|
|
|
iVar3 = iVar3 + 1;
|
|
|
|
} while (iVar3 < *(int *)(*(int *)(param_1 + 4) + 0x610));
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6830 at 0x004C6830 (size: 149) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c6830(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
*param_1 = &PTR_FUN_007b7298;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b6ff0;
|
|
|
|
param_1[0x17f] = 0;
|
|
|
|
param_1[0x180] = 0;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
param_1[0x184] = 0;
|
|
|
|
param_1[0x185] = 0;
|
|
|
|
param_1[0x186] = 0;
|
|
|
|
*(undefined1 *)(param_1 + 0x187) = 0;
|
|
|
|
puVar1 = param_1 + 0x18a;
|
|
|
|
iVar2 = 8;
|
|
|
|
do {
|
|
|
|
*puVar1 = &PTR_LAB_007b6fec;
|
|
|
|
puVar1[1] = 0;
|
|
|
|
puVar1[2] = 0;
|
|
|
|
puVar1[3] = 0;
|
|
|
|
puVar1[4] = 0;
|
|
|
|
puVar1[5] = 0;
|
|
|
|
*(undefined1 *)(puVar1 + 6) = 0;
|
|
|
|
puVar1 = puVar1 + 7;
|
|
|
|
iVar2 = iVar2 + -1;
|
|
|
|
} while (iVar2 != 0);
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c68d0 at 0x004C68D0 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004c68d0(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c65e0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c68f0 at 0x004C68F0 (size: 768) ---
|
|
|
|
|
|
void __fastcall FUN_004c68f0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000a2);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(8);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x5fc) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000048b);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x600) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000a0);
|
|
|
|
*(int **)(param_1 + 0x618) = piVar1;
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar1 + 0x110))(1);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x100000b2);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x604) = uVar2;
|
|
|
|
iVar3 = FUN_00463c00(0x100000b1);
|
|
|
|
*(int *)(param_1 + 0x608) = iVar3;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
uVar2 = FUN_00463c00(0x10000453);
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x10000452);
|
|
|
|
*(undefined4 *)(param_1 + 0x610) = uVar2;
|
|
|
|
uVar2 = FUN_00463c00(0x10000454);
|
|
|
|
*(undefined4 *)(param_1 + 0x614) = uVar2;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x608) + 0x110))(1);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x608) + 0x18))(0);
|
|
|
|
}
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000aa,0x100000a3,0);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000ab,0x100000a4,1);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000ac,0x100000a5,2);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000ad,0x100000a6,3);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000ae,0x100000a7,4);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000af,0x100000a8,5);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100000b0,0x100000a9,6);
|
|
|
|
FUN_004c6680(*(undefined4 *)(param_1 + 0x5fc),0x100005c3,0x100005c2,7);
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
param_1 = param_1 + 0x5f8;
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1f0,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1ef,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a8,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd256,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1fb,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd202,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd203,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd260,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24a,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24b,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24c,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24d,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd268,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd26b,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd26a,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd269,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24e,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd24f,param_1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6c20 at 0x004C6C20 (size: 19) ---
|
|
|
|
|
|
void FUN_004c6c20(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000015,&LAB_004c6bf0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6c40 at 0x004C6C40 (size: 208) ---
|
|
|
|
|
|
void FUN_004c6c40(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
int extraout_ECX;
|
|
|
|
int extraout_ECX_00;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar1 = FUN_004c6500();
|
|
|
|
iVar1 = *(int *)(iVar1 * 0x1c + 0x634 + extraout_ECX);
|
|
|
|
iVar2 = FUN_004c6500();
|
|
|
|
if ((*(char *)(iVar2 * 0x1c + 0x640 + extraout_ECX_00) != '\0') &&
|
|
|
|
(*(int *)(extraout_ECX_00 + 0x620) != 0)) {
|
|
|
|
FUN_005898b0(*(int *)(extraout_ECX_00 + 0x620),1,1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You must select a spell to cast");
|
|
|
|
FUN_0042cbe0(&local_94,1);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_00567c00();
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_00568de0(iVar1,1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c6d10 at 0x004C6D10 (size: 723) ---
|
|
|
|
|
|
void __fastcall FUN_004c6d10(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint *puVar1;
|
|
|
|
char extraout_AH;
|
|
|
|
int iVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int iVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
undefined4 *puVar6;
|
|
|
|
undefined4 unaff_EBP;
|
|
|
|
undefined1 auStack_130 [3];
|
|
|
|
undefined1 local_12d;
|
|
|
|
undefined1 auStack_12c [4];
|
|
|
|
undefined1 auStack_128 [4];
|
|
|
|
undefined1 auStack_124 [144];
|
|
|
|
undefined1 auStack_94 [148];
|
|
|
|
|
|
|
|
if (((*(int *)(param_1 + 0x608) != 0) && (*(int *)(param_1 + 0x60c) != 0)) &&
|
|
|
|
(*(int *)(param_1 + 0x610) != 0)) {
|
|
|
|
local_12d = 0;
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005583f0(uVar5);
|
|
|
|
if (((iVar2 == 0) || (iVar2 = FUN_0058dc30(0x1000000,0), iVar2 == 0)) ||
|
|
|
|
((piVar3 = (int *)FUN_005583f0(iVar2), piVar3 == (int *)0x0 ||
|
|
|
|
(((**(code **)(*piVar3 + 0x18))(), -1 < extraout_AH || (piVar3[0x44] == 0)))))) {
|
|
|
|
*(undefined4 *)(param_1 + 0x620) = 0;
|
|
|
|
*(undefined4 *)(param_1 + 0x624) = 0;
|
|
|
|
iVar2 = FUN_004c6500();
|
|
|
|
*(undefined1 *)(iVar2 * 0x1c + 0x640 + param_1) = 0;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x608) + 0x18))(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
local_12d = 1;
|
|
|
|
iVar4 = FUN_004c6500();
|
|
|
|
if (*(int *)(iVar4 * 0x1c + 0x634 + param_1) == 0) {
|
|
|
|
iVar4 = FUN_004c6500();
|
|
|
|
*(undefined1 *)(iVar4 * 0x1c + param_1 + 0x640) = 1;
|
|
|
|
FUN_004c66f0(0);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x620) = iVar2;
|
|
|
|
*(int *)(param_1 + 0x624) = piVar3[0x44];
|
|
|
|
FUN_006a0660();
|
|
|
|
iVar2 = FUN_00567c00();
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_00569990(*(undefined4 *)(param_1 + 0x624));
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_006a0570(1);
|
|
|
|
iVar4 = FUN_005df0f5(0xc);
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
uVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = FUN_00694a00(iVar2);
|
|
|
|
}
|
|
|
|
FUN_006a0610(uVar5);
|
|
|
|
}
|
|
|
|
FUN_006a0660();
|
|
|
|
FUN_006a0570(1);
|
|
|
|
iVar2 = FUN_005df0f5(0xc);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
uVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = FUN_0058f490();
|
|
|
|
uVar5 = FUN_00694a00(uVar5);
|
|
|
|
}
|
|
|
|
FUN_006a0610(uVar5);
|
|
|
|
iVar2 = FUN_004c6500();
|
|
|
|
if (*(char *)(iVar2 * 0x1c + 0x640 + param_1) == '\0') {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x18))(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x18))(1);
|
|
|
|
}
|
|
|
|
FUN_0048b420();
|
|
|
|
FUN_00567eb0(*(undefined4 *)(param_1 + 0x624),auStack_94);
|
|
|
|
piVar3 = (int *)FUN_00597d40(auStack_128);
|
|
|
|
puVar6 = (undefined4 *)FUN_0058f8b0(auStack_12c,2,0);
|
|
|
|
FUN_00480980(auStack_130,0,L"%s (%hs)\nDouble-click to cast this spell",*puVar6,*piVar3 + 0x14
|
|
|
|
);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_005abb30();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(auStack_130,1);
|
|
|
|
FUN_004618a0(auStack_124);
|
|
|
|
puVar1 = (uint *)(*(int *)(param_1 + 0x608) + 0xa4);
|
|
|
|
*puVar1 = *puVar1 | 0x20;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x608) + 0x18))(1);
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_0048b4d0();
|
|
|
|
}
|
|
|
|
*(char *)(param_1 + 0x61c) = (char)((uint)unaff_EBP >> 0x18);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c7000 at 0x004C7000 (size: 165) ---
|
|
|
|
|
|
void __thiscall FUN_004c7000(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int **ppiVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
int *local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
ppiVar6 = &local_14;
|
|
|
|
puVar4 = local_10;
|
|
|
|
puVar5 = &DAT_007b6ec8;
|
|
|
|
local_14 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007b6ec8,ppiVar6);
|
|
|
|
FUN_00406570(puVar4,puVar5,ppiVar6);
|
|
|
|
piVar2 = local_14;
|
|
|
|
uVar7 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar3 = local_14;
|
|
|
|
if (local_14 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_14 + 0x10))(local_14,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_00485260(local_c,piVar3,uVar7);
|
|
|
|
iVar1 = *piVar3;
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
if (local_8 != (int *)0x0) {
|
|
|
|
if (-1 < iVar1) {
|
|
|
|
FUN_005d5a60(param_2,*(undefined4 *)(param_1 + 0x14));
|
|
|
|
FUN_006a26b0(param_2,*(undefined4 *)(param_1 + 0x14));
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c70b0 at 0x004C70B0 (size: 171) ---
|
|
|
|
|
|
void __thiscall FUN_004c70b0(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int **ppiVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
int *local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
ppiVar6 = &local_14;
|
|
|
|
puVar4 = local_10;
|
|
|
|
puVar5 = &DAT_007b6ec8;
|
|
|
|
local_14 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007b6ec8,ppiVar6);
|
|
|
|
FUN_00406570(puVar4,puVar5,ppiVar6);
|
|
|
|
piVar2 = local_14;
|
|
|
|
uVar7 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar3 = local_14;
|
|
|
|
if (local_14 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_14 + 0x10))(local_14,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_00485260(local_c,piVar3,uVar7);
|
|
|
|
iVar1 = *piVar3;
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
if (local_8 != (int *)0x0) {
|
|
|
|
if (-1 < iVar1) {
|
|
|
|
FUN_005d5460(param_2,param_3,*(undefined4 *)(param_1 + 0x14));
|
|
|
|
FUN_006a1d90(param_2,param_3,*(undefined4 *)(param_1 + 0x14));
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c7160 at 0x004C7160 (size: 879) ---
|
|
|
|
|
|
void __fastcall FUN_004c7160(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
void *pvVar1;
|
|
|
|
char cVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int iVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
int iVar6;
|
|
|
|
int *piVar7;
|
|
|
|
LONG LVar8;
|
|
|
|
undefined4 *puVar9;
|
|
|
|
undefined4 *puVar10;
|
|
|
|
void *pvVar11;
|
|
|
|
undefined4 *puVar12;
|
|
|
|
undefined4 **ppuVar13;
|
|
|
|
undefined1 *puVar14;
|
|
|
|
undefined *puVar15;
|
|
|
|
int **ppiVar16;
|
|
|
|
undefined4 uVar17;
|
|
|
|
int *local_148;
|
|
|
|
undefined4 *local_144;
|
|
|
|
int local_140;
|
|
|
|
int *piStack_13c;
|
|
|
|
undefined4 uStack_138;
|
|
|
|
int *local_134;
|
|
|
|
undefined4 local_130;
|
|
|
|
undefined1 auStack_12c [4];
|
|
|
|
undefined4 *puStack_128;
|
|
|
|
undefined1 local_124 [4];
|
|
|
|
undefined **ppuStack_120;
|
|
|
|
undefined4 *puStack_11c;
|
|
|
|
undefined4 *puStack_118;
|
|
|
|
undefined **ppuStack_e4;
|
|
|
|
undefined1 auStack_90 [144];
|
|
|
|
|
|
|
|
*(undefined4 *)(param_1 + 0x10) = 0;
|
|
|
|
local_140 = param_1;
|
|
|
|
FUN_004e49f0();
|
|
|
|
ppiVar16 = &local_148;
|
|
|
|
ppuVar13 = &local_144;
|
|
|
|
puVar15 = &DAT_007b6ec8;
|
|
|
|
local_148 = (int *)0x0;
|
|
|
|
FUN_00406d10(ppuVar13,&DAT_007b6ec8,ppiVar16);
|
|
|
|
FUN_00406570(ppuVar13,puVar15,ppiVar16);
|
|
|
|
piVar7 = local_148;
|
|
|
|
uVar17 = 0;
|
|
|
|
local_134 = (int *)0x0;
|
|
|
|
local_130 = 0;
|
|
|
|
piVar3 = local_148;
|
|
|
|
if (local_148 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_148 + 0x10))(local_148,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_00485260(local_124,piVar3,uVar17);
|
|
|
|
iVar4 = *piVar3;
|
|
|
|
if (piVar7 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar7 + 0x14))();
|
|
|
|
}
|
|
|
|
if (local_134 == (int *)0x0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (iVar4 < 0) goto LAB_004c74a2;
|
|
|
|
local_144 = (undefined4 *)FUN_005d39f0(*(undefined4 *)(param_1 + 0x14));
|
|
|
|
puVar12 = (undefined4 *)local_144[1];
|
|
|
|
ppiVar16 = &local_148;
|
|
|
|
puVar14 = local_124;
|
|
|
|
puVar15 = &DAT_007b6e98;
|
|
|
|
local_148 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar14,&DAT_007b6e98,ppiVar16);
|
|
|
|
FUN_00406570(puVar14,puVar15,ppiVar16);
|
|
|
|
piVar7 = local_148;
|
|
|
|
uVar17 = 0;
|
|
|
|
piStack_13c = (int *)0x0;
|
|
|
|
uStack_138 = 0;
|
|
|
|
piVar3 = local_148;
|
|
|
|
if (local_148 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_148 + 0x10))(local_148,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_0048bb00(auStack_12c,piVar3,uVar17);
|
|
|
|
iVar4 = *piVar3;
|
|
|
|
if (piVar7 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar7 + 0x14))();
|
|
|
|
}
|
|
|
|
if (piStack_13c == (int *)0x0) {
|
|
|
|
LAB_004c7275:
|
|
|
|
(**(code **)(*local_134 + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (iVar4 < 0) {
|
|
|
|
(**(code **)(*piStack_13c + 0x14))();
|
|
|
|
goto LAB_004c7275;
|
|
|
|
}
|
|
|
|
puVar9 = (undefined4 *)0x0;
|
|
|
|
puVar10 = (undefined4 *)0x0;
|
|
|
|
piVar7 = piStack_13c;
|
|
|
|
if (puVar12 != (undefined4 *)0x0) {
|
|
|
|
do {
|
|
|
|
iVar4 = FUN_0058fcf0(*puVar12);
|
|
|
|
puVar5 = puVar10;
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
uVar17 = *puVar12;
|
|
|
|
puVar5 = (undefined4 *)FUN_005df0f5(8);
|
|
|
|
if (puVar5 == (undefined4 *)0x0) {
|
|
|
|
puVar5 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*puVar5 = uVar17;
|
|
|
|
puVar5[1] = puVar10;
|
|
|
|
}
|
|
|
|
piVar7 = piStack_13c;
|
|
|
|
if (puVar9 == (undefined4 *)0x0) {
|
|
|
|
puVar9 = puVar5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puVar12 = (undefined4 *)puVar12[1];
|
|
|
|
puVar10 = puVar5;
|
|
|
|
} while (puVar12 != (undefined4 *)0x0);
|
|
|
|
while (puVar5 != (undefined4 *)0x0) {
|
|
|
|
puVar12 = (undefined4 *)puVar5[1];
|
|
|
|
uVar17 = *puVar5;
|
|
|
|
operator_delete(puVar5);
|
|
|
|
FUN_004c7000(uVar17);
|
|
|
|
puVar5 = puVar12;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pvVar11 = (void *)0x0;
|
|
|
|
puStack_128 = (undefined4 *)local_144[1];
|
|
|
|
iVar4 = local_140;
|
|
|
|
while (local_140 = iVar4, puStack_128 != (undefined4 *)0x0) {
|
|
|
|
iVar6 = FUN_004e4d30(*puStack_128);
|
|
|
|
*(int *)(iVar4 + 0x10) = *(int *)(iVar4 + 0x10) + 1;
|
|
|
|
iVar4 = FUN_00567c00();
|
|
|
|
if (iVar4 == 0) goto joined_r0x004c74b6;
|
|
|
|
FUN_0048b420();
|
|
|
|
cVar2 = FUN_00567eb0(*puStack_128,&ppuStack_120);
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
piVar7 = (int *)FUN_00597d40(&local_144);
|
|
|
|
FUN_00480980(&local_148,0,L"%hs\nDouble-click to cast this spell",*piVar7 + 0x14);
|
|
|
|
puVar12 = local_144;
|
|
|
|
LVar8 = InterlockedDecrement(local_144 + 1);
|
|
|
|
if ((LVar8 == 0) && (puVar12 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar12)(1);
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&local_148,1);
|
|
|
|
FUN_004618a0(auStack_90);
|
|
|
|
*(uint *)(iVar6 + 0xa4) = *(uint *)(iVar6 + 0xa4) | 0x20;
|
|
|
|
FUN_0042e590();
|
|
|
|
piVar7 = local_148 + -5;
|
|
|
|
LVar8 = InterlockedDecrement(local_148 + -4);
|
|
|
|
if ((LVar8 == 0) && (piVar7 != (int *)0x0)) {
|
|
|
|
(**(code **)*piVar7)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_00599890();
|
|
|
|
puVar12 = puStack_118;
|
|
|
|
ppuStack_e4 = &PTR_FUN_0079385c;
|
|
|
|
LVar8 = InterlockedDecrement(puStack_118 + 1);
|
|
|
|
if ((LVar8 == 0) && (puVar12 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar12)(1);
|
|
|
|
}
|
|
|
|
puVar12 = puStack_11c;
|
|
|
|
LVar8 = InterlockedDecrement(puStack_11c + 1);
|
|
|
|
if ((LVar8 == 0) && (puVar12 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar12)(1);
|
|
|
|
}
|
|
|
|
puStack_128 = (undefined4 *)puStack_128[1];
|
|
|
|
ppuStack_120 = &PTR_FUN_0079385c;
|
|
|
|
piVar7 = piStack_13c;
|
|
|
|
iVar4 = local_140;
|
|
|
|
}
|
|
|
|
FUN_004c66f0(*(undefined4 *)(iVar4 + 0xc));
|
|
|
|
FUN_004c67d0();
|
|
|
|
while (pvVar11 != (void *)0x0) {
|
|
|
|
pvVar1 = *(void **)((int)pvVar11 + 4);
|
|
|
|
operator_delete(pvVar11);
|
|
|
|
pvVar11 = pvVar1;
|
|
|
|
}
|
|
|
|
iVar4 = *piVar7;
|
|
|
|
LAB_004c749b:
|
|
|
|
(**(code **)(iVar4 + 0x14))();
|
|
|
|
LAB_004c74a2:
|
|
|
|
(**(code **)(*local_134 + 0x14))();
|
|
|
|
return;
|
|
|
|
joined_r0x004c74b6:
|
|
|
|
while (pvVar11 != (void *)0x0) {
|
|
|
|
pvVar1 = *(void **)((int)pvVar11 + 4);
|
|
|
|
operator_delete(pvVar11);
|
|
|
|
pvVar11 = pvVar1;
|
|
|
|
}
|
|
|
|
iVar4 = *piStack_13c;
|
|
|
|
goto LAB_004c749b;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c74e0 at 0x004C74E0 (size: 161) ---
|
|
|
|
|
|
int __thiscall FUN_004c74e0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
|
|
|
|
if (param_2 == 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar5 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
do {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar5);
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
iVar4 = FUN_004e1e20();
|
|
|
|
if ((iVar4 == 0x1000001d) && (*(int *)(iVar3 + 0x600) == param_2)) {
|
|
|
|
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + -1;
|
|
|
|
FUN_004c7000(param_2);
|
|
|
|
FUN_004c7160();
|
|
|
|
if (param_2 == *(int *)(param_1 + 0xc)) {
|
|
|
|
FUN_004c66f0(0);
|
|
|
|
}
|
|
|
|
return iVar5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
} while (iVar5 < iVar1);
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c7620 at 0x004C7620 (size: 1574) ---
|
|
|
|
|
|
void __fastcall FUN_004c7620(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint *puVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
int iVar8;
|
|
|
|
undefined *puVar9;
|
|
|
|
char cVar10;
|
|
|
|
int iVar11;
|
|
|
|
undefined4 uVar12;
|
|
|
|
int *piVar13;
|
|
|
|
LONG LVar14;
|
|
|
|
int iVar15;
|
|
|
|
undefined4 *puVar16;
|
|
|
|
code *pcVar17;
|
|
|
|
wchar_t *pwVar18;
|
|
|
|
undefined4 *puStack_a8;
|
|
|
|
undefined *puStack_a4;
|
|
|
|
undefined4 *puStack_a0;
|
|
|
|
int iStack_9c;
|
|
|
|
int local_98;
|
|
|
|
undefined1 auStack_94 [24];
|
|
|
|
byte bStack_7c;
|
|
|
|
|
|
|
|
local_98 = FUN_00567c00();
|
|
|
|
if (local_98 == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar15 = *(int *)(param_1 + 0x68c);
|
|
|
|
iVar2 = *(int *)(param_1 + 0x6a8);
|
|
|
|
iVar3 = *(int *)(param_1 + 0x6c4);
|
|
|
|
iVar4 = *(int *)(param_1 + 0x670);
|
|
|
|
iVar5 = *(int *)(param_1 + 0x654);
|
|
|
|
iVar6 = *(int *)(param_1 + 0x638);
|
|
|
|
iVar7 = *(int *)(param_1 + 0x6e0);
|
|
|
|
iVar8 = *(int *)(param_1 + 0x6fc);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(0xd);
|
|
|
|
puVar1 = (uint *)(*(int *)(param_1 + 0x604) + 0xa4);
|
|
|
|
*puVar1 = *puVar1 & 0xffffffdf;
|
|
|
|
FUN_004626c0();
|
|
|
|
iVar11 = FUN_004c6500();
|
|
|
|
iVar11 = *(int *)(iVar11 * 0x1c + 0x634 + param_1);
|
|
|
|
puStack_a4 = PTR_DAT_00818340;
|
|
|
|
local_98 = iVar11;
|
|
|
|
InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));
|
|
|
|
FUN_00467ae0();
|
|
|
|
puVar9 = PTR_DAT_00818340;
|
|
|
|
InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));
|
|
|
|
if (*(int *)(param_1 + 0x620) == 0) {
|
|
|
|
if (iVar11 != 0) {
|
|
|
|
LAB_004c794e:
|
|
|
|
FUN_0048b420();
|
|
|
|
cVar10 = FUN_00567eb0(iVar11,auStack_94);
|
|
|
|
if (cVar10 != '\0') {
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a0);
|
|
|
|
piVar13 = (int *)FUN_00404a40(0,*piVar13 + 0x14);
|
|
|
|
if (puStack_a4 != (undefined *)*piVar13) {
|
|
|
|
puVar16 = (undefined4 *)(puStack_a4 + -0x14);
|
|
|
|
LVar14 = InterlockedDecrement((LONG *)(puStack_a4 + -0x10));
|
|
|
|
if ((LVar14 == 0) && (puVar16 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar16)(1);
|
|
|
|
}
|
|
|
|
puStack_a4 = (undefined *)*piVar13;
|
|
|
|
InterlockedIncrement((LONG *)(puStack_a4 + -0x10));
|
|
|
|
}
|
|
|
|
puVar16 = puStack_a8 + -5;
|
|
|
|
LVar14 = InterlockedDecrement(puStack_a8 + -4);
|
|
|
|
if ((LVar14 == 0) && (puVar16 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar16)(1);
|
|
|
|
}
|
|
|
|
LVar14 = InterlockedDecrement(puStack_a0 + 1);
|
|
|
|
if ((LVar14 == 0) && (puStack_a0 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_a0)(1);
|
|
|
|
}
|
|
|
|
iVar15 = FUN_00598410();
|
|
|
|
if ((iVar15 == 0) && ((bStack_7c & 8) == 0)) {
|
|
|
|
if (DAT_00871e54 == 0) {
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a8);
|
|
|
|
iVar15 = *piVar13;
|
|
|
|
pwVar18 = L"You must select a target for %hs";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_00567c00();
|
|
|
|
cVar10 = FUN_005689d0(DAT_00871e54,local_98,1,0);
|
|
|
|
if (cVar10 != '\0') {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a8);
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"CAST %hs",*piVar13 + 0x14);
|
|
|
|
FUN_005abb30();
|
|
|
|
iVar15 = FUN_005583f0(DAT_00871e54);
|
|
|
|
if (iVar15 != 0) {
|
|
|
|
puVar16 = (undefined4 *)FUN_0058f8b0(&puStack_a8,2,0);
|
|
|
|
FUN_004300a0(&stack0xffffff54,L" on %s",*puVar16);
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
goto LAB_004c7b77;
|
|
|
|
}
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a8);
|
|
|
|
iVar15 = *piVar13;
|
|
|
|
pwVar18 = L"You must select an appropriate target for %hs";
|
|
|
|
}
|
|
|
|
FUN_004027b0(&stack0xffffff54,pwVar18,iVar15 + 0x14);
|
|
|
|
FUN_005abb30();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a8);
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"CAST %hs",*piVar13 + 0x14);
|
|
|
|
LVar14 = InterlockedDecrement(puStack_a8 + 1);
|
|
|
|
if ((LVar14 == 0) && (puStack_a8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_a8)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
goto LAB_004c7b77;
|
|
|
|
}
|
|
|
|
if ((*(char *)(param_1 + 0x61c) == '\0') &&
|
|
|
|
(iVar6 + iVar5 + iVar4 + iVar15 + iVar2 + iVar3 + iVar7 + iVar8 == 0)) {
|
|
|
|
FUN_00407e40(L"You have no spells ready to cast");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_00407e40(L"Select a spell to cast");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (iVar11 != 0) goto LAB_004c794e;
|
|
|
|
iVar15 = FUN_005583f0(*(int *)(param_1 + 0x620));
|
|
|
|
pcVar17 = InterlockedDecrement_exref;
|
|
|
|
if (iVar15 == 0) {
|
|
|
|
LVar14 = InterlockedDecrement((LONG *)(puVar9 + -0x10));
|
|
|
|
if ((LVar14 == 0) && ((undefined4 *)(puVar9 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(puVar9 + -0x14))(1);
|
|
|
|
}
|
|
|
|
goto LAB_004c7c29;
|
|
|
|
}
|
|
|
|
FUN_0048b420();
|
|
|
|
cVar10 = FUN_00567eb0(*(undefined4 *)(param_1 + 0x624),auStack_94);
|
|
|
|
if (cVar10 != '\0') {
|
|
|
|
piVar13 = (int *)FUN_00597d40(&puStack_a0);
|
|
|
|
puVar16 = (undefined4 *)FUN_0058f8b0(&local_98,2,0);
|
|
|
|
uVar12 = FUN_00480980(&iStack_9c,0,L"%s (%hs)",*puVar16,*piVar13 + 0x14);
|
|
|
|
FUN_00402070(uVar12);
|
|
|
|
LVar14 = InterlockedDecrement((LONG *)(iStack_9c + -0x10));
|
|
|
|
if ((LVar14 == 0) && ((undefined4 *)(iStack_9c + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(iStack_9c + -0x14))(1);
|
|
|
|
}
|
|
|
|
puVar16 = (undefined4 *)(local_98 + -0x14);
|
|
|
|
LVar14 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar14 == 0) && (puVar16 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar16)(1);
|
|
|
|
}
|
|
|
|
LVar14 = InterlockedDecrement(puStack_a0 + 1);
|
|
|
|
if ((LVar14 == 0) && (puStack_a0 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puStack_a0)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004fd850(*(undefined4 *)(iVar15 + 0xd8));
|
|
|
|
iVar15 = FUN_004fd8d0();
|
|
|
|
if (iVar15 == 0) {
|
|
|
|
if (DAT_00871e54 == 0) {
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"You must select a target for the %s",puStack_a4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
cVar10 = FUN_00588350(DAT_00871e54,*(undefined4 *)(param_1 + 0x620),1,0);
|
|
|
|
if (cVar10 == '\0') {
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"You must select an appropriate\ntarget for the %s",
|
|
|
|
puStack_a4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"USE the %s",puStack_a4);
|
|
|
|
iVar15 = FUN_005583f0(DAT_00871e54);
|
|
|
|
if (iVar15 != 0) {
|
|
|
|
puVar16 = (undefined4 *)FUN_0058f8b0(&puStack_a0,2,0);
|
|
|
|
FUN_004300a0(&stack0xffffff54,L" on %s",*puVar16);
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
FUN_004027b0(&stack0xffffff54,L"USE the %s",puStack_a4);
|
|
|
|
}
|
|
|
|
LAB_004c7b77:
|
|
|
|
FUN_0048b4d0();
|
|
|
|
}
|
|
|
|
if (*(int *)(puVar9 + -4) == 1) {
|
|
|
|
puVar1 = (uint *)(*(int *)(param_1 + 0x604) + 0xa4);
|
|
|
|
*puVar1 = *puVar1 & 0xffffffdf;
|
|
|
|
FUN_004626c0();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_0046a740(&puStack_a4);
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&stack0xffffff54,1);
|
|
|
|
FUN_004618a0(auStack_94);
|
|
|
|
*(uint *)(*(int *)(param_1 + 0x604) + 0xa4) = *(uint *)(*(int *)(param_1 + 0x604) + 0xa4) | 0x20
|
|
|
|
;
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
pcVar17 = InterlockedDecrement_exref;
|
|
|
|
LVar14 = InterlockedDecrement((LONG *)(puVar9 + -0x10));
|
|
|
|
if ((LVar14 == 0) && ((undefined4 *)(puVar9 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(puVar9 + -0x14))(1);
|
|
|
|
}
|
|
|
|
LAB_004c7c29:
|
|
|
|
puVar16 = (undefined4 *)(puStack_a4 + -0x14);
|
|
|
|
iVar15 = (*pcVar17)(puStack_a4 + -0x10);
|
|
|
|
if ((iVar15 == 0) && (puVar16 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar16)(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c7c50 at 0x004C7C50 (size: 526) ---
|
|
|
|
|
|
void __thiscall FUN_004c7c50(int param_1,int param_2,int param_3,char param_4)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int *piVar6;
|
|
|
|
int **ppiVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
int *local_134;
|
|
|
|
undefined1 local_130 [4];
|
|
|
|
int *local_12c;
|
|
|
|
undefined4 local_128;
|
|
|
|
undefined1 local_124 [4];
|
|
|
|
undefined1 auStack_120 [144];
|
|
|
|
undefined1 auStack_90 [144];
|
|
|
|
|
|
|
|
ppiVar7 = &local_134;
|
|
|
|
puVar4 = local_130;
|
|
|
|
puVar5 = &DAT_007b6ec8;
|
|
|
|
local_134 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007b6ec8,ppiVar7);
|
|
|
|
FUN_00406570(puVar4,puVar5,ppiVar7);
|
|
|
|
piVar3 = local_134;
|
|
|
|
uVar8 = 0;
|
|
|
|
local_12c = (int *)0x0;
|
|
|
|
local_128 = 0;
|
|
|
|
piVar6 = local_134;
|
|
|
|
if (local_134 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_134 + 0x10))(local_134,0);
|
|
|
|
}
|
|
|
|
local_134 = (int *)FUN_00485260(local_124,piVar6,uVar8);
|
|
|
|
local_134 = (int *)*local_134;
|
|
|
|
if (piVar3 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar3 = local_12c;
|
|
|
|
if (local_12c == (int *)0x0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (-1 < (int)local_134) {
|
|
|
|
iVar2 = FUN_005d39f0(*(undefined4 *)(param_1 + 0x14));
|
|
|
|
if (param_4 == '\0') {
|
|
|
|
for (piVar6 = *(int **)(iVar2 + 4); piVar6 != (int *)0x0; piVar6 = (int *)piVar6[1]) {
|
|
|
|
if (*piVar6 == param_2) {
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (param_2 != 0) {
|
|
|
|
iVar2 = FUN_004c74e0(param_2);
|
|
|
|
if ((iVar2 != -1) && (iVar2 < param_3)) {
|
|
|
|
param_3 = param_3 + -1;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_004e4e40(param_2,param_3);
|
|
|
|
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
|
|
|
|
local_134 = (int *)FUN_00567c00();
|
|
|
|
if (local_134 != (int *)0x0) {
|
|
|
|
FUN_0048b420();
|
|
|
|
cVar1 = FUN_00567eb0(param_2,auStack_90);
|
|
|
|
if (cVar1 != '\0') {
|
|
|
|
piVar3 = (int *)FUN_00597d40(local_130);
|
|
|
|
FUN_00480980(&local_134,0,L"%hs\nDouble-click to cast this spell",*piVar3 + 0x14);
|
|
|
|
FUN_005abb30();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&local_134,1);
|
|
|
|
FUN_004618a0(auStack_120);
|
|
|
|
*(uint *)(iVar2 + 0xa4) = *(uint *)(iVar2 + 0xa4) | 0x20;
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
}
|
|
|
|
if (param_3 == -1) {
|
|
|
|
param_3 = *(int *)(param_1 + 0x10);
|
|
|
|
}
|
|
|
|
FUN_004c70b0(param_2,param_3);
|
|
|
|
FUN_004c66f0(param_2);
|
|
|
|
FUN_004c67d0();
|
|
|
|
FUN_0048b4d0();
|
|
|
|
(**(code **)(*local_12c + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(**(code **)(*local_12c + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar3 + 0x14))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c7f10 at 0x004C7F10 (size: 58) ---
|
|
|
|
|
|
void FUN_004c7f10(undefined4 param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c6500(param_1,param_2,param_3);
|
|
|
|
FUN_004c7c50(param_1,param_2,param_3);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8330 at 0x004C8330 (size: 43) ---
|
|
|
|
|
|
void __fastcall FUN_004c8330(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (*(int *)(param_1 + 4) != 0) {
|
|
|
|
FUN_0046c110(0x100000a3);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8360 at 0x004C8360 (size: 43) ---
|
|
|
|
|
|
void __fastcall FUN_004c8360(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (*(int *)(param_1 + 4) != 0) {
|
|
|
|
FUN_0046c110(0x100005c2);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8410 at 0x004C8410 (size: 130) ---
|
|
|
|
|
|
void __fastcall FUN_004c8410(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
FUN_004c6500();
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
if (0 < iVar1) {
|
|
|
|
iVar1 = iVar1 + -1;
|
|
|
|
FUN_004c6500(iVar1);
|
|
|
|
FUN_004c6780(iVar1);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*(char *)(param_1 + 0x24) != '\0') {
|
|
|
|
iVar1 = FUN_004c6500();
|
|
|
|
*(undefined1 *)(iVar1 * 0x1c + param_1 + 0x48) = 1;
|
|
|
|
FUN_004c66f0(0);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8520 at 0x004C8520 (size: 315) ---
|
|
|
|
|
|
void __thiscall FUN_004c8520(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
char cVar2;
|
|
|
|
int iVar3;
|
|
|
|
int *piVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
undefined4 unaff_retaddr;
|
|
|
|
undefined4 uVar6;
|
|
|
|
undefined1 local_8 [4];
|
|
|
|
undefined1 local_4 [4];
|
|
|
|
|
|
|
|
iVar3 = *(int *)(*(int *)(param_2 + 0xc) + 8);
|
|
|
|
iVar1 = *(int *)(*(int *)(param_2 + 0xc) + 0x10);
|
|
|
|
if ((iVar3 != 0) && (iVar1 != 0)) {
|
|
|
|
FUN_004e3380(iVar3,local_4,¶m_2,local_8);
|
|
|
|
iVar3 = FUN_004c6500();
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(iVar3 * 0x1c + 0x62c + param_1));
|
|
|
|
if (cVar2 == '\0') {
|
|
|
|
if (iVar1 == *(int *)(param_1 + 0x618)) {
|
|
|
|
FUN_004c7f10(param_2,0xffffffff,1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar3 = 0;
|
|
|
|
piVar4 = (int *)(param_1 + 0x630);
|
|
|
|
while (iVar1 != *piVar4) {
|
|
|
|
iVar3 = iVar3 + 1;
|
|
|
|
piVar4 = piVar4 + 7;
|
|
|
|
if (7 < iVar3) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (param_2 != 0) {
|
|
|
|
FUN_004c7c50(param_2,0xffffffff,1);
|
|
|
|
FUN_004c6d10();
|
|
|
|
FUN_004c7620();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (param_2 != 0) {
|
|
|
|
FUN_004c6500();
|
|
|
|
piVar4 = (int *)FUN_0046e5e0();
|
|
|
|
if (piVar4 != (int *)0x0) {
|
|
|
|
iVar3 = (**(code **)(*piVar4 + 0x94))(0x10000032);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
uVar6 = 1;
|
|
|
|
FUN_004c6500(iVar3,1);
|
|
|
|
uVar5 = FUN_00480780(iVar3);
|
|
|
|
FUN_004c7f10(unaff_retaddr,uVar5,uVar6);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8860 at 0x004C8860 (size: 55) ---
|
|
|
|
|
|
void __thiscall FUN_004c8860(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00463830(param_2);
|
|
|
|
if (((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) && ((char)param_2 == '\0')) {
|
|
|
|
param_1 = param_1 + 0x6e4;
|
|
|
|
FUN_0055e1d0(param_1);
|
|
|
|
FUN_0055f930(param_1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c88d0 at 0x004C88D0 (size: 79) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c88d0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6f0) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x6f4) == 0) {
|
|
|
|
iVar1 = FUN_005df0f5(0x4c);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
iVar1 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = FUN_005bce40(*(undefined4 *)(param_1 + 0x6f0));
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x6f4) = iVar1;
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005bcb30(*(int *)(param_1 + 0x6f0));
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8920 at 0x004C8920 (size: 46) ---
|
|
|
|
|
|
uint __fastcall FUN_004c8920(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
uint in_EAX;
|
|
|
|
|
|
|
|
iVar1 = *(int *)(param_1 + 0x6f0);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return in_EAX & 0xffffff00;
|
|
|
|
}
|
|
|
|
if (DAT_0083da58 != 0) {
|
|
|
|
return CONCAT31((int3)((uint)*(int *)(DAT_0083da58 + 0xf4) >> 8),
|
|
|
|
*(int *)(iVar1 + 8) == *(int *)(DAT_0083da58 + 0xf4));
|
|
|
|
}
|
|
|
|
return (uint)(*(int *)(iVar1 + 8) == 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8950 at 0x004C8950 (size: 47) ---
|
|
|
|
|
|
uint __fastcall FUN_004c8950(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
undefined3 uVar2;
|
|
|
|
|
|
|
|
uVar1 = *(uint *)(param_1 + 0x6f0);
|
|
|
|
if (uVar1 != 0) {
|
|
|
|
uVar2 = (undefined3)(uVar1 >> 8);
|
|
|
|
if (*(int *)(param_1 + 0x6f8) == 1) {
|
|
|
|
return CONCAT31(uVar2,*(int *)(uVar1 + 8) == 0);
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x6f8) == 2) {
|
|
|
|
return CONCAT31(uVar2,*(int *)(uVar1 + 8) != 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return uVar1 & 0xffffff00;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8980 at 0x004C8980 (size: 42) ---
|
|
|
|
|
|
bool __thiscall FUN_004c8980(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6f0) != 0) {
|
|
|
|
iVar1 = FUN_005bc930(*(undefined4 *)(param_1 + 0x6f8),param_2);
|
|
|
|
return iVar1 != 0;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c89b0 at 0x004C89B0 (size: 42) ---
|
|
|
|
|
|
bool __thiscall FUN_004c89b0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6f0) != 0) {
|
|
|
|
iVar1 = FUN_005bc9f0(*(undefined4 *)(param_1 + 0x6f8),param_2);
|
|
|
|
return iVar1 != 0;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c89e0 at 0x004C89E0 (size: 184) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004c89e0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_0046c550(param_2,param_3);
|
|
|
|
param_1[0x1b8] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x1b9] = &PTR_LAB_007b405c;
|
|
|
|
param_1[0x1ba] = &PTR_LAB_007acb10;
|
|
|
|
param_1[0x1bb] = 0;
|
|
|
|
param_1[0x1bc] = 0;
|
|
|
|
param_1[0x1bd] = 0;
|
|
|
|
param_1[0x1be] = 0;
|
|
|
|
param_1[0x1bf] = 0;
|
|
|
|
param_1[0x1c0] = 0;
|
|
|
|
param_1[0x1c1] = 0;
|
|
|
|
param_1[0x1c2] = 0;
|
|
|
|
param_1[0x1c3] = 0;
|
|
|
|
param_1[0x1c4] = 0;
|
|
|
|
param_1[0x1c5] = 0;
|
|
|
|
param_1[0x1c6] = 0;
|
|
|
|
param_1[0x1c7] = 0;
|
|
|
|
param_1[0x1c8] = 0;
|
|
|
|
param_1[0x1c9] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b7b70;
|
|
|
|
param_1[0x1b8] = &PTR_FUN_007b78c8;
|
|
|
|
param_1[0x1b9] = &PTR_LAB_007b78c0;
|
|
|
|
param_1[0x1ba] = &PTR_LAB_007b78bc;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8ad0 at 0x004C8AD0 (size: 173) ---
|
|
|
|
|
|
void __fastcall FUN_004c8ad0(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
|
|
|
|
puVar3 = param_1 + 0x1b9;
|
|
|
|
puVar1 = param_1 + 0x1b8;
|
|
|
|
*param_1 = &PTR_FUN_007b7b70;
|
|
|
|
*puVar1 = &PTR_FUN_007b78c8;
|
|
|
|
*puVar3 = &PTR_LAB_007b78c0;
|
|
|
|
param_1[0x1ba] = &PTR_LAB_007b78bc;
|
|
|
|
FUN_0055e1d0(puVar3);
|
|
|
|
FUN_0055f930(puVar3);
|
|
|
|
if (param_1[0x1c2] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
if (param_1[0x1c6] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
FUN_00478560(param_1[0x1c8]);
|
|
|
|
param_1[0x1c8] = 0;
|
|
|
|
FUN_00478560(param_1[0x1c9]);
|
|
|
|
param_1[0x1c9] = 0;
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_0046c5d0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8bd0 at 0x004C8BD0 (size: 156) ---
|
|
|
|
|
|
void __fastcall FUN_004c8bd0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6f8) == 0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x70c) + 0x9c))(0xd);
|
|
|
|
goto LAB_004c8bed;
|
|
|
|
}
|
|
|
|
iVar1 = *(int *)(param_1 + 0x6f0);
|
|
|
|
if (((iVar1 == 0) || (*(int *)(iVar1 + 8) != 0)) || (iVar1 == 0)) {
|
|
|
|
LAB_004c8c3b:
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x70c) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = FUN_005bc900(1);
|
|
|
|
if (iVar1 == 0) goto LAB_004c8c3b;
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x70c) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
if (0 < iVar1) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x71c) + 0x9c))(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
LAB_004c8bed:
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x71c) + 0x9c))(0xd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8c70 at 0x004C8C70 (size: 112) ---
|
|
|
|
|
|
void __fastcall FUN_004c8c70(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004cbe60(*(undefined4 *)(param_1 + 0x708));
|
|
|
|
FUN_004e49f0();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x70c) + 0x9c))(0xd);
|
|
|
|
FUN_004cbe60(*(undefined4 *)(param_1 + 0x718));
|
|
|
|
FUN_004e49f0();
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x71c) + 0x9c))(0xd);
|
|
|
|
if (*(int *)(param_1 + 0x6f0) != 0) {
|
|
|
|
FUN_005bb7c0();
|
|
|
|
FUN_005bb7c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8ce0 at 0x004C8CE0 (size: 178) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c8ce0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined1 local_18 [4];
|
|
|
|
undefined4 local_14;
|
|
|
|
undefined4 local_10;
|
|
|
|
|
|
|
|
if (param_2 != 0) {
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if ((iVar2 < 1) && (*(int *)(param_1 + 0x6fc) != 0)) {
|
|
|
|
iVar2 = FUN_004e3b60(*(undefined4 *)(param_2 + 8));
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
FUN_004a2960();
|
|
|
|
local_14 = *(undefined4 *)(param_2 + 0xa4);
|
|
|
|
local_10 = FUN_0058ddb0();
|
|
|
|
cVar1 = FUN_004c8980(local_18);
|
|
|
|
if (cVar1 != '\0') {
|
|
|
|
FUN_0058cf70(1);
|
|
|
|
FUN_004e4a90(*(undefined4 *)(param_2 + 8));
|
|
|
|
(**(code **)(*(int *)(param_2 + 0xc) + 4))(0x186af,param_1 + 0x6e0);
|
|
|
|
FUN_004a29b0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_004a29b0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8da0 at 0x004C8DA0 (size: 229) ---
|
|
|
|
|
|
void __thiscall FUN_004c8da0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
|
|
|
|
if ((*(int *)(param_1 + 0x6fc) != 0) && (param_2 != 0)) {
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar4 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
while (((piVar2 = (int *)FUN_0046dc50(iVar4), piVar2 == (int *)0x0 ||
|
|
|
|
(iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 == 0)) ||
|
|
|
|
(*(int *)(iVar3 + 0x5fc) != *(int *)(param_2 + 8)))) {
|
|
|
|
iVar4 = iVar4 + 1;
|
|
|
|
if (iVar1 <= iVar4) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0058cf70(0);
|
|
|
|
(**(code **)(*(int *)(param_2 + 0xc) + 0xc))(param_1 + 0x6e0);
|
|
|
|
FUN_004e4c70(*(undefined4 *)(param_2 + 8));
|
|
|
|
FUN_004a2960();
|
|
|
|
FUN_0058ddb0();
|
|
|
|
if (*(int *)(param_1 + 0x6f0) != 0) {
|
|
|
|
FUN_005bc960(*(undefined4 *)(param_1 + 0x6f8),&stack0xffffffe4);
|
|
|
|
}
|
|
|
|
FUN_004a29b0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8e90 at 0x004C8E90 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004c8e90(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c8ad0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c8eb0 at 0x004C8EB0 (size: 521) ---
|
|
|
|
|
|
void __fastcall FUN_004c8eb0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x6e0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd229,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x6e0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd226,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x6e0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd256,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x6e0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a8,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x6e0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a4,iVar3);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000091);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x700) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000093);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x704) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000095);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x708) = iVar3;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 0x6e8);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000094);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x70c) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000098);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x710) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000009a);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x714) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000009c);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x718) = iVar3;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 0x6e8);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000009b);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x71c) = uVar2;
|
|
|
|
FUN_004c8c70();
|
|
|
|
FUN_004c8bd0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c90c0 at 0x004C90C0 (size: 19) ---
|
|
|
|
|
|
void FUN_004c90c0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000013,&LAB_004c8b80);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c91a0 at 0x004C91A0 (size: 53) ---
|
|
|
|
|
|
uint FUN_004c91a0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint in_EAX;
|
|
|
|
int iVar1;
|
|
|
|
uint uVar2;
|
|
|
|
|
|
|
|
if (param_1 == 0) {
|
|
|
|
return in_EAX & 0xffffff00;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_0058cce0();
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
uVar2 = FUN_004c8ce0(param_1);
|
|
|
|
return uVar2;
|
|
|
|
}
|
|
|
|
uVar2 = FUN_004c92d0(param_1);
|
|
|
|
return uVar2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c91e0 at 0x004C91E0 (size: 240) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c91e0(int param_1,undefined4 param_2,char param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined1 local_94 [4];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6fc) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005583f0(param_2);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
iVar3 = FUN_0058df90();
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
if (param_3 == '\0') {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You can only trade items you are carrying");
|
|
|
|
FUN_0042cbe0(local_94,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = FUN_004e3b60(*(undefined4 *)(iVar2 + 8));
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
cVar1 = FUN_004c8950();
|
|
|
|
if (cVar1 != '\0') {
|
|
|
|
iVar3 = FUN_0058cce0();
|
|
|
|
if (0 < iVar3) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
uVar4 = FUN_004c89b0(*(undefined4 *)(iVar2 + 0xa4));
|
|
|
|
return uVar4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c92d0 at 0x004C92D0 (size: 134) ---
|
|
|
|
|
|
uint FUN_004c92d0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
uint in_EAX;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
|
|
|
|
if (param_1 != 0) {
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
in_EAX = 0;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
iVar2 = FUN_0058cd20();
|
|
|
|
in_EAX = 0;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_005aefc0(0);
|
|
|
|
iVar4 = *(int *)(iVar2 + 0x10);
|
|
|
|
iVar5 = 0;
|
|
|
|
if (0 < iVar4) {
|
|
|
|
do {
|
|
|
|
uVar6 = 1;
|
|
|
|
uVar3 = FUN_005aece0(1);
|
|
|
|
cVar1 = FUN_004c91e0(uVar3,uVar6);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
LAB_004c9338:
|
|
|
|
FUN_005aecb0();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar3 = FUN_005aece0();
|
|
|
|
iVar4 = FUN_005583f0(uVar3);
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
FUN_004c91a0(iVar4);
|
|
|
|
goto LAB_004c9338;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar4 = *(int *)(iVar2 + 0x10);
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
} while (iVar5 < iVar4);
|
|
|
|
}
|
|
|
|
return CONCAT31((int3)((uint)iVar4 >> 8),1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return in_EAX & 0xffffff00;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c93b0 at 0x004C93B0 (size: 378) ---
|
|
|
|
|
|
undefined1 FUN_004c93b0(undefined4 param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
int iVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
undefined1 local_98 [4];
|
|
|
|
undefined1 local_94 [4];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
cVar1 = FUN_004c91e0(param_1,0);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005583f0(param_1);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
if (DAT_0081d7ec == DAT_0081d7f0) {
|
|
|
|
FUN_0058cf00(0);
|
|
|
|
FUN_004c91a0(iVar2);
|
|
|
|
FUN_004c8bd0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar3 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
iVar4 = FUN_00588f70(param_1,uVar3,*(undefined4 *)(iVar2 + 0xb4),0,0);
|
|
|
|
if (iVar4 != 0) {
|
|
|
|
FUN_00587d30(iVar2);
|
|
|
|
puVar5 = (undefined4 *)FUN_0058f8b0(local_94,2,0);
|
|
|
|
FUN_00480980(local_98,0,L"Splitting the %s before adding to housing panel",*puVar5);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(local_98,1);
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
FUN_004011b0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"Cannot split the stack for dwelling costs");
|
|
|
|
FUN_0042cbe0(local_98,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9530 at 0x004C9530 (size: 307) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c9530(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int *piVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
int iStack_14;
|
|
|
|
undefined **local_10;
|
|
|
|
int local_c;
|
|
|
|
undefined4 local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
if (((*(int *)(param_1 + 0x6f8) == 1) || (*(int *)(param_1 + 0x6f8) == 2)) &&
|
|
|
|
(*(int *)(param_1 + 0x6fc) != 0)) {
|
|
|
|
iVar1 = *(int *)(param_1 + 0x6ec);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
local_c = 0;
|
|
|
|
local_8 = 0;
|
|
|
|
local_4 = 0;
|
|
|
|
iVar2 = FUN_004e3c10();
|
|
|
|
iVar5 = 0;
|
|
|
|
if (0 < iVar2) {
|
|
|
|
do {
|
|
|
|
piVar3 = (int *)FUN_0046dc50(iVar5);
|
|
|
|
if (((piVar3 != (int *)0x0) &&
|
|
|
|
(iVar4 = (**(code **)(*piVar3 + 0x94))(0x10000032), iVar4 != 0)) &&
|
|
|
|
(*(int *)(iVar4 + 0x5fc) != 0)) {
|
|
|
|
iStack_14 = *(int *)(iVar4 + 0x5fc);
|
|
|
|
FUN_0048bd40(&iStack_14);
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
} while (iVar5 < iVar2);
|
|
|
|
}
|
|
|
|
if (local_c != 0) {
|
|
|
|
FUN_004c8c70();
|
|
|
|
FUN_004c8bd0();
|
|
|
|
if (local_c != 0) {
|
|
|
|
if (*(int *)(param_1 + 0x6f8) == 1) {
|
|
|
|
FUN_006ab600(iVar1,&local_10);
|
|
|
|
}
|
|
|
|
else if (*(int *)(param_1 + 0x6f8) == 2) {
|
|
|
|
FUN_006abbe0(iVar1,&local_10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
FUN_0048bc30();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
FUN_0048bc30();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9670 at 0x004C9670 (size: 150) ---
|
|
|
|
|
|
void __thiscall FUN_004c9670(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
char cVar2;
|
|
|
|
byte local_8 [4];
|
|
|
|
undefined1 local_4 [4];
|
|
|
|
|
|
|
|
iVar1 = *(int *)(*(int *)(param_2 + 0xc) + 8);
|
|
|
|
if ((iVar1 != 0) && (*(int *)(*(int *)(param_2 + 0xc) + 0x10) != 0)) {
|
|
|
|
FUN_004e3380(iVar1,¶m_2,local_4,local_8);
|
|
|
|
if (param_2 != 0) {
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(param_1 + 0x708));
|
|
|
|
if (cVar2 == '\0') {
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(param_1 + 0x718));
|
|
|
|
if ((cVar2 != '\0') && ((local_8[0] & 0xe) == 0)) {
|
|
|
|
FUN_004c93b0(param_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((local_8[0] & 0xe) == 0) {
|
|
|
|
FUN_004c93b0(param_2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9710 at 0x004C9710 (size: 614) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c9710(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
undefined4 *puVar4;
|
|
|
|
undefined4 *local_8;
|
|
|
|
undefined4 *local_4;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x6f0) != 0) {
|
|
|
|
if (*(int *)(param_1 + 0x700) != 0) {
|
|
|
|
local_8 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
FUN_005bc990(1,&local_8);
|
|
|
|
uVar1 = FUN_00404a40(0,local_8 + 5);
|
|
|
|
FUN_0046a740(uVar1);
|
|
|
|
puVar3 = local_4 + -5;
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + -4);
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
puVar3 = local_8;
|
|
|
|
LVar2 = InterlockedDecrement(local_8 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x710) != 0) {
|
|
|
|
local_8 = DAT_008ef11c;
|
|
|
|
InterlockedIncrement(DAT_008ef11c + 1);
|
|
|
|
FUN_005bc9c0(2,&local_8);
|
|
|
|
uVar1 = FUN_00404a40(0,local_8 + 5);
|
|
|
|
FUN_0046a740(uVar1);
|
|
|
|
puVar3 = local_4 + -5;
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + -4);
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
puVar3 = local_8;
|
|
|
|
LVar2 = InterlockedDecrement(local_8 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0048c3e0("Owner: ");
|
|
|
|
if (*(int *)(*(int *)(*(int *)(param_1 + 0x6f0) + 0xc) + 8) == 1) {
|
|
|
|
FUN_0048c3e0(&DAT_00795028);
|
|
|
|
puVar3 = local_4;
|
|
|
|
if ((local_4[2] != 1) && (local_4 != DAT_008ef11c)) {
|
|
|
|
FUN_004910c0(local_4 + 5,local_4[2] + -1);
|
|
|
|
}
|
|
|
|
LVar2 = InterlockedDecrement(puVar3 + 1);
|
|
|
|
if (LVar2 == 0) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
puVar3 = *(undefined4 **)(*(int *)(param_1 + 0x6f0) + 0xc);
|
|
|
|
if ((puVar3[2] != 1) && (puVar3 != DAT_008ef11c)) {
|
|
|
|
FUN_004910c0(puVar3 + 5,puVar3[2] + -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puVar3 = local_8;
|
|
|
|
if (*(int *)(param_1 + 0x704) != 0) {
|
|
|
|
uVar1 = FUN_00404a40(0,local_8 + 5);
|
|
|
|
FUN_0046a740(uVar1);
|
|
|
|
puVar4 = local_4 + -5;
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + -4);
|
|
|
|
if ((LVar2 == 0) && (puVar4 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar4)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x714) != 0) {
|
|
|
|
uVar1 = FUN_00404a40(0,puVar3 + 5);
|
|
|
|
FUN_0046a740(uVar1);
|
|
|
|
LVar2 = InterlockedDecrement(local_4 + -4);
|
|
|
|
if ((LVar2 == 0) && (local_4 + -5 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)local_4[-5])(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004c8c70();
|
|
|
|
FUN_004c8bd0();
|
|
|
|
LVar2 = InterlockedDecrement(puVar3 + 1);
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9980 at 0x004C9980 (size: 81) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c9980(int *param_1,char param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
param_1[0x1c8] = 0;
|
|
|
|
if (param_1[0x1bc] == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (param_2 != '\0') {
|
|
|
|
iVar1 = FUN_005bc900(1);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004c9530();
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
(**(code **)(*param_1 + 0x18))(0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c99e0 at 0x004C99E0 (size: 74) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c99e0(int *param_1,char param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
param_1[0x1c9] = 0;
|
|
|
|
if (param_1[0x1c6] == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (param_2 != '\0') {
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004c9530();
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
(**(code **)(*param_1 + 0x18))(0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9bc0 at 0x004C9BC0 (size: 99) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004c9bc0(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
*(undefined4 *)(param_1 + 0x6ec) = param_2;
|
|
|
|
if (*(int *)(param_1 + 0x6f0) == 0) {
|
|
|
|
iVar1 = FUN_005df0f5(0x4c);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
iVar1 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar1 = FUN_005bce40(param_3);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x6f0) = iVar1;
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_005bcb30(param_3);
|
|
|
|
}
|
|
|
|
FUN_004c88d0();
|
|
|
|
FUN_004c9710();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9ca0 at 0x004C9CA0 (size: 510) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c9ca0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG LVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 *puStack_114;
|
|
|
|
int *piStack_110;
|
|
|
|
int local_10c;
|
|
|
|
undefined1 local_108 [120];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x720) != 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(
|
|
|
|
L"When you buy a landscape house like this one, you are restricted from buying another for 30 days. Are you sure you want to buy this house?"
|
|
|
|
);
|
|
|
|
FUN_0042cbe0(&local_10c,1);
|
|
|
|
LVar1 = InterlockedDecrement((LONG *)(local_10c + -0x10));
|
|
|
|
if ((LVar1 == 0) && ((undefined4 *)(local_10c + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_10c + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_006823d0();
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
FUN_0042a2d0(0x8e);
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
FUN_00429b10();
|
|
|
|
(**(code **)(*piStack_110 + 0xac))(1);
|
|
|
|
}
|
|
|
|
local_10c = FUN_00429a00();
|
|
|
|
FUN_0042c290(&local_10c,&puStack_114);
|
|
|
|
FUN_0042a2d0(0xc5);
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
FUN_00429b10();
|
|
|
|
(**(code **)(*piStack_110 + 0xc4))(local_90);
|
|
|
|
}
|
|
|
|
local_10c = FUN_00429a00();
|
|
|
|
FUN_0042c290(&local_10c,&puStack_114);
|
|
|
|
iVar2 = FUN_00478810(local_108);
|
|
|
|
*(int *)(param_1 + 0x720) = iVar2;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
if (puStack_114 != (undefined4 *)0x0) {
|
|
|
|
iVar2 = puStack_114[1];
|
|
|
|
puStack_114[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*puStack_114)(1);
|
|
|
|
}
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
iVar2 = piStack_110[1];
|
|
|
|
piStack_110[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*piStack_110)(1);
|
|
|
|
}
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
}
|
|
|
|
FUN_00681f60();
|
|
|
|
FUN_0042e590();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (puStack_114 != (undefined4 *)0x0) {
|
|
|
|
iVar2 = puStack_114[1];
|
|
|
|
puStack_114[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*puStack_114)(1);
|
|
|
|
}
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
iVar2 = piStack_110[1];
|
|
|
|
piStack_110[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*piStack_110)(1);
|
|
|
|
}
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
}
|
|
|
|
FUN_00681f60();
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004c9ea0 at 0x004C9EA0 (size: 510) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004c9ea0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
LONG LVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 *puStack_114;
|
|
|
|
int *piStack_110;
|
|
|
|
int local_10c;
|
|
|
|
undefined1 local_108 [120];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x724) != 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(
|
|
|
|
L"You are paying maintenance on someone else\'s house. Are you sure you wish to continue?"
|
|
|
|
);
|
|
|
|
FUN_0042cbe0(&local_10c,1);
|
|
|
|
LVar1 = InterlockedDecrement((LONG *)(local_10c + -0x10));
|
|
|
|
if ((LVar1 == 0) && ((undefined4 *)(local_10c + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_10c + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_006823d0();
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
FUN_0042a2d0(0x8e);
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
FUN_00429b10();
|
|
|
|
(**(code **)(*piStack_110 + 0xac))(1);
|
|
|
|
}
|
|
|
|
local_10c = FUN_00429a00();
|
|
|
|
FUN_0042c290(&local_10c,&puStack_114);
|
|
|
|
FUN_0042a2d0(0xc5);
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
FUN_00429b10();
|
|
|
|
(**(code **)(*piStack_110 + 0xc4))(local_90);
|
|
|
|
}
|
|
|
|
local_10c = FUN_00429a00();
|
|
|
|
FUN_0042c290(&local_10c,&puStack_114);
|
|
|
|
iVar2 = FUN_00478810(local_108);
|
|
|
|
*(int *)(param_1 + 0x724) = iVar2;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
if (puStack_114 != (undefined4 *)0x0) {
|
|
|
|
iVar2 = puStack_114[1];
|
|
|
|
puStack_114[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*puStack_114)(1);
|
|
|
|
}
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
iVar2 = piStack_110[1];
|
|
|
|
piStack_110[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*piStack_110)(1);
|
|
|
|
}
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
}
|
|
|
|
FUN_00681f60();
|
|
|
|
FUN_0042e590();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (puStack_114 != (undefined4 *)0x0) {
|
|
|
|
iVar2 = puStack_114[1];
|
|
|
|
puStack_114[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*puStack_114)(1);
|
|
|
|
}
|
|
|
|
puStack_114 = (undefined4 *)0x0;
|
|
|
|
}
|
|
|
|
if (piStack_110 != (int *)0x0) {
|
|
|
|
iVar2 = piStack_110[1];
|
|
|
|
piStack_110[1] = iVar2 + -1;
|
|
|
|
if (iVar2 + -1 == 0) {
|
|
|
|
(**(code **)*piStack_110)(1);
|
|
|
|
}
|
|
|
|
piStack_110 = (int *)0x0;
|
|
|
|
}
|
|
|
|
FUN_00681f60();
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca240 at 0x004CA240 (size: 113) ---
|
|
|
|
|
|
void __fastcall FUN_004ca240(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
puVar3 = param_1 + 0x17f;
|
|
|
|
*param_1 = &PTR_FUN_007b8438;
|
|
|
|
*puVar1 = &PTR_FUN_007b8190;
|
|
|
|
*puVar3 = &PTR_FUN_007b8184;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b8180;
|
|
|
|
if (param_1[0x184] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
FUN_0055e1d0(puVar3);
|
|
|
|
FUN_0055f930(puVar3);
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca2f0 at 0x004CA2F0 (size: 148) ---
|
|
|
|
|
|
void __fastcall FUN_004ca2f0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (((*(int *)(param_1 + 0x604) != 0) && (*(int *)(param_1 + 0x610) != 0)) &&
|
|
|
|
(*(int *)(param_1 + 0x620) != 0)) {
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar2 = FUN_004e3c10();
|
|
|
|
iVar1 = iVar1 + iVar2;
|
|
|
|
if (((*(int **)(param_1 + 0x604))[0x100] == 6) && (iVar1 == 0)) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
if (((*(int **)(param_1 + 0x604))[0x100] == 1) && (iVar1 == 0)) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
if (((*(int **)(param_1 + 0x604))[0x100] == 0xd) && (0 < iVar1)) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca390 at 0x004CA390 (size: 21) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004ca390(int *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
if ((*param_1 != 0) && (-1 < param_1[1])) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca3b0 at 0x004CA3B0 (size: 172) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004ca3b0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007b405c;
|
|
|
|
param_1[0x180] = &PTR_LAB_007acb10;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
param_1[0x184] = 0;
|
|
|
|
param_1[0x185] = 0;
|
|
|
|
param_1[0x186] = 0;
|
|
|
|
param_1[0x187] = 0;
|
|
|
|
param_1[0x188] = 0;
|
|
|
|
param_1[0x189] = 0;
|
|
|
|
param_1[0x18a] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b8438;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b8190;
|
|
|
|
param_1[0x17f] = &PTR_FUN_007b8184;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b8180;
|
|
|
|
uVar1 = DAT_008406fc;
|
|
|
|
param_1[0x18c] = 0;
|
|
|
|
param_1[0x18b] = uVar1;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca460 at 0x004CA460 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004ca460(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004ca240();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca4c0 at 0x004CA4C0 (size: 160) ---
|
|
|
|
|
|
void __fastcall FUN_004ca4c0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
int local_94 [37];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x60c) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840764,0x10000001);
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
FUN_0042e000(DAT_00840768,iVar1,iVar1 >> 0x1f);
|
|
|
|
uVar2 = FUN_0042e980(local_94,0);
|
|
|
|
FUN_0046a740(uVar2);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_94[0] + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_94[0] + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94[0] + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca560 at 0x004CA560 (size: 160) ---
|
|
|
|
|
|
void __fastcall FUN_004ca560(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
int local_94 [37];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x620) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840764,0x10000001);
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
FUN_0042e000(DAT_00840768,iVar1,iVar1 >> 0x1f);
|
|
|
|
uVar2 = FUN_0042e980(local_94,0);
|
|
|
|
FUN_0046a740(uVar2);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_94[0] + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_94[0] + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94[0] + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca600 at 0x004CA600 (size: 119) ---
|
|
|
|
|
|
void __fastcall FUN_004ca600(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_0056e6b0();
|
|
|
|
iVar1 = FUN_0056e7f0();
|
|
|
|
FUN_0056e6b0();
|
|
|
|
iVar2 = FUN_0056e810();
|
|
|
|
iVar3 = FUN_004e3c10();
|
|
|
|
if (iVar1 == iVar3) {
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
if (iVar2 == iVar1) {
|
|
|
|
FUN_0056e6b0();
|
|
|
|
FUN_0056e7a0();
|
|
|
|
goto LAB_004ca659;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0056e6b0();
|
|
|
|
FUN_0056eff0();
|
|
|
|
LAB_004ca659:
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(6);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca680 at 0x004CA680 (size: 43) ---
|
|
|
|
|
|
void __fastcall FUN_004ca680(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_0056e6b0();
|
|
|
|
FUN_0056e7c0();
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca6b0 at 0x004CA6B0 (size: 272) ---
|
|
|
|
|
|
void __fastcall FUN_004ca6b0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) != 0) {
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar5 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
do {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar5);
|
|
|
|
if (((piVar2 != (int *)0x0) &&
|
|
|
|
(iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0)) &&
|
|
|
|
(iVar3 = FUN_005583f0(*(undefined4 *)(iVar3 + 0x5fc)), iVar3 != 0)) {
|
|
|
|
FUN_0058cf70(0);
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
} while (iVar5 < iVar1);
|
|
|
|
}
|
|
|
|
FUN_004e49f0();
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x620) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar5 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
do {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar5);
|
|
|
|
if (((((piVar2 != (int *)0x0) &&
|
|
|
|
(iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0)) &&
|
|
|
|
((iVar3 = FUN_005583f0(*(undefined4 *)(iVar3 + 0x5fc)), iVar3 != 0 &&
|
|
|
|
((iVar4 = FUN_0056e6b0(), iVar4 != 0 &&
|
|
|
|
(iVar4 = FUN_0056e6b0(), *(int *)(iVar4 + 0x18) != 0)))))) &&
|
|
|
|
(iVar4 = FUN_0058df90(), iVar4 == 0)) && ((*(uint *)(iVar3 + 0xc4) & 0x3f00000) == 0)) {
|
|
|
|
FUN_0058d7d0();
|
|
|
|
}
|
|
|
|
iVar5 = iVar5 + 1;
|
|
|
|
} while (iVar5 < iVar1);
|
|
|
|
}
|
|
|
|
FUN_004e49f0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca7d0 at 0x004CA7D0 (size: 212) ---
|
|
|
|
|
|
void __thiscall FUN_004ca7d0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if ((*(int *)(param_1 + 0x610) != 0) && (param_2 != 0)) {
|
|
|
|
(**(code **)(*(int *)(param_2 + 0xc) + 0xc))(param_1 + 0x5f8);
|
|
|
|
iVar1 = FUN_004e3b60(*(undefined4 *)(param_2 + 8));
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_0058cf70(0);
|
|
|
|
FUN_004e4c70(*(undefined4 *)(param_2 + 8));
|
|
|
|
FUN_004ca4c0();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3b60(*(undefined4 *)(param_2 + 8));
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004e4c70(*(undefined4 *)(param_2 + 8));
|
|
|
|
FUN_004ca560();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
iVar1 = FUN_0056e6b0();
|
|
|
|
if ((((iVar1 != 0) && (iVar1 = FUN_0056e6b0(), *(int *)(iVar1 + 0x18) != 0)) &&
|
|
|
|
(iVar1 = FUN_0058df90(), iVar1 == 0)) && ((*(uint *)(param_2 + 0xc4) & 0x3f00000) == 0)) {
|
|
|
|
FUN_0058d7d0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca8b0 at 0x004CA8B0 (size: 19) ---
|
|
|
|
|
|
void FUN_004ca8b0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000012,&LAB_004ca480);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ca9c0 at 0x004CA9C0 (size: 162) ---
|
|
|
|
|
|
void __thiscall FUN_004ca9c0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
undefined *local_4;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x618) != 0) {
|
|
|
|
local_4 = PTR_DAT_00818340;
|
|
|
|
InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));
|
|
|
|
if (param_2 != 0) {
|
|
|
|
uVar1 = FUN_0058f8e0(¶m_2,param_2,2,0);
|
|
|
|
FUN_00402070(uVar1);
|
|
|
|
puVar3 = (undefined4 *)(param_2 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(param_2 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0046a740(&local_4);
|
|
|
|
puVar3 = (undefined4 *)(local_4 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar3)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004caa70 at 0x004CAA70 (size: 163) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004caa70(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
if (*(int **)(param_1 + 0x614) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3bc0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004e1e40(0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_0058cf70(1);
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(param_2,param_3);
|
|
|
|
FUN_004ca4c0();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cab20 at 0x004CAB20 (size: 141) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cab20(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x620) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
if (*(int **)(param_1 + 0x614) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3bc0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_004e1e40(0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_004e4bd0(param_2,param_3);
|
|
|
|
FUN_004ca560();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cabb0 at 0x004CABB0 (size: 159) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cabb0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
if (*(int **)(param_1 + 0x614) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_004e3bc0(param_2);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_004e1e40(0);
|
|
|
|
FUN_004ca7d0(*(undefined4 *)(iVar2 + 0x608));
|
|
|
|
FUN_004ca4c0();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cac50 at 0x004CAC50 (size: 159) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cac50(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x620) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_004ca2f0();
|
|
|
|
if (*(int **)(param_1 + 0x614) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_004e3bc0(param_2);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000032);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_004e1e40(0);
|
|
|
|
FUN_004ca7d0(*(undefined4 *)(iVar2 + 0x608));
|
|
|
|
FUN_004ca560();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cacf0 at 0x004CACF0 (size: 92) ---
|
|
|
|
|
|
void __fastcall FUN_004cacf0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
if ((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) {
|
|
|
|
iVar1 = FUN_0056e6b0();
|
|
|
|
uVar2 = 0;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar1 = FUN_0056e6b0();
|
|
|
|
uVar2 = *(undefined4 *)(iVar1 + 0x18);
|
|
|
|
}
|
|
|
|
FUN_004ca9c0(uVar2);
|
|
|
|
if (*(int **)(param_1 + 0x614) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x614) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
FUN_004ca6b0();
|
|
|
|
FUN_004ca4c0();
|
|
|
|
FUN_004ca560();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cad50 at 0x004CAD50 (size: 770) ---
|
|
|
|
|
|
void __fastcall FUN_004cad50(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd231,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd236,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd233,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd235,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd238,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd230,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd239,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd237,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd234,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd232,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(&DAT_004dd23a,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a8,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a9,iVar3);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186ab,iVar3);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000086);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(1);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x604) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000085);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x608) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000087);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000088);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x610) = iVar3;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 0x600);
|
|
|
|
}
|
|
|
|
uVar2 = FUN_00463c00(0x1000007f);
|
|
|
|
*(undefined4 *)(param_1 + 0x614) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000007e);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x618) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000080);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x61c) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000081);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x620) = uVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000008a);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(1);
|
|
|
|
*(undefined4 *)(param_1 + 0x624) = uVar2;
|
|
|
|
FUN_004cacf0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x624) = 0;
|
|
|
|
FUN_004cacf0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb060 at 0x004CB060 (size: 74) ---
|
|
|
|
|
|
void __thiscall FUN_004cb060(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00463830(param_2);
|
|
|
|
if (((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) && ((char)param_2 == '\0')) {
|
|
|
|
param_1 = param_1 + 0x5fc;
|
|
|
|
FUN_0055e1d0(param_1);
|
|
|
|
FUN_0055f930(param_1);
|
|
|
|
FUN_0056e6b0();
|
|
|
|
thunk_FUN_006ae140();
|
|
|
|
FUN_004cacf0();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb0b0 at 0x004CB0B0 (size: 53) ---
|
|
|
|
|
|
void FUN_004cb0b0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
iVar1 = FUN_0056e6b0();
|
|
|
|
iVar2 = 0;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar2 = FUN_0056e6b0();
|
|
|
|
iVar2 = *(int *)(iVar2 + 0x18);
|
|
|
|
}
|
|
|
|
if (param_1 == iVar2) {
|
|
|
|
FUN_0056e6b0();
|
|
|
|
thunk_FUN_006ae140();
|
|
|
|
FUN_004cacf0();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb1b0 at 0x004CB1B0 (size: 102) ---
|
|
|
|
|
|
void __thiscall FUN_004cb1b0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
|
|
|
|
(**(code **)(*(int *)(param_1 + -0x5f8) + 0x18))(1);
|
|
|
|
FUN_004ca9c0(param_2);
|
|
|
|
if (param_1 == 0x5f8) {
|
|
|
|
param_1 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
param_1 = param_1 + 4;
|
|
|
|
}
|
|
|
|
uVar8 = 0;
|
|
|
|
uVar7 = 0;
|
|
|
|
uVar4 = 0;
|
|
|
|
uVar3 = 1;
|
|
|
|
uVar2 = 0x40140000;
|
|
|
|
uVar1 = 0;
|
|
|
|
uVar5 = DAT_007b8148;
|
|
|
|
uVar6 = DAT_007b814c;
|
|
|
|
FUN_0055e1d0(param_1,param_2,0,0x40140000,1,0,DAT_007b8148,DAT_007b814c,0,0);
|
|
|
|
FUN_00561040(param_1,param_2,uVar1,uVar2,uVar3,uVar4,uVar5,uVar6,uVar7,uVar8);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb290 at 0x004CB290 (size: 209) ---
|
|
|
|
|
|
uint FUN_004cb290(undefined4 param_1,char param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
uint uVar4;
|
|
|
|
uint uVar5;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar1 = FUN_005583f0(param_1);
|
|
|
|
uVar4 = 0;
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar2 = FUN_0058df90();
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
uVar4 = 0;
|
|
|
|
if (param_2 == '\0') {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You can only trade items you are carrying");
|
|
|
|
FUN_0042cbe0(&local_94,1);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
uVar4 = FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar4 = FUN_004e3b60(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (uVar4 == 0) {
|
|
|
|
uVar5 = FUN_0058cce0();
|
|
|
|
uVar4 = 0;
|
|
|
|
if (uVar5 != 0) {
|
|
|
|
uVar4 = uVar5 & 0xffffff00;
|
|
|
|
}
|
|
|
|
return CONCAT31((int3)(uVar4 >> 8),1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return uVar4 & 0xffffff00;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb370 at 0x004CB370 (size: 497) ---
|
|
|
|
|
|
undefined4 __thiscall
|
|
|
|
FUN_004cb370(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,char param_5)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
LONG LVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
undefined4 uVar9;
|
|
|
|
int local_9c;
|
|
|
|
int local_98;
|
|
|
|
undefined4 local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) == 0) {
|
|
|
|
return 0xffffffff;
|
|
|
|
}
|
|
|
|
local_94 = 0xffffffff;
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if ((iVar2 == 0) && (iVar2 = FUN_0058ccf0(), iVar2 == 0)) {
|
|
|
|
iVar2 = FUN_004e3b60(*(undefined4 *)(iVar1 + 8));
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
return 0xffffffff;
|
|
|
|
}
|
|
|
|
FUN_0058cf70(1);
|
|
|
|
uVar3 = FUN_004e4bd0(*(undefined4 *)(iVar1 + 8),param_3);
|
|
|
|
FUN_004ca4c0();
|
|
|
|
FUN_004ca2f0();
|
|
|
|
uVar4 = FUN_00480780(uVar3);
|
|
|
|
uVar3 = *(undefined4 *)(iVar1 + 8);
|
|
|
|
local_94 = uVar4;
|
|
|
|
FUN_0056e6b0(uVar3,uVar4);
|
|
|
|
FUN_0056e780(uVar3,uVar4);
|
|
|
|
}
|
|
|
|
if ((param_5 != '\0') && (iVar1 = FUN_0058cce0(), 0 < iVar1)) {
|
|
|
|
puVar5 = (undefined4 *)FUN_0058f8b0(&local_9c,2,0);
|
|
|
|
FUN_00480980(&local_98,0,L"Trading contents of %s",*puVar5);
|
|
|
|
puVar5 = (undefined4 *)(local_9c + -0x14);
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(local_9c + -0x10));
|
|
|
|
if ((LVar6 == 0) && (puVar5 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*puVar5)(1);
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&local_98,1);
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
iVar1 = FUN_0058cd20();
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_005aefc0(0);
|
|
|
|
local_9c = 0;
|
|
|
|
if (0 < *(int *)(iVar1 + 0x10)) {
|
|
|
|
do {
|
|
|
|
uVar9 = 1;
|
|
|
|
uVar8 = 0;
|
|
|
|
uVar3 = param_3;
|
|
|
|
uVar4 = param_4;
|
|
|
|
uVar7 = FUN_005aece0(param_3,param_4,0,1);
|
|
|
|
iVar2 = FUN_004cb370(uVar7,uVar3,uVar4,uVar8,uVar9);
|
|
|
|
if (iVar2 != -1) {
|
|
|
|
param_3 = 0;
|
|
|
|
}
|
|
|
|
FUN_005aecb0();
|
|
|
|
local_9c = local_9c + 1;
|
|
|
|
} while (local_9c < *(int *)(iVar1 + 0x10));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar6 == 0) && ((undefined4 *)(local_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_98 + -0x14))(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return local_94;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb5c0 at 0x004CB5C0 (size: 106) ---
|
|
|
|
|
|
void __thiscall FUN_004cb5c0(int param_1,undefined4 param_2,byte param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if ((((*(int *)(param_1 + 0x628) != 0) && ((param_3 & 1) != 0)) &&
|
|
|
|
(iVar1 = FUN_005583f0(param_2), iVar1 != 0)) &&
|
|
|
|
(*(int *)(iVar1 + 0xa4) == *(int *)(param_1 + 0x62c))) {
|
|
|
|
iVar1 = *(int *)(iVar1 + 0xf8);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
iVar1 = 1;
|
|
|
|
}
|
|
|
|
if (iVar1 == *(int *)(param_1 + 0x630)) {
|
|
|
|
FUN_004cb370(param_2,0,0,0,1);
|
|
|
|
*(undefined4 *)(param_1 + 0x628) = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb630 at 0x004CB630 (size: 473) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cb630(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined4 *puVar5;
|
|
|
|
LONG LVar6;
|
|
|
|
int local_98;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
cVar1 = FUN_004cb290(param_2,0);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005583f0(param_2);
|
|
|
|
if (DAT_0081d7ec == DAT_0081d7f0) {
|
|
|
|
FUN_0058cf00(0);
|
|
|
|
FUN_004cb370(*(undefined4 *)(iVar2 + 8),0,1,1,0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar4 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar4 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
iVar3 = FUN_00588f70(*(undefined4 *)(iVar2 + 8),uVar4,*(undefined4 *)(iVar2 + 0xb4),0,0);
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"Cannot split the stack to trade it");
|
|
|
|
FUN_0042cbe0(&local_98,1);
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar6 == 0) && ((undefined4 *)(local_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_98 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x628) = *(undefined4 *)(iVar2 + 8);
|
|
|
|
*(undefined4 *)(param_1 + 0x62c) = *(undefined4 *)(iVar2 + 0xa4);
|
|
|
|
uVar4 = FUN_00587d30(iVar2);
|
|
|
|
*(undefined4 *)(param_1 + 0x630) = uVar4;
|
|
|
|
puVar5 = (undefined4 *)FUN_0058f8b0(&local_94,2,0);
|
|
|
|
FUN_00480980(&local_98,0,L"Splitting the %s before trading them",*puVar5);
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar6 == 0) && ((undefined4 *)(local_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&local_98,1);
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
LVar6 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar6 == 0) && ((undefined4 *)(local_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_98 + -0x14))(1);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cb940 at 0x004CB940 (size: 184) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cb940(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined1 local_94 [4];
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_004e3b60(param_2);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
if ((param_2 != DAT_00871e54) || (DAT_0081d7ec == DAT_0081d7f0)) {
|
|
|
|
FUN_004cb370(param_2,0,1,1,0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You must split the stack before trading it.");
|
|
|
|
FUN_0042cbe0(local_94,1);
|
|
|
|
FUN_004011b0();
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cba00 at 0x004CBA00 (size: 101) ---
|
|
|
|
|
|
void __thiscall FUN_004cba00(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
char cVar2;
|
|
|
|
byte local_8 [4];
|
|
|
|
undefined1 local_4 [4];
|
|
|
|
|
|
|
|
iVar1 = *(int *)(*(int *)(param_2 + 0xc) + 8);
|
|
|
|
if ((iVar1 != 0) && (*(int *)(*(int *)(param_2 + 0xc) + 0x10) != 0)) {
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(param_1 + 0x610));
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
FUN_004e3380(iVar1,¶m_2,local_4,local_8);
|
|
|
|
if ((param_2 != 0) && ((local_8[0] & 0xe) == 0)) {
|
|
|
|
FUN_004cb630(param_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbb30 at 0x004CBB30 (size: 86) ---
|
|
|
|
|
|
void __fastcall FUN_004cbb30(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
*param_1 = &PTR_FUN_007b8b40;
|
|
|
|
*puVar1 = &PTR_FUN_007b8898;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007b8894;
|
|
|
|
if (param_1[0x180] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbbc0 at 0x004CBBC0 (size: 105) ---
|
|
|
|
|
|
void __thiscall FUN_004cbbc0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x600) != 0) {
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_0058cf70(0);
|
|
|
|
}
|
|
|
|
FUN_004e4c70(param_2);
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = 0;
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
/* WARNING: Could not recover jumptable at 0x004cbc1f. Too many branches */
|
|
|
|
/* WARNING: Treating indirect jump as call */
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbc30 at 0x004CBC30 (size: 103) ---
|
|
|
|
|
|
uint __thiscall FUN_004cbc30(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
uint in_EAX;
|
|
|
|
uint uVar2;
|
|
|
|
|
|
|
|
if (param_2 == 0) {
|
|
|
|
return in_EAX & 0xffffff00;
|
|
|
|
}
|
|
|
|
uVar1 = *(uint *)(param_2 + 300);
|
|
|
|
uVar2 = FUN_005ca650(uVar1);
|
|
|
|
if ((uVar2 != 0) && (*(uint *)(param_2 + 0xf0) < 100)) {
|
|
|
|
FUN_0055e1d0();
|
|
|
|
uVar2 = FUN_005d4a50();
|
|
|
|
if (((char)uVar2 != '\0') ||
|
|
|
|
((uVar2 = *(uint *)(param_1 + 0x60c), uVar2 == 0 || (uVar1 == uVar2)))) {
|
|
|
|
return CONCAT31((int3)(uVar2 >> 8),~*(byte *)(param_2 + 0x103)) & 0xffffff01;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return uVar2 & 0xffffff00;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbca0 at 0x004CBCA0 (size: 98) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cbca0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007acb10;
|
|
|
|
param_1[0x180] = 0;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b8b40;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b8898;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007b8894;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbd10 at 0x004CBD10 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004cbd10(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004cbb30();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbd30 at 0x004CBD30 (size: 158) ---
|
|
|
|
|
|
void __fastcall FUN_004cbd30(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000074);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x600) = iVar2;
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 0x5fc);
|
|
|
|
}
|
|
|
|
uVar3 = FUN_00463c00(0x10000076);
|
|
|
|
*(undefined4 *)(param_1 + 0x604) = uVar3;
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
param_1 = param_1 + 0x5f8;
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd222,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd223,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd224,param_1);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd256,param_1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbe60 at 0x004CBE60 (size: 92) ---
|
|
|
|
|
|
void FUN_004cbe60(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
iVar4 = 0;
|
|
|
|
if (0 < iVar1) {
|
|
|
|
do {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar4);
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
iVar3 = FUN_005583f0(*(undefined4 *)(iVar3 + 0x5fc));
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_0058cf70(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iVar4 = iVar4 + 1;
|
|
|
|
} while (iVar4 < iVar1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbec0 at 0x004CBEC0 (size: 134) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cbec0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x600) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_004e3b60(*(undefined4 *)(param_2 + 8));
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
cVar1 = FUN_004cbc30(param_2);
|
|
|
|
if (cVar1 != '\0') {
|
|
|
|
FUN_0058cf70(1);
|
|
|
|
FUN_004e4a90(*(undefined4 *)(param_2 + 8));
|
|
|
|
iVar2 = FUN_004e3c10();
|
|
|
|
if (iVar2 == 1) {
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = *(undefined4 *)(param_2 + 300);
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbf50 at 0x004CBF50 (size: 19) ---
|
|
|
|
|
|
void FUN_004cbf50(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000011,&LAB_004cbdd0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbf70 at 0x004CBF70 (size: 81) ---
|
|
|
|
|
|
void __thiscall FUN_004cbf70(int *param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
param_1[0x182] = param_2;
|
|
|
|
FUN_004cbe60(param_1[0x180]);
|
|
|
|
FUN_004e49f0();
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
if ((int *)param_1[0x181] != (int *)0x0) {
|
|
|
|
(**(code **)(*(int *)param_1[0x181] + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
(**(code **)(*param_1 + 0x18))(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cbfd0 at 0x004CBFD0 (size: 68) ---
|
|
|
|
|
|
void __fastcall FUN_004cbfd0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
*(undefined4 *)(param_1 + 0x608) = 0;
|
|
|
|
FUN_004cbe60(*(undefined4 *)(param_1 + 0x600));
|
|
|
|
FUN_004e49f0();
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = 0;
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc020 at 0x004CC020 (size: 64) ---
|
|
|
|
|
|
undefined4 FUN_004cc020(undefined4 param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
|
|
|
|
iVar1 = FUN_005583f0(param_1);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if (0 < iVar2) {
|
|
|
|
uVar3 = FUN_004cc0e0(iVar1);
|
|
|
|
return uVar3;
|
|
|
|
}
|
|
|
|
uVar3 = FUN_004cbec0(iVar1);
|
|
|
|
return uVar3;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc060 at 0x004CC060 (size: 43) ---
|
|
|
|
|
|
void __thiscall FUN_004cc060(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00463830(param_2);
|
|
|
|
if (((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) && ((char)param_2 == '\0')) {
|
|
|
|
FUN_004cbfd0();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc0e0 at 0x004CC0E0 (size: 341) ---
|
|
|
|
|
|
undefined4 FUN_004cc0e0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
int iVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
int local_98;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
puVar1 = (undefined4 *)FUN_0058f8b0(&local_94,2,0);
|
|
|
|
FUN_00480980(&local_98,0,L"Adding contents of %s",*puVar1);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(local_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042cbe0(&local_98,1);
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
iVar3 = FUN_0058cd20();
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_005aefc0(0);
|
|
|
|
iVar7 = 0;
|
|
|
|
if (0 < *(int *)(iVar3 + 0x10)) {
|
|
|
|
do {
|
|
|
|
uVar4 = FUN_005aece0();
|
|
|
|
iVar5 = FUN_005583f0(uVar4);
|
|
|
|
if (iVar5 != 0) {
|
|
|
|
iVar6 = FUN_0058cce0();
|
|
|
|
if (iVar6 < 1) {
|
|
|
|
FUN_004cbec0(iVar5);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_004cc0e0(iVar5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_005aecb0();
|
|
|
|
iVar7 = iVar7 + 1;
|
|
|
|
} while (iVar7 < *(int *)(iVar3 + 0x10));
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(local_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_98 + -0x14))(1);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_98 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(local_98 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_98 + -0x14))(1);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc240 at 0x004CC240 (size: 230) ---
|
|
|
|
|
|
undefined4 __thiscall FUN_004cc240(int param_1,undefined4 param_2,char param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar2 = FUN_0058df90();
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
if (param_3 == '\0') {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_00402730(L"You can only salvage items that you own!");
|
|
|
|
FUN_0042cbe0(&local_94,1);
|
|
|
|
LVar3 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar3 == 0) && ((undefined4 *)(local_94 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(local_94 + -0x14))(1);
|
|
|
|
}
|
|
|
|
FUN_00693500(0x1a,local_90);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (*(int *)(param_1 + 0x600) != 0) {
|
|
|
|
iVar2 = FUN_004e3b60(param_2);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
iVar2 = FUN_0058cce0();
|
|
|
|
if (0 < iVar2) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
uVar4 = FUN_004cbc30(iVar1);
|
|
|
|
return uVar4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc380 at 0x004CC380 (size: 50) ---
|
|
|
|
|
|
undefined1 __thiscall FUN_004cc380(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
|
|
|
|
cVar1 = FUN_004cc240(param_2,0);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x600) != 0) {
|
|
|
|
FUN_004cc020(param_2);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc3c0 at 0x004CC3C0 (size: 101) ---
|
|
|
|
|
|
void __thiscall FUN_004cc3c0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
char cVar2;
|
|
|
|
byte local_8 [4];
|
|
|
|
undefined1 local_4 [4];
|
|
|
|
|
|
|
|
iVar1 = *(int *)(*(int *)(param_2 + 0xc) + 8);
|
|
|
|
if ((iVar1 != 0) && (*(int *)(*(int *)(param_2 + 0xc) + 0x10) != 0)) {
|
|
|
|
cVar2 = FUN_0045fbb0(*(undefined4 *)(param_1 + 0x600));
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
FUN_004e3380(iVar1,¶m_2,local_4,local_8);
|
|
|
|
if ((param_2 != 0) && ((local_8[0] & 0xe) == 0)) {
|
|
|
|
FUN_004cc380(param_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc430 at 0x004CC430 (size: 258) ---
|
|
|
|
|
|
undefined4 __fastcall FUN_004cc430(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iStack_14;
|
|
|
|
undefined **local_10;
|
|
|
|
int local_c;
|
|
|
|
undefined4 local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x600) != 0) {
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
local_c = 0;
|
|
|
|
local_8 = 0;
|
|
|
|
local_4 = 0;
|
|
|
|
iVar1 = FUN_004e3c10();
|
|
|
|
while (iVar1 = iVar1 + -1, -1 < iVar1) {
|
|
|
|
piVar2 = (int *)FUN_0046dc50(iVar1);
|
|
|
|
if (((piVar2 != (int *)0x0) && (iVar3 = (**(code **)(*piVar2 + 0x94))(0x10000032), iVar3 != 0)
|
|
|
|
) && (*(int *)(iVar3 + 0x5fc) != 0)) {
|
|
|
|
iStack_14 = *(int *)(iVar3 + 0x5fc);
|
|
|
|
FUN_0048bd40(&iStack_14);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((local_c != 0) && (*(int *)(param_1 + 0x608) != 0)) {
|
|
|
|
FUN_004cbe60(*(undefined4 *)(param_1 + 0x600));
|
|
|
|
FUN_006ac790(*(undefined4 *)(param_1 + 0x608),&local_10);
|
|
|
|
FUN_004e49f0();
|
|
|
|
*(undefined4 *)(param_1 + 0x60c) = 0;
|
|
|
|
if (*(int **)(param_1 + 0x604) != (int *)0x0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x604) + 0x9c))(0xd);
|
|
|
|
}
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
FUN_0048bc30();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
local_10 = &PTR_FUN_007a4ed0;
|
|
|
|
FUN_0048bc30();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc610 at 0x004CC610 (size: 113) ---
|
|
|
|
|
|
void __fastcall FUN_004cc610(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
puVar3 = param_1 + 0x17f;
|
|
|
|
*param_1 = &PTR_FUN_007b9198;
|
|
|
|
*puVar1 = &PTR_FUN_007b8ef0;
|
|
|
|
*puVar3 = &PTR_LAB_007b8ee8;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b8ee4;
|
|
|
|
if (param_1[0x183] != 0) {
|
|
|
|
FUN_004e3230();
|
|
|
|
}
|
|
|
|
FUN_0055e1d0(puVar3);
|
|
|
|
FUN_0055f930(puVar3);
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc750 at 0x004CC750 (size: 97) ---
|
|
|
|
|
|
bool __thiscall FUN_004cc750(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
int local_4;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) == 0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
local_4 = param_1;
|
|
|
|
iVar1 = FUN_005583f0(*(int *)(param_1 + 0x610));
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
iVar2 = FUN_005583f0(param_2);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
local_4 = 1;
|
|
|
|
iVar1 = FUN_00587cc0(iVar2,iVar1,&local_4);
|
|
|
|
return iVar1 != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc7c0 at 0x004CC7C0 (size: 217) ---
|
|
|
|
|
|
void __thiscall FUN_004cc7c0(int *param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined4 uVar3;
|
|
|
|
double dVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
undefined4 uVar8;
|
|
|
|
undefined4 uVar9;
|
|
|
|
undefined4 uVar10;
|
|
|
|
|
|
|
|
iVar1 = param_1[0x184];
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
piVar2 = param_1 + 0x17f;
|
|
|
|
FUN_0055e1d0(piVar2,iVar1);
|
|
|
|
FUN_0055f900(piVar2,iVar1);
|
|
|
|
}
|
|
|
|
param_1[0x184] = param_2;
|
|
|
|
FUN_004e49f0();
|
|
|
|
FUN_004e4a90(param_2);
|
|
|
|
FUN_004e5660(param_2,0,1);
|
|
|
|
iVar1 = FUN_004e5770(param_2,1);
|
|
|
|
if (iVar1 == 0) {
|
|
|
|
FUN_004e5660(0,0,1);
|
|
|
|
}
|
|
|
|
if (param_2 == 0) {
|
|
|
|
(**(code **)(*param_1 + 0x18))(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
uVar3 = *(undefined4 *)(iVar1 + 8);
|
|
|
|
uVar10 = 0;
|
|
|
|
uVar9 = 0;
|
|
|
|
uVar6 = 0;
|
|
|
|
uVar5 = 1;
|
|
|
|
dVar4 = (double)*(float *)(iVar1 + 0xdc);
|
|
|
|
piVar2 = param_1 + 0x17f;
|
|
|
|
uVar7 = DAT_007b8e10;
|
|
|
|
uVar8 = DAT_007b8e14;
|
|
|
|
FUN_0055e1d0(piVar2,uVar3,dVar4,1,0,DAT_007b8e10,DAT_007b8e14,0,0);
|
|
|
|
FUN_00561040(piVar2,uVar3,dVar4,uVar5,uVar6,uVar7,uVar8,uVar9,uVar10);
|
|
|
|
}
|
|
|
|
(**(code **)(*param_1 + 0x18))(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc8a0 at 0x004CC8A0 (size: 92) ---
|
|
|
|
|
|
void __fastcall FUN_004cc8a0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
if (*(int *)(param_1 + 0x610) != 0) {
|
|
|
|
FUN_005898b0(*(int *)(param_1 + 0x610),0,0);
|
|
|
|
uVar2 = *(undefined4 *)(param_1 + 0x610);
|
|
|
|
iVar1 = param_1 + 0x5fc;
|
|
|
|
FUN_0055e1d0(iVar1,uVar2);
|
|
|
|
FUN_0055f900(iVar1,uVar2);
|
|
|
|
*(undefined4 *)(param_1 + 0x610) = 0;
|
|
|
|
FUN_004e49f0();
|
|
|
|
FUN_004e5660(0,0,1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc930 at 0x004CC930 (size: 118) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cc930(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007b405c;
|
|
|
|
param_1[0x180] = &PTR_LAB_007acb10;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
param_1[0x184] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007b9198;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b8ef0;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007b8ee8;
|
|
|
|
param_1[0x180] = &PTR_LAB_007b8ee4;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc9b0 at 0x004CC9B0 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004cc9b0(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004cc610();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cc9d0 at 0x004CC9D0 (size: 317) ---
|
|
|
|
|
|
void __fastcall FUN_004cc9d0(int *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
FUN_004639a0();
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar2 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = param_1 + 0x17e;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1f9,piVar2);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar2 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = param_1 + 0x17e;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd254,piVar2);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar2 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = param_1 + 0x17e;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186a8,piVar2);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar2 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar2 = param_1 + 0x17e;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd258,piVar2);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000064);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[0x181] = iVar3;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000067);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[0x182] = iVar3;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000006a);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = (**(code **)(*piVar1 + 0x94))(0x10000031);
|
|
|
|
}
|
|
|
|
param_1[0x183] = iVar3;
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_004e3220(param_1 + 0x180);
|
|
|
|
}
|
|
|
|
FUN_004e31c0(param_1[0x183]);
|
|
|
|
FUN_004e31c0(param_1[0x183]);
|
|
|
|
(**(code **)(*param_1 + 0x18))(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ccb40 at 0x004CCB40 (size: 43) ---
|
|
|
|
|
|
void __thiscall FUN_004ccb40(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00463830(param_2);
|
|
|
|
if (((*(uint *)(param_1 + 0x554) >> 0x11 & 1) != 0) && ((char)param_2 == '\0')) {
|
|
|
|
FUN_004cc8a0();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ccbd0 at 0x004CCBD0 (size: 19) ---
|
|
|
|
|
|
void FUN_004ccbd0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x1000000d,&LAB_004ccb10);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ccd30 at 0x004CCD30 (size: 82) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004ccd30(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
*param_1 = &PTR_FUN_007b9770;
|
|
|
|
*puVar1 = &PTR_FUN_007b94c8;
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd000 at 0x004CD000 (size: 19) ---
|
|
|
|
|
|
void FUN_004cd000(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x1000000c,&LAB_004ccc20);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd4c0 at 0x004CD4C0 (size: 115) ---
|
|
|
|
|
|
void __fastcall FUN_004cd4c0(int *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
uint uVar1;
|
|
|
|
int iVar2;
|
|
|
|
undefined4 *puVar3;
|
|
|
|
undefined4 local_c;
|
|
|
|
undefined4 local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
param_1[2] = 0;
|
|
|
|
if ((param_1[1] & 0x80000000U) != 0x80000000) {
|
|
|
|
if (*param_1 != 0) {
|
|
|
|
uVar1 = param_1[1] & 0x7fffffff;
|
|
|
|
if (-1 < (int)(uVar1 - 1)) {
|
|
|
|
iVar2 = (uVar1 - 1) * 0xc;
|
|
|
|
do {
|
|
|
|
puVar3 = (undefined4 *)(*param_1 + iVar2);
|
|
|
|
*puVar3 = local_c;
|
|
|
|
puVar3[1] = local_8;
|
|
|
|
iVar2 = iVar2 + -0xc;
|
|
|
|
uVar1 = uVar1 - 1;
|
|
|
|
puVar3[2] = local_4;
|
|
|
|
} while (uVar1 != 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
operator_delete__((void *)*param_1);
|
|
|
|
*param_1 = 0;
|
|
|
|
param_1[1] = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd540 at 0x004CD540 (size: 84) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cd540(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00472670(param_2,param_3);
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
*param_1 = &PTR_FUN_007b9da0;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007b9af8;
|
|
|
|
param_1[0x17f] = 0;
|
|
|
|
param_1[0x180] = 0;
|
|
|
|
param_1[0x181] = 0;
|
|
|
|
param_1[0x182] = 0;
|
|
|
|
param_1[0x183] = 0;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd600 at 0x004CD600 (size: 102) ---
|
|
|
|
|
|
void __fastcall FUN_004cd600(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
|
|
|
|
puVar1 = param_1 + 0x17e;
|
|
|
|
*param_1 = &PTR_FUN_007b9da0;
|
|
|
|
*puVar1 = &PTR_FUN_007b9af8;
|
|
|
|
FUN_004cd4c0();
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
if ((param_1[0x180] & 0x80000000) == 0x80000000) {
|
|
|
|
operator_delete__((void *)param_1[0x17f]);
|
|
|
|
}
|
|
|
|
*puVar1 = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd670 at 0x004CD670 (size: 19) ---
|
|
|
|
|
|
void FUN_004cd670(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000033,&LAB_004cd5d0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd690 at 0x004CD690 (size: 30) ---
|
|
|
|
|
|
void * __thiscall FUN_004cd690(void *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004cd600();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd7f0 at 0x004CD7F0 (size: 397) ---
|
|
|
|
|
|
void __fastcall FUN_004cd7f0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
uint uVar3;
|
|
|
|
int iStack_c;
|
|
|
|
|
|
|
|
iStack_c = 0x4cd7f9;
|
|
|
|
FUN_004639a0();
|
|
|
|
iStack_c = 0x4cd7fe;
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iStack_c = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iStack_c = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1f8);
|
|
|
|
if (param_1 == 0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = param_1 + 0x5f8;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1fb,iVar2);
|
|
|
|
}
|
|
|
|
iStack_c = FUN_00463c00(0x1000005d);
|
|
|
|
FUN_00460990(0x10000029,&stack0xfffffff8);
|
|
|
|
FUN_004f6840(&iStack_c);
|
|
|
|
iStack_c = FUN_00463c00(0x1000005e);
|
|
|
|
FUN_00460990(0x10000029,&stack0xfffffff8);
|
|
|
|
FUN_004f6840(&iStack_c);
|
|
|
|
iStack_c = FUN_00463c00(0x1000005f);
|
|
|
|
FUN_00460990(0x10000029,&stack0xfffffff8);
|
|
|
|
FUN_004f6840(&iStack_c);
|
|
|
|
iStack_c = FUN_00463c00(0x10000060);
|
|
|
|
FUN_00460990(0x10000029,&stack0xfffffff8);
|
|
|
|
FUN_004f6840(&iStack_c);
|
|
|
|
iStack_c = FUN_00463c00(0x10000062);
|
|
|
|
FUN_00460990(0x10000029,&stack0xfffffff8);
|
|
|
|
FUN_004f6840(&iStack_c);
|
|
|
|
uVar3 = 0;
|
|
|
|
if (*(int *)(param_1 + 0x604) != 0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
do {
|
|
|
|
(**(code **)(**(int **)(*(int *)(param_1 + 0x5fc) + iVar2) + 0x18))(0);
|
|
|
|
uVar3 = uVar3 + 1;
|
|
|
|
iVar2 = iVar2 + 0xc;
|
|
|
|
} while (uVar3 < *(uint *)(param_1 + 0x604));
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd8d0 at 0x004CD8D0 (size: 61) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cd8d0(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
*param_1 = &PTR_FUN_007ba0b8;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007ccb60;
|
|
|
|
FUN_0043c610();
|
|
|
|
FUN_004726c0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd910 at 0x004CD910 (size: 19) ---
|
|
|
|
|
|
void FUN_004cd910(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x1000003f,&LAB_004cd880);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cd930 at 0x004CD930 (size: 184) ---
|
|
|
|
|
|
void FUN_004cd930(undefined4 param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int iVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
|
|
|
|
iVar2 = FUN_0069fe00();
|
|
|
|
iVar3 = FUN_0069fe30();
|
|
|
|
FUN_004634c0(param_1,param_2);
|
|
|
|
iVar4 = FUN_0069fe00();
|
|
|
|
iVar5 = FUN_0069fe30();
|
|
|
|
if (iVar2 != iVar4) {
|
|
|
|
param_2 = 0;
|
|
|
|
cVar1 = FUN_00460b30(0x54,¶m_2);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
param_2 = 0;
|
|
|
|
}
|
|
|
|
FUN_004606b0(0x54,(param_2 - iVar2) + iVar4);
|
|
|
|
}
|
|
|
|
if (iVar3 != iVar5) {
|
|
|
|
param_2 = 0;
|
|
|
|
cVar1 = FUN_00460b30(0x55,¶m_2);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
param_2 = 0;
|
|
|
|
}
|
|
|
|
FUN_004606b0(0x55,(param_2 - iVar3) + iVar5);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdac0 at 0x004CDAC0 (size: 585) ---
|
|
|
|
|
|
void __fastcall FUN_004cdac0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
char cVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
undefined4 uVar6;
|
|
|
|
int local_18;
|
|
|
|
int iStack_14;
|
|
|
|
int local_10;
|
|
|
|
int *local_c;
|
|
|
|
int iStack_8;
|
|
|
|
uint uStack_4;
|
|
|
|
|
|
|
|
piVar1 = (int *)(param_1 + 4);
|
|
|
|
local_10 = 0;
|
|
|
|
local_18 = 0;
|
|
|
|
local_c = (int *)FUN_00463c00(0x1000046f);
|
|
|
|
if (local_c != (int *)0x0) {
|
|
|
|
cVar2 = FUN_00460b30(0x3c,&local_10);
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
cVar2 = FUN_00460b30(0x3e,&local_18);
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar3 = FUN_0069fe70();
|
|
|
|
iStack_14 = FUN_0069fe70();
|
|
|
|
iVar5 = *(int *)(param_1 + 0x84);
|
|
|
|
iStack_14 = iStack_14 + iVar3 / 2;
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar4 = FUN_0069fe70();
|
|
|
|
iStack_8 = *(int *)(param_1 + 0x84);
|
|
|
|
uStack_4 = (uint)(iVar5 < iVar4 / 2);
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar5 = FUN_0069fe70();
|
|
|
|
iVar4 = FUN_0069fe70();
|
|
|
|
if ((iVar4 + iStack_8 < iVar5) && (uStack_4 != 0)) {
|
|
|
|
iVar5 = *(int *)(param_1 + 0x84);
|
|
|
|
iVar3 = iVar5;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar5 = *(int *)(param_1 + 0x84);
|
|
|
|
iVar3 = iVar5 - iVar3 / 2;
|
|
|
|
}
|
|
|
|
if (*(char *)(param_1 + 0x64c) != '\0') {
|
|
|
|
if (*(int *)(param_1 + 0x654) < local_18) {
|
|
|
|
*(int *)(param_1 + 0x654) = local_18;
|
|
|
|
}
|
|
|
|
if (local_10 < *(int *)(param_1 + 0x654)) {
|
|
|
|
*(int *)(param_1 + 0x654) = local_10;
|
|
|
|
}
|
|
|
|
if (*(int *)(param_1 + 0x650) < 0) {
|
|
|
|
*(undefined4 *)(param_1 + 0x650) = 0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar5 = FUN_0069fe70();
|
|
|
|
if (iVar5 - local_18 < *(int *)(param_1 + 0x650)) {
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar5 = FUN_0069fe70();
|
|
|
|
*(int *)(param_1 + 0x650) = iVar5 - local_18;
|
|
|
|
}
|
|
|
|
*(undefined1 *)(param_1 + 0x64c) = 0;
|
|
|
|
(**(code **)(*local_c + 0x9c))(0x10000048);
|
|
|
|
iVar5 = *piVar1;
|
|
|
|
uVar6 = FUN_0069fe60(*(undefined4 *)(param_1 + 0x654));
|
|
|
|
(**(code **)(iVar5 + 0x30))(uVar6);
|
|
|
|
(**(code **)(*piVar1 + 0x2c))
|
|
|
|
(*(undefined4 *)(param_1 + 0x80),*(undefined4 *)(param_1 + 0x650));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
*(int *)(param_1 + 0x650) = iVar5;
|
|
|
|
uVar6 = FUN_0069fe70();
|
|
|
|
*(undefined4 *)(param_1 + 0x654) = uVar6;
|
|
|
|
*(undefined1 *)(param_1 + 0x64c) = 1;
|
|
|
|
(**(code **)(*local_c + 0x9c))(0x10000047);
|
|
|
|
if (iVar3 < 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
iVar5 = FUN_0069fe70();
|
|
|
|
if (iVar5 < local_18 + iVar3) {
|
|
|
|
(**(code **)(*piVar1 + 0xa0))();
|
|
|
|
local_18 = FUN_0069fe70();
|
|
|
|
local_18 = local_18 - iVar3;
|
|
|
|
}
|
|
|
|
iVar5 = *piVar1;
|
|
|
|
uVar6 = FUN_0069fe60(local_18);
|
|
|
|
(**(code **)(iVar5 + 0x30))(uVar6);
|
|
|
|
(**(code **)(*piVar1 + 0x2c))(*(undefined4 *)(param_1 + 0x80),iVar3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdd10 at 0x004CDD10 (size: 67) ---
|
|
|
|
|
|
void __thiscall FUN_004cdd10(int param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
|
|
|
|
cVar1 = '\0';
|
|
|
|
if (*(int *)(param_1 + 0x60c) != 0) {
|
|
|
|
cVar1 = FUN_004695e0();
|
|
|
|
}
|
|
|
|
FUN_004f4640(param_2,param_3);
|
|
|
|
if (cVar1 != '\0') {
|
|
|
|
FUN_00469440(*(undefined4 *)(*(int *)(param_1 + 0x60c) + 0x61c));
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdd60 at 0x004CDD60 (size: 106) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cdd60(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004f51b0(param_2,param_3);
|
|
|
|
param_1[0x18e] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007ba520;
|
|
|
|
param_1[1] = &PTR_FUN_007ba3e8;
|
|
|
|
param_1[399] = 0;
|
|
|
|
param_1[400] = 0;
|
|
|
|
param_1[0x191] = 0;
|
|
|
|
param_1[0x192] = 0;
|
|
|
|
*(undefined1 *)(param_1 + 0x193) = 0;
|
|
|
|
param_1[0x194] = 0;
|
|
|
|
param_1[0x195] = 0;
|
|
|
|
param_1[0x180] = 0x3f800000;
|
|
|
|
param_1[0x182] = 0x3f800000;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cde10 at 0x004CDE10 (size: 94) ---
|
|
|
|
|
|
void __fastcall FUN_004cde10(undefined4 *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
|
|
|
|
param_1[-1] = &PTR_FUN_007ba520;
|
|
|
|
*param_1 = &PTR_FUN_007ba3e8;
|
|
|
|
FUN_00465fb0(3);
|
|
|
|
FUN_00465fb0(0xb);
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar1 + 0xc))(param_1 + -1);
|
|
|
|
}
|
|
|
|
if ((param_1[399] & 0x80000000) == 0x80000000) {
|
|
|
|
operator_delete__((void *)param_1[0x18e]);
|
|
|
|
}
|
|
|
|
FUN_004f4dc0();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdea0 at 0x004CDEA0 (size: 240) ---
|
|
|
|
|
|
void FUN_004cdea0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
LONG LVar3;
|
|
|
|
undefined4 *unaff_ESI;
|
|
|
|
undefined4 *local_8;
|
|
|
|
int local_4;
|
|
|
|
|
|
|
|
iVar1 = FUN_00589fc0();
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
iVar2 = FUN_005583f0(iVar1);
|
|
|
|
if (iVar2 != 0) {
|
|
|
|
InterlockedIncrement((LONG *)(*(int *)(iVar2 + 0x9c) + 4));
|
|
|
|
FUN_0048c3e0(&DAT_007938af);
|
|
|
|
iVar2 = FUN_0058a000(iVar1,&local_8,1);
|
|
|
|
LVar3 = InterlockedDecrement(local_8 + 1);
|
|
|
|
if ((LVar3 == 0) && (local_8 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*local_8)(1);
|
|
|
|
}
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
(**(code **)(**(int **)(local_4 + 0x638) + 0x9c))(0x10000001);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
(**(code **)(**(int **)(local_4 + 0x638) + 0x9c))(1);
|
|
|
|
}
|
|
|
|
FUN_006a50f0(iVar2 == 0,iVar1,&stack0xfffffff0,1);
|
|
|
|
LVar3 = InterlockedDecrement(unaff_ESI + 1);
|
|
|
|
if ((LVar3 == 0) && (unaff_ESI != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*unaff_ESI)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdf90 at 0x004CDF90 (size: 34) ---
|
|
|
|
|
|
int __thiscall FUN_004cdf90(int param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004cde10();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete((void *)(param_1 + -4));
|
|
|
|
}
|
|
|
|
return param_1 + -4;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdfc0 at 0x004CDFC0 (size: 19) ---
|
|
|
|
|
|
void FUN_004cdfc0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000041,&LAB_004cde70);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cdfe0 at 0x004CDFE0 (size: 89) ---
|
|
|
|
|
|
int __thiscall FUN_004cdfe0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
|
|
|
uint uVar3;
|
|
|
|
|
|
|
|
iVar2 = param_2;
|
|
|
|
uVar3 = 0;
|
|
|
|
if (*(int *)(param_1 + 0x644) != 0) {
|
|
|
|
do {
|
|
|
|
iVar1 = *(int *)(*(int *)(param_1 + 0x63c) + uVar3 * 4);
|
|
|
|
if ((iVar1 != 0) && (FUN_00460990(0x1000000b,¶m_2), param_2 == iVar2)) {
|
|
|
|
return iVar1;
|
|
|
|
}
|
|
|
|
uVar3 = uVar3 + 1;
|
|
|
|
} while (uVar3 < *(uint *)(param_1 + 0x644));
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce050 at 0x004CE050 (size: 186) ---
|
|
|
|
|
|
undefined4 FUN_004ce050(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined1 *puVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
int **ppiVar6;
|
|
|
|
undefined4 uVar7;
|
|
|
|
int *local_18;
|
|
|
|
int local_14;
|
|
|
|
undefined1 local_10 [4];
|
|
|
|
undefined1 local_c [4];
|
|
|
|
int *local_8;
|
|
|
|
undefined4 local_4;
|
|
|
|
|
|
|
|
ppiVar6 = &local_18;
|
|
|
|
puVar4 = local_10;
|
|
|
|
puVar5 = &DAT_007ba288;
|
|
|
|
local_14 = 0;
|
|
|
|
local_18 = (int *)0x0;
|
|
|
|
FUN_00406d10(puVar4,&DAT_007ba288,ppiVar6);
|
|
|
|
FUN_00406570(puVar4,puVar5,ppiVar6);
|
|
|
|
piVar2 = local_18;
|
|
|
|
uVar7 = 0;
|
|
|
|
local_8 = (int *)0x0;
|
|
|
|
local_4 = 0;
|
|
|
|
piVar3 = local_18;
|
|
|
|
if (local_18 != (int *)0x0) {
|
|
|
|
(**(code **)(*local_18 + 0x10))(local_18,0);
|
|
|
|
}
|
|
|
|
piVar3 = (int *)FUN_0048bb00(local_c,piVar3,uVar7);
|
|
|
|
iVar1 = *piVar3;
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
piVar2 = local_8;
|
|
|
|
if (local_8 != (int *)0x0) {
|
|
|
|
if (-1 < iVar1) {
|
|
|
|
FUN_00590c20(0xbc,&local_14,0,0);
|
|
|
|
if ((local_14 == 0xc) || (local_14 == 0xd)) {
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar2 + 0x14))();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce110 at 0x004CE110 (size: 160) ---
|
|
|
|
|
|
void __fastcall FUN_004ce110(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
char cVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
uint uVar5;
|
|
|
|
int local_4;
|
|
|
|
|
|
|
|
uVar5 = 0;
|
|
|
|
local_4 = param_1;
|
|
|
|
if (*(int *)(param_1 + 0x644) != 0) {
|
|
|
|
do {
|
|
|
|
piVar1 = *(int **)(*(int *)(param_1 + 0x63c) + uVar5 * 4);
|
|
|
|
if ((piVar1 != (int *)0x0) && (FUN_00460990(0x1000000b,&local_4), local_4 != 0)) {
|
|
|
|
iVar3 = FUN_004ce050();
|
|
|
|
if (iVar3 == 0) {
|
|
|
|
cVar2 = FUN_00589f00(local_4);
|
|
|
|
iVar3 = (-(uint)(cVar2 != '\0') & 0xfffffff4) + 0xd;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ((local_4 == 0xd) || (local_4 == 1)) {
|
|
|
|
(**(code **)(*piVar1 + 0x9c))(1);
|
|
|
|
goto LAB_004ce193;
|
|
|
|
}
|
|
|
|
iVar3 = 0xd;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 0x9c))(iVar3);
|
|
|
|
}
|
|
|
|
LAB_004ce193:
|
|
|
|
uVar5 = uVar5 + 1;
|
|
|
|
} while (uVar5 < *(uint *)(param_1 + 0x644));
|
|
|
|
}
|
|
|
|
uVar4 = FUN_00589fc0();
|
|
|
|
FUN_004ce3a0(uVar4);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce1b0 at 0x004CE1B0 (size: 432) ---
|
|
|
|
|
|
void __thiscall FUN_004ce1b0(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
int *piVar2;
|
|
|
|
undefined1 local_90 [4];
|
|
|
|
undefined4 local_8c;
|
|
|
|
|
|
|
|
piVar2 = (int *)FUN_004cdfe0(param_2);
|
|
|
|
if (piVar2 == (int *)0x0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (piVar2[0x100] == 0xd) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c980(0x10000001);
|
|
|
|
switch(param_2) {
|
|
|
|
case 1:
|
|
|
|
FUN_00589e70(1);
|
|
|
|
local_8c = DAT_00840aec;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
FUN_00589e70(2);
|
|
|
|
local_8c = DAT_00840b00;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
FUN_00589e70(3);
|
|
|
|
local_8c = DAT_00840af4;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
FUN_00589e70(4);
|
|
|
|
local_8c = DAT_00840afc;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
FUN_00589e70(5);
|
|
|
|
local_8c = DAT_00840af8;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
FUN_00589e70(6);
|
|
|
|
local_8c = DAT_00840b04;
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
FUN_00589f60(1);
|
|
|
|
FUN_00589e70(7);
|
|
|
|
local_8c = DAT_00840af0;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
FUN_00589e70(8);
|
|
|
|
local_8c = DAT_00840b30;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
FUN_00589e70(9);
|
|
|
|
local_8c = DAT_00840b34;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
FUN_00589e70(10);
|
|
|
|
local_8c = DAT_00840b38;
|
|
|
|
break;
|
|
|
|
case 0xb:
|
|
|
|
FUN_00589e70(0xb);
|
|
|
|
local_8c = DAT_00840b3c;
|
|
|
|
break;
|
|
|
|
case 0xc:
|
|
|
|
FUN_00589e70(0xc);
|
|
|
|
local_8c = DAT_00840b40;
|
|
|
|
break;
|
|
|
|
case 0xd:
|
|
|
|
FUN_00589e70(0xd);
|
|
|
|
local_8c = DAT_00840b44;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto switchD_004ce202_default;
|
|
|
|
}
|
|
|
|
if ((*(int *)(param_1 + 0x648) != 0) && (cVar1 = FUN_0042ce00(1), cVar1 != '\0')) {
|
|
|
|
FUN_0046a350(local_90);
|
|
|
|
}
|
|
|
|
FUN_004ce110();
|
|
|
|
(**(code **)(*piVar2 + 0x9c))(0x10000001);
|
|
|
|
switchD_004ce202_default:
|
|
|
|
FUN_0042e590();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce3a0 at 0x004CE3A0 (size: 779) ---
|
|
|
|
|
|
void __thiscall FUN_004ce3a0(int param_1,int param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int iVar1;
|
|
|
|
LONG LVar2;
|
|
|
|
int *piVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined *puVar5;
|
|
|
|
LONG *lpAddend;
|
|
|
|
undefined *puVar6;
|
|
|
|
int *local_9c;
|
|
|
|
int *local_98;
|
|
|
|
int local_94;
|
|
|
|
undefined1 local_90 [144];
|
|
|
|
|
|
|
|
local_9c = (int *)FUN_004cdfe0(2);
|
|
|
|
puVar5 = PTR_DAT_00818340;
|
|
|
|
lpAddend = (LONG *)(PTR_DAT_00818340 + -0x10);
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
iVar1 = FUN_005583f0(param_2);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
local_98 = (int *)FUN_0058f8b0(&local_94,0,0);
|
|
|
|
if (puVar5 != (undefined *)*local_98) {
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(puVar5 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(puVar5 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(puVar5 + -0x14))(1);
|
|
|
|
}
|
|
|
|
puVar5 = (undefined *)*local_98;
|
|
|
|
lpAddend = (LONG *)(puVar5 + -0x10);
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
}
|
|
|
|
local_98 = (int *)(local_94 + -0x14);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(local_94 + -0x10));
|
|
|
|
if ((LVar2 == 0) && (local_98 != (undefined4 *)0x0)) {
|
|
|
|
(**(code **)*local_98)(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*(int *)(puVar5 + -4) == 1) {
|
|
|
|
if (*(int *)(param_1 + 0x638) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840b08,0x10000001);
|
|
|
|
puVar6 = puVar5;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
FUN_0042e8e0(DAT_00840b68,puVar6);
|
|
|
|
FUN_0046a350(local_90);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x638) + 0x9c))(0xd);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
piVar3 = local_9c;
|
|
|
|
if (local_9c != (int *)0x0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840b28,0x10000001);
|
|
|
|
FUN_0046a350(local_90);
|
|
|
|
(**(code **)(*piVar3 + 0x9c))(0xd);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
FUN_00589eb0(2,0);
|
|
|
|
iVar1 = FUN_00589e90();
|
|
|
|
if (iVar1 == 2) {
|
|
|
|
FUN_004ce1b0(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (*(int *)(param_1 + 0x638) != 0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840b08,0x10000001);
|
|
|
|
puVar6 = puVar5;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
FUN_0042e8e0(DAT_00840b68,puVar6);
|
|
|
|
FUN_0046a350(local_90);
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x638) + 0x9c))(1);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
if (local_9c != (int *)0x0) {
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840b24,0x10000001);
|
|
|
|
puVar6 = puVar5;
|
|
|
|
InterlockedIncrement(lpAddend);
|
|
|
|
FUN_0042e8e0(DAT_00840b68,puVar6);
|
|
|
|
piVar3 = local_9c;
|
|
|
|
FUN_0046a350(local_90);
|
|
|
|
(**(code **)(*piVar3 + 0x9c))(1);
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
FUN_00589eb0(2,1);
|
|
|
|
if ((param_2 != 0) && (piVar3 = (int *)FUN_005583f0(param_2), piVar3 != (int *)0x0)) {
|
|
|
|
uVar4 = (**(code **)(*piVar3 + 0x18))();
|
|
|
|
iVar1 = FUN_005ad860(uVar4);
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
FUN_0048c3e0(&DAT_007938af);
|
|
|
|
iVar1 = FUN_0058a000(param_2,&local_9c,1);
|
|
|
|
FUN_005abb30();
|
|
|
|
if (iVar1 != 0) {
|
|
|
|
(**(code **)(**(int **)(param_1 + 0x638) + 0x9c))(0x10000001);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_00589fa0(param_2);
|
|
|
|
LVar2 = InterlockedDecrement((LONG *)(puVar5 + -0x10));
|
|
|
|
if ((LVar2 == 0) && ((undefined4 *)(puVar5 + -0x14) != (undefined4 *)0x0)) {
|
|
|
|
(*(code *)**(undefined4 **)(puVar5 + -0x14))(1);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce6b0 at 0x004CE6B0 (size: 60) ---
|
|
|
|
|
|
void __thiscall FUN_004ce6b0(int *param_1,undefined4 *param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
char cVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
|
|
|
|
if ((param_1[1] & 0x7fffffffU) <= (uint)param_1[2]) {
|
|
|
|
uVar2 = FUN_00453850((param_1[1] & 0x7fffffffU) + 1);
|
|
|
|
cVar1 = FUN_004180a0(uVar2);
|
|
|
|
if (cVar1 == '\0') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*(undefined4 *)(*param_1 + param_1[2] * 4) = *param_2;
|
|
|
|
param_1[2] = param_1[2] + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce6f0 at 0x004CE6F0 (size: 157) ---
|
|
|
|
|
|
void __thiscall FUN_004ce6f0(int param_1,int *param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
char cVar2;
|
|
|
|
int iVar3;
|
|
|
|
|
|
|
|
piVar1 = param_2;
|
|
|
|
if (param_2[2] == 1) {
|
|
|
|
if (*param_2 == 0x1000046f) {
|
|
|
|
FUN_004cdac0();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (param_2[2] == 7) {
|
|
|
|
iVar3 = (**(code **)(*(int *)param_2[1] + 0x94))(6);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_0046d4b0(0,0);
|
|
|
|
}
|
|
|
|
if (piVar1[4] != 0) {
|
|
|
|
if (piVar1[4] == *(int *)(param_1 + 0x634)) {
|
|
|
|
FUN_004cdea0();
|
|
|
|
FUN_004f5e20(piVar1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cVar2 = FUN_00460990(0x1000000b,¶m_2);
|
|
|
|
if (cVar2 != '\0') {
|
|
|
|
FUN_004ce1b0(param_2);
|
|
|
|
FUN_004f5e20(piVar1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FUN_004f5e20(piVar1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce790 at 0x004CE790 (size: 303) ---
|
|
|
|
|
|
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
|
|
|
|
|
|
|
|
void FUN_004ce790(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
double dVar1;
|
|
|
|
char cVar2;
|
|
|
|
int iVar3;
|
|
|
|
int *piVar4;
|
|
|
|
undefined4 uVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
float10 fVar8;
|
|
|
|
|
|
|
|
dVar1 = _DAT_008379a8;
|
|
|
|
if (_DAT_008379a8 < _DAT_00840a18) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar3 = FUN_00589fc0();
|
|
|
|
cVar2 = FUN_00589f00(2);
|
|
|
|
iVar6 = DAT_00871e54;
|
|
|
|
if (cVar2 == '\0') {
|
|
|
|
piVar4 = (int *)FUN_005583f0(DAT_00871e54);
|
|
|
|
if (piVar4 == (int *)0x0) goto LAB_004ce8a8;
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar3 = *(int *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
if (iVar6 == iVar3) goto LAB_004ce8a8;
|
|
|
|
uVar5 = (**(code **)(*piVar4 + 0x18))();
|
|
|
|
iVar3 = FUN_005ad860(uVar5);
|
|
|
|
if (iVar3 == 0) goto LAB_004ce8a8;
|
|
|
|
FUN_0055e1d0(1,0);
|
|
|
|
fVar8 = (float10)FUN_0055e5a0();
|
|
|
|
uVar5 = FUN_0048e5f0((double)fVar8);
|
|
|
|
iVar3 = FUN_0058cfd0(iVar6,uVar5);
|
|
|
|
if (iVar3 == 0) goto LAB_004ce8a8;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (iVar3 == 0) goto LAB_004ce8a8;
|
|
|
|
iVar6 = FUN_005583f0(iVar3);
|
|
|
|
if (iVar6 != 0) {
|
|
|
|
iVar7 = FUN_0058df90();
|
|
|
|
if (iVar7 != 0) goto LAB_004ce8a8;
|
|
|
|
if (*(int *)(iVar6 + 0xb4) != 0) {
|
|
|
|
iVar3 = *(int *)(iVar6 + 0xb4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (DAT_0083da58 == 0) {
|
|
|
|
uVar5 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar5 = *(undefined4 *)(DAT_0083da58 + 0xf4);
|
|
|
|
}
|
|
|
|
FUN_0055e1d0(1,0);
|
|
|
|
fVar8 = (float10)FUN_0055e5a0();
|
|
|
|
iVar6 = FUN_0058cfd0(iVar3,uVar5,(double)fVar8);
|
|
|
|
if (iVar6 != 0) goto LAB_004ce8a8;
|
|
|
|
iVar6 = 0;
|
|
|
|
}
|
|
|
|
FUN_004ce3a0(iVar6);
|
|
|
|
LAB_004ce8a8:
|
|
|
|
_DAT_00840a18 = _DAT_007ba310 + dVar1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ce8c0 at 0x004CE8C0 (size: 1011) ---
|
|
|
|
|
|
void __fastcall FUN_004ce8c0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 uVar1;
|
|
|
|
int *piVar2;
|
|
|
|
int iVar3;
|
|
|
|
undefined4 uVar4;
|
|
|
|
undefined1 auStack_94 [148];
|
|
|
|
|
|
|
|
piVar2 = (int *)FUN_00463c00(0x10000014);
|
|
|
|
if ((piVar2 != (int *)0x0) && (iVar3 = (**(code **)(*piVar2 + 0x94))(6), iVar3 != 0)) {
|
|
|
|
FUN_0044dcb0();
|
|
|
|
FUN_0046ce20();
|
|
|
|
FUN_0042dc80();
|
|
|
|
FUN_0042c9c0(DAT_00840b0c,0x10000001);
|
|
|
|
uVar4 = FUN_0046d800(auStack_94);
|
|
|
|
uVar1 = DAT_00840b1c;
|
|
|
|
*(undefined4 *)(param_1 + 0x638) = uVar4;
|
|
|
|
FUN_0042c9c0(uVar1,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,5);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b28,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,2);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b20,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,4);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b10,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,1);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b2c,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,6);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b18,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,3);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b14,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,7);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b48,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,8);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b4c,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,9);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b50,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,10);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b54,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,0xb);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b58,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,0xc);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042c9c0(DAT_00840b5c,0x10000001);
|
|
|
|
iVar3 = FUN_0046d800(auStack_94);
|
|
|
|
if (iVar3 != 0) {
|
|
|
|
FUN_00460470(0x1000000b,0xd);
|
|
|
|
FUN_004ce6b0(&stack0xffffff68);
|
|
|
|
}
|
|
|
|
FUN_0042e590();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ced10 at 0x004CED10 (size: 141) ---
|
|
|
|
|
|
void FUN_004ced10(int param_1,char param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
piVar1 = (int *)FUN_004cdfe0(param_1);
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
iVar2 = FUN_004ce050();
|
|
|
|
if ((((iVar2 != 0) && (param_1 != 0xd)) && (param_1 != 1)) && (param_1 != 2)) {
|
|
|
|
(**(code **)(*piVar1 + 0x9c))(0xd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((((bool)param_2 == (piVar1[0x100] == 0xd)) &&
|
|
|
|
((**(code **)(*piVar1 + 0x9c))((-(uint)(param_2 != '\0') & 0xfffffff4) + 0xd),
|
|
|
|
param_2 == '\0')) && (iVar2 = FUN_00589e90(), iVar2 == param_1)) {
|
|
|
|
FUN_004ce1b0(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ceda0 at 0x004CEDA0 (size: 240) ---
|
|
|
|
|
|
void __fastcall FUN_004ceda0(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
undefined4 uVar2;
|
|
|
|
int iVar3;
|
|
|
|
int iVar4;
|
|
|
|
|
|
|
|
FUN_004f4a30();
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000015);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
uVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uVar2 = (**(code **)(*piVar1 + 0x94))(0xc);
|
|
|
|
}
|
|
|
|
*(undefined4 *)(param_1 + 0x644) = uVar2;
|
|
|
|
FUN_00465f90(3);
|
|
|
|
FUN_00465f90(0xb);
|
|
|
|
piVar1 = DAT_00837ff4;
|
|
|
|
iVar4 = param_1 + -4;
|
|
|
|
if (DAT_00837ff4 != (int *)0x0) {
|
|
|
|
iVar3 = param_1;
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
iVar3 = 0;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_00837ff4 + 0x34))(0x1000000d,iVar3,0xbc2);
|
|
|
|
if (iVar4 == 0) {
|
|
|
|
param_1 = 0;
|
|
|
|
}
|
|
|
|
(**(code **)(*piVar1 + 0x34))(0x1000000a,param_1,1000);
|
|
|
|
}
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1ef,iVar4);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd251,iVar4);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1f8,iVar4);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x186b2,iVar4);
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd271,iVar4);
|
|
|
|
}
|
|
|
|
FUN_004ce8c0();
|
|
|
|
FUN_004ce3a0(0);
|
|
|
|
FUN_004ce1b0(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cee90 at 0x004CEE90 (size: 68) ---
|
|
|
|
|
|
void FUN_004cee90(int param_1,undefined4 param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (param_1 == 3) {
|
|
|
|
FUN_004ce790();
|
|
|
|
}
|
|
|
|
else if (param_1 != 0xb) {
|
|
|
|
FUN_004f44a0(param_1,param_2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FUN_004ce110();
|
|
|
|
FUN_004f44a0(param_1,param_2);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cef70 at 0x004CEF70 (size: 36) ---
|
|
|
|
|
|
void __fastcall FUN_004cef70(int param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
if (piVar1 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd270,param_1 + -4);
|
|
|
|
}
|
|
|
|
FUN_004f4a30();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004ceff0 at 0x004CEFF0 (size: 66) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004ceff0(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
undefined4 *puVar1;
|
|
|
|
int *piVar2;
|
|
|
|
|
|
|
|
puVar1 = param_1 + -1;
|
|
|
|
*puVar1 = &PTR_FUN_007bad48;
|
|
|
|
*param_1 = &PTR_FUN_007bac10;
|
|
|
|
piVar2 = (int *)FUN_0043c680();
|
|
|
|
if (piVar2 != (int *)0x0) {
|
|
|
|
(**(code **)(*piVar2 + 0xc))(puVar1);
|
|
|
|
}
|
|
|
|
FUN_004f4dc0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(puVar1);
|
|
|
|
}
|
|
|
|
return puVar1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cf040 at 0x004CF040 (size: 19) ---
|
|
|
|
|
|
void FUN_004cf040(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x10000040,&LAB_004cef30);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cf820 at 0x004CF820 (size: 156) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cf820(undefined4 *param_1,undefined4 param_2,undefined4 param_3)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_004c08d0(param_2,param_3);
|
|
|
|
param_1[0x186] = 0;
|
|
|
|
param_1[0x187] = 0;
|
|
|
|
param_1[0x188] = 0;
|
|
|
|
param_1[0x189] = 0;
|
|
|
|
param_1[0x18a] = 0;
|
|
|
|
param_1[0x18b] = 0;
|
|
|
|
param_1[0x18c] = 0;
|
|
|
|
param_1[0x18d] = 0;
|
|
|
|
param_1[0x18e] = 0;
|
|
|
|
param_1[399] = 0;
|
|
|
|
param_1[400] = 0;
|
|
|
|
param_1[0x191] = 0;
|
|
|
|
param_1[0x192] = 0;
|
|
|
|
param_1[0x193] = 0;
|
|
|
|
param_1[0x194] = 0;
|
|
|
|
param_1[0x195] = 0;
|
|
|
|
param_1[0x196] = 0;
|
|
|
|
*param_1 = &PTR_FUN_007bb398;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007bb0f0;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007bb0e4;
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cf960 at 0x004CF960 (size: 56) ---
|
|
|
|
|
|
undefined4 * __thiscall FUN_004cf960(undefined4 *param_1,byte param_2)
|
|
|
|
|
|
|
|
{
|
|
|
|
*param_1 = &PTR_FUN_007bb398;
|
|
|
|
param_1[0x17e] = &PTR_FUN_007bb0f0;
|
|
|
|
param_1[0x17f] = &PTR_LAB_007bb0e4;
|
|
|
|
FUN_004c07a0();
|
|
|
|
if ((param_2 & 1) != 0) {
|
|
|
|
operator_delete(param_1);
|
|
|
|
}
|
|
|
|
return param_1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cf9a0 at 0x004CF9A0 (size: 19) ---
|
|
|
|
|
|
void FUN_004cf9a0(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
FUN_00460270(0x1000004d,&LAB_004cf900);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- FUN_004cf9c0 at 0x004CF9C0 (size: 859) ---
|
|
|
|
|
|
void __fastcall FUN_004cf9c0(int *param_1)
|
|
|
|
|
|
|
|
{
|
|
|
|
int *piVar1;
|
|
|
|
int iVar2;
|
|
|
|
|
|
|
|
FUN_004c0960();
|
|
|
|
FUN_00460990(0x1000007e,param_1 + 0x186);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,2,piVar1);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,1,piVar1);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,4,piVar1);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,3,piVar1);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,6,piVar1);
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
|
|
piVar1 = (int *)0x0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
piVar1 = param_1 + 0x17f;
|
|
|
|
}
|
|
|
|
(**(code **)(*DAT_008f958c + 8))(9,5,piVar1);
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063c);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(2);
|
|
|
|
}
|
|
|
|
param_1[0x187] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063e);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x188] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000640);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(2);
|
|
|
|
}
|
|
|
|
param_1[0x189] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000642);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x18a] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063b);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x18b] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063d);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x18c] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063f);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x18d] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000641);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(9);
|
|
|
|
}
|
|
|
|
param_1[0x18e] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000634);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[399] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000636);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[400] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000638);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x191] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x1000063a);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x192] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000633);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x193] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000635);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x194] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000637);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x195] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_00463c00(0x10000639);
|
|
|
|
if (piVar1 == (int *)0x0) {
|
|
|
|
iVar2 = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
iVar2 = (**(code **)(*piVar1 + 0x94))(3);
|
|
|
|
}
|
|
|
|
param_1[0x196] = iVar2;
|
|
|
|
piVar1 = (int *)FUN_0043c680();
|
|
|
|
(**(code **)(*piVar1 + 4))(0x4dd1f0,param_1 + 0x17e);
|
|
|
|
FUN_00465f90(0xd);
|
|
|
|
/* WARNING: Could not recover jumptable at 0x004cfd15. Too many branches */
|
|
|
|
/* WARNING: Treating indirect jump as call */
|
|
|
|
(**(code **)(*param_1 + 0x138))();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|