Files
BT411/reference/decomp/all/part_016.c
T
Joe DiPrimaandClaude Fable 5 f44be87ab2 #60 PART 2: the RE-EXPORT -- dark code 90KB -> 41KB, coverage 87.3% -> 93.5%
Installed JDK 21 + Ghidra 12.1.2 (no admin, %LOCALAPPDATA%\bt411-tools beside
DXSDK/cmake; runner uses 8.3 SHORT paths because Ghidra's .bat expands
%JAVA_HOME% unquoted and the profile has a space).

New tooling: reference/ghidra_scripts/ExportGaps.java -- ExportAll's exact
output contract PLUS a gap-fill pass (force disassembly + createFunction at
E8 call targets outside functions, data->code pointers at a plausible
prologue, and the census's discovered starts; iterated to a fixpoint,
logged to gapfill_report.tsv).  tools/ghidra_reexport.sh (headless runner,
'reprocess' mode) and tools/gapdiff.py (score two censused exports);
gapcensus.py now censuses any export dir.

Results: 6267 -> 6472 functions (+205 created in 2 rounds: 195 census
starts, 6 call targets, 4 data pointers; 56.1KB newly covered), ZERO
decompile failures.  Dark real code 90.4 -> 40.8 KB (54.8% recovered);
game-side dark 53.1 -> 21.1 KB; regions 428 -> 321.  EVERY historically
dark function now has pseudocode -- including @0x4c05c4 VehicleDead, the
absence that opened this issue.

VALIDATION: the new pseudocode confirms this week's hand reconstruction of
the crouch field-for-field (mapPosture/duckState/squatCapable/myomerEff/
novice gate/SetLegAnimation/ForceUpdate/stability alarm) -- and exposed one
branch the raw pass missed: AIRBORNE AUTO-RISE (mode 3|4 && legState 1 ->
forced squ), now implemented in mech4.cpp and re-benched un-regressed.

PROMOTION: the re-export is canonical reference/decomp/; the previous export
is preserved at reference/decomp/archive_2025export/ so old
`part_0NN.c:LINE` citations still resolve (addresses are stable across both;
line/shard membership is NOT -- cite @ADDR).

New lead recorded: @0x4c0904 is the MASTER BTPlayer Performance (team
resolution, EndMission console post, score heartbeat) -- our @0x4c083c
PlayerSimulation attribution needs a re-check.  KB: source-completeness,
gotcha #20 (the rule is cheap now -- look it up), CLAUDE.md router/layout.
Log: phases/phase-04-gap-census.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 11:11:26 -05:00

1594 lines
35 KiB
C

/* @004dee3c file=? name=FUN_004dee3c */
void __cdecl FUN_004dee3c(UINT param_1)
{
FUN_004dedcc(1,0,param_1);
return;
}
/* @004dee74 file=? name=FUN_004dee74 */
int __cdecl FUN_004dee74(char *param_1)
{
int iVar1;
int iVar2;
int *piVar3;
iVar1 = FUN_004d4a78(param_1);
for (piVar3 = DAT_005252b4; *piVar3 != 0; piVar3 = piVar3 + 1) {
iVar2 = FUN_004d4ae0((char *)*piVar3,param_1,iVar1);
if ((iVar2 == 0) && (*(char *)(*piVar3 + iVar1) == '=')) break;
}
if (*piVar3 == 0) {
iVar1 = 0;
}
else {
iVar1 = iVar1 + *piVar3 + 1;
}
return iVar1;
}
/* @004deec4 file=? name=FUN_004deec4 */
void FUN_004deec4(void)
{
return;
}
/* @004df048 file=? name=FUN_004df048 */
void __cdecl FUN_004df048(int *param_1,int *param_2)
{
if ((*(char *)*param_2 == '\\') && (((char *)*param_2)[1] == '\"')) {
*(undefined1 *)*param_1 = 0x22;
*param_2 = *param_2 + 2;
}
else {
*(undefined1 *)*param_1 = *(undefined1 *)*param_2;
*param_2 = *param_2 + 1;
}
*param_1 = *param_1 + 1;
return;
}
/* @004df078 file=? name=FUN_004df078 */
void __cdecl FUN_004df078(int *param_1,int param_2)
{
int iVar1;
int *piVar2;
uint uVar3;
uint uVar4;
int *piVar5;
int *piVar6;
if (DAT_005252a8 == DAT_005252b0) {
DAT_005252b0 = DAT_005252b0 + 0x10;
DAT_005252ac = FUN_004de760(DAT_005252ac,DAT_005252b0 * 4);
if (DAT_005252ac == (int *)0x0) {
FUN_004ded48(s_No_space_for_command_line_argume_00520c4a);
}
}
piVar2 = param_1;
if (param_2 != 0) {
iVar1 = FUN_004d4a78((char *)param_1);
piVar2 = FUN_004de55c(iVar1 + 1);
if (piVar2 == (int *)0x0) {
FUN_004ded48(s_No_space_for_command_line_argume_00520c74);
}
uVar3 = 0xffffffff;
do {
piVar5 = param_1;
if (uVar3 == 0) break;
uVar3 = uVar3 - 1;
piVar5 = (int *)((int)param_1 + 1);
iVar1 = *param_1;
param_1 = piVar5;
} while ((char)iVar1 != '\0');
uVar3 = ~uVar3;
piVar5 = (int *)((int)piVar5 - uVar3);
piVar6 = piVar2;
for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
*piVar6 = *piVar5;
piVar5 = piVar5 + 1;
piVar6 = piVar6 + 1;
}
for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
*(char *)piVar6 = (char)*piVar5;
piVar5 = (int *)((int)piVar5 + 1);
piVar6 = (int *)((int)piVar6 + 1);
}
}
DAT_005252ac[DAT_005252a8] = (int)piVar2;
DAT_005252a8 = DAT_005252a8 + 1;
return;
}
/* @004df128 file=? name=FUN_004df128 */
void __cdecl FUN_004df128(int *param_1)
{
FUN_004df078(param_1,0);
return;
}
/* @004df13c file=? name=FUN_004df13c */
char * __cdecl FUN_004df13c(char *param_1,char *param_2)
{
uint uVar1;
uint uVar2;
char cVar3;
char *pcVar4;
char *pcVar5;
for (; (cVar3 = *param_2, cVar3 != '\0' && (cVar3 != '=')); param_2 = param_2 + 1) {
if (('`' < cVar3) && (cVar3 < '{')) {
cVar3 = cVar3 + -0x20;
}
*param_1 = cVar3;
param_1 = param_1 + 1;
}
uVar1 = 0xffffffff;
do {
pcVar4 = param_2;
if (uVar1 == 0) break;
uVar1 = uVar1 - 1;
pcVar4 = param_2 + 1;
cVar3 = *param_2;
param_2 = pcVar4;
} while (cVar3 != '\0');
uVar1 = ~uVar1;
pcVar4 = pcVar4 + -uVar1;
pcVar5 = param_1;
for (uVar2 = uVar1 >> 2; uVar2 != 0; uVar2 = uVar2 - 1) {
*(undefined4 *)pcVar5 = *(undefined4 *)pcVar4;
pcVar4 = pcVar4 + 4;
pcVar5 = pcVar5 + 4;
}
for (uVar1 = uVar1 & 3; uVar1 != 0; uVar1 = uVar1 - 1) {
*pcVar5 = *pcVar4;
pcVar4 = pcVar4 + 1;
pcVar5 = pcVar5 + 1;
}
return param_1;
}
/* @004df190 file=? name=FUN_004df190 */
void FUN_004df190(void)
{
int iVar1;
int *piVar2;
char *pcVar3;
int iVar4;
iVar4 = 0;
pcVar3 = DAT_005252c8;
while( true ) {
iVar1 = FUN_004d4a78(pcVar3);
if (iVar1 == 0) break;
iVar4 = iVar4 + 1;
pcVar3 = pcVar3 + iVar1 + 1;
}
DAT_005252b4 = FUN_004de55c((iVar4 + 1) * 4);
if (DAT_005252b4 != (int *)0x0) {
iVar4 = 0;
pcVar3 = DAT_005252c8;
while( true ) {
iVar1 = FUN_004d4a78(pcVar3);
if (iVar1 == 0) break;
piVar2 = FUN_004de55c(iVar1 + 1);
if (piVar2 == (int *)0x0) break;
FUN_004df13c((char *)piVar2,pcVar3);
DAT_005252b4[iVar4] = (int)piVar2;
iVar4 = iVar4 + 1;
pcVar3 = pcVar3 + iVar1 + 1;
}
DAT_005252d8 = DAT_005252b4;
DAT_005252b4[iVar4] = 0;
}
return;
}
/* @004df214 file=? name=FUN_004df214 */
int __cdecl FUN_004df214(int param_1)
{
int iVar1;
int *piVar2;
iVar1 = 0;
piVar2 = &DAT_00520cc8;
do {
if (param_1 == *piVar2) {
return iVar1;
}
iVar1 = iVar1 + 1;
piVar2 = piVar2 + 1;
} while (iVar1 < 10);
return -1;
}
/* @004df234 file=? name=FUN_004df234 */
undefined4 __cdecl FUN_004df234(int *param_1,undefined4 param_2,int param_3)
{
code *pcVar1;
undefined4 uVar2;
int iVar3;
uint uVar4;
undefined4 local_8;
uVar4 = 0;
iVar3 = *param_1;
if (iVar3 < -0x3fffff6e) {
if (iVar3 == -0x3fffff6f) {
iVar3 = 2;
local_8 = 0x84;
uVar4 = 8;
}
else if (iVar3 == -0x3ffffffb) {
iVar3 = 3;
local_8 = 0xc;
}
else if (iVar3 == -0x3fffffe3) {
iVar3 = 1;
local_8 = 0x14;
}
else if (iVar3 == -0x3fffff72) {
iVar3 = 2;
local_8 = 0x83;
uVar4 = 4;
}
else {
if (iVar3 != -0x3fffff70) {
return 1;
}
iVar3 = 2;
local_8 = 0x81;
uVar4 = 1;
}
}
else if (iVar3 == -0x3fffff6e) {
iVar3 = 2;
local_8 = 0x87;
uVar4 = 0x49;
}
else if (iVar3 == -0x3fffff6d) {
iVar3 = 2;
local_8 = 0x85;
uVar4 = 0x10;
}
else if (iVar3 == -0x3fffff6c) {
iVar3 = 2;
local_8 = 0x7f;
}
else {
if (iVar3 != -0x3fffff6a) {
return 1;
}
iVar3 = 1;
local_8 = 0x16;
}
pcVar1 = *(code **)(&DAT_00520ca0 + iVar3 * 4);
if (pcVar1 == (code *)0x1) {
uVar2 = 0;
}
else if (pcVar1 == (code *)0x0) {
uVar2 = 1;
}
else {
*(undefined4 *)(&DAT_00520ca0 + iVar3 * 4) = 0;
if (((iVar3 == 1) || (iVar3 == 3)) || (iVar3 == 2)) {
FUN_004dc9a0();
FUN_004dc9f8();
(*pcVar1)((&DAT_00520cc8)[iVar3],local_8);
*(uint *)(param_3 + 0x20) = *(uint *)(param_3 + 0x20) & ~uVar4;
}
else {
(*pcVar1)((&DAT_00520cc8)[iVar3]);
}
uVar2 = 0;
}
return uVar2;
}
/* @004df3a4 file=? name=FUN_004df3a4 */
undefined4 FUN_004df3a4(int param_1)
{
int iVar1;
iVar1 = 2;
if (param_1 != 0) {
iVar1 = 0x15;
}
FUN_004df428(iVar1);
return 1;
}
/* @004df3c8 file=? name=FUN_004df3c8 */
undefined4 __cdecl FUN_004df3c8(int param_1,undefined4 param_2)
{
undefined4 uVar1;
int iVar2;
if (DAT_00520c9c == '\0') {
DAT_00524c6c = FUN_004df234;
SetConsoleCtrlHandler(FUN_004df3a4,1);
DAT_00520c9c = '\x01';
}
iVar2 = FUN_004df214(param_1);
if (iVar2 == -1) {
DAT_00520bcc = 0x13;
return 0xffffffff;
}
uVar1 = *(undefined4 *)(&DAT_00520ca0 + iVar2 * 4);
*(undefined4 *)(&DAT_00520ca0 + iVar2 * 4) = param_2;
return uVar1;
}
/* @004df428 file=? name=FUN_004df428 */
undefined4 __cdecl FUN_004df428(int param_1)
{
code *pcVar1;
int iVar2;
undefined4 uVar3;
iVar2 = FUN_004df214(param_1);
if (iVar2 == -1) {
uVar3 = 1;
}
else {
pcVar1 = *(code **)(&DAT_00520ca0 + iVar2 * 4);
if (pcVar1 != (code *)0x1) {
if (pcVar1 == (code *)0x0) {
if ((1 < param_1 - 0x10U) && (param_1 != 0x14)) {
if (param_1 == 0x16) {
FUN_004deda4();
}
else {
FUN_004dee3c(3);
}
}
}
else {
*(undefined4 *)(&DAT_00520ca0 + iVar2 * 4) = 0;
if ((&DAT_00520cf0)[iVar2] == '\0') {
(*pcVar1)(param_1);
}
else {
(*pcVar1)(param_1,(&DAT_00520cf0)[iVar2]);
}
}
}
uVar3 = 0;
}
return uVar3;
}
/* @004df4a4 file=? name=FUN_004df4a4 */
undefined4 FUN_004df4a4(void)
{
return 0;
}
/* @004df4a8 file=? name=FUN_004df4a8 */
undefined4 FUN_004df4a8(void)
{
return 0;
}
/* @004df4ac file=? name=FUN_004df4ac */
undefined4 __cdecl FUN_004df4ac(int *param_1,uint param_2)
{
undefined4 *puVar1;
char *pcVar2;
undefined4 uVar3;
uint uVar4;
char *pcVar5;
int *local_10;
int local_c;
char *local_8;
uVar4 = 0;
if (param_2 == 0) {
uVar4 = 0xffff;
}
local_8 = (char *)0x0;
local_10 = param_1;
for (local_c = 0; local_10 = local_10 + 1, local_c < *param_1; local_c = local_c + 1) {
puVar1 = (undefined4 *)*local_10;
if (param_2 == 0) {
pcVar2 = (char *)*puVar1;
pcVar5 = (char *)puVar1[1];
}
else {
pcVar2 = (char *)puVar1[2];
pcVar5 = (char *)puVar1[3];
}
for (; (pcVar2 < pcVar5 && (*(int *)(pcVar2 + 2) != 0)); pcVar2 = pcVar2 + 6) {
if ((*pcVar2 == '\0') && (param_2 == uVar4 <= (byte)pcVar2[1])) {
uVar4 = (uint)(byte)pcVar2[1];
local_8 = pcVar2;
}
}
}
if (local_8 == (char *)0x0) {
uVar3 = 0;
}
else {
*local_8 = '\x01';
uVar3 = *(undefined4 *)(local_8 + 2);
}
return uVar3;
}
/* @004df558 file=? name=FUN_004df558 */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
void __cdecl FUN_004df558(int param_1)
{
char cVar1;
int *piVar2;
code *pcVar3;
HMODULE pHVar4;
UINT UVar5;
char cVar6;
int *piVar7;
char *pcVar8;
undefined4 uVar9;
undefined4 uVar10;
int local_10;
undefined1 local_c [8];
_DAT_005252e8 = *(uint *)(param_1 + 0x10) & 1;
FUN_004dcd7c();
FUN_004dd494(*(undefined **)(param_1 + 0x1c),*(undefined **)(param_1 + 0x20));
FUN_004d6db0(*(undefined **)(param_1 + 0x28));
_DAT_005252dc = 1;
_DAT_005252e0 = param_1;
DAT_005252c4 = local_c;
FUN_004d69d0();
DAT_005252c8 = GetEnvironmentStrings();
DAT_005252cc = GetCommandLineA();
FUN_004deec4();
piVar2 = (int *)FUN_004df4a4();
if (piVar2 != (int *)0x0) {
piVar2[*piVar2 + 1] = -1;
while (pcVar3 = (code *)FUN_004df4ac(piVar2,0), pcVar3 != (code *)0x0) {
(*pcVar3)();
}
piVar7 = piVar2;
for (local_10 = 0; piVar7 = piVar7 + 1, local_10 < *piVar2; local_10 = local_10 + 1) {
(**(code **)(*piVar7 + 0x18))(0,*(undefined4 *)(*piVar7 + 0x14));
}
}
while (pcVar3 = (code *)FUN_004df4ac((int *)&DAT_005252dc,0), pcVar3 != (code *)0x0) {
(*pcVar3)();
}
pcVar8 = DAT_005252cc;
if ((*(byte *)(param_1 + 0x10) & 1) == 0) {
UVar5 = (**(code **)(param_1 + 0x18))(DAT_005252d0,DAT_005252d4,DAT_005252d8);
FUN_004dee24(UVar5);
}
else {
for (; (*pcVar8 == ' ' || (*pcVar8 == '\t')); pcVar8 = pcVar8 + 1) {
}
if (*pcVar8 == '\"') {
cVar6 = '\"';
pcVar8 = pcVar8 + 1;
}
else {
cVar6 = ' ';
}
for (; ((cVar1 = *pcVar8, cVar1 != '\0' && (cVar6 != cVar1)) && (cVar1 != '\t'));
pcVar8 = pcVar8 + 1) {
}
if (*pcVar8 == '\"') {
pcVar8 = pcVar8 + 1;
}
for (; ((cVar6 = *pcVar8, cVar6 != '\0' && (cVar6 == ' ')) || (cVar6 == '\t'));
pcVar8 = pcVar8 + 1) {
}
uVar10 = 10;
uVar9 = 0;
pHVar4 = GetModuleHandleA((LPCSTR)0x0);
UVar5 = (**(code **)(param_1 + 0x18))(pHVar4,uVar9,pcVar8,uVar10);
FUN_004dee24(UVar5);
}
return;
}
/* @004df6bc file=? name=FUN_004df6bc */
void FUN_004df6bc(void)
{
code *pcVar1;
int *piVar2;
int *piVar3;
int iVar4;
while (pcVar1 = (code *)FUN_004df4ac((int *)&DAT_005252dc,1), pcVar1 != (code *)0x0) {
(*pcVar1)();
}
while (pcVar1 = (code *)FUN_004df4ac((int *)&DAT_005252bc,1), pcVar1 != (code *)0x0) {
(*pcVar1)();
}
piVar2 = (int *)FUN_004df4a8();
if (piVar2 != (int *)0x0) {
while (pcVar1 = (code *)FUN_004df4ac(piVar2,1), pcVar1 != (code *)0x0) {
(*pcVar1)();
}
piVar3 = piVar2;
for (iVar4 = 0; piVar3 = piVar3 + 1, iVar4 < *piVar2; iVar4 = iVar4 + 1) {
(**(code **)(*piVar3 + 0x18))(1,*(undefined4 *)(*piVar3 + 0x14));
}
}
return;
}
/* @004df734 file=? name=FUN_004df734 */
void FUN_004df734(UINT param_1)
{
/* WARNING: Subroutine does not return */
ExitProcess(param_1);
}
/* @004df748 file=? name=FUN_004df748 */
void __cdecl FUN_004df748(undefined1 *param_1)
{
FUN_004d7f10(param_1,s__s__s__02d__02d__02d__02d__4d_s_00520d00);
return;
}
/* @004df794 file=? name=FUN_004df794 */
undefined * FUN_004df794(void)
{
FUN_004df748(&DAT_005252ec);
return &DAT_005252ec;
}
/* @004df7b4 file=? name=FUN_004df7b4 */
void __cdecl FUN_004df7b4(int *param_1)
{
FUN_004df950(param_1);
FUN_004df794();
return;
}
/* @004df7cc file=? name=FUN_004df7cc */
undefined4 * __cdecl FUN_004df7cc(uint param_1,int param_2)
{
ulonglong uVar1;
bool bVar2;
undefined3 extraout_var;
uint uVar3;
uint uVar4;
int local_8;
DAT_00525308 = param_1 % 0x3c;
DAT_0052530c = (undefined4)(((ulonglong)param_1 / 0x3c) % 0x3c);
uVar1 = ((ulonglong)param_1 / 0x3c) / 0x3c;
local_8 = (int)(uVar1 / 0x88f8);
DAT_0052531c = local_8 * 4 + 0x46;
local_8 = local_8 * 0x5b5;
uVar4 = (uint)(uVar1 % 0x88f8);
while( true ) {
uVar3 = 0x2238;
if ((DAT_0052531c & 3) == 0) {
uVar3 = 0x2250;
}
if (uVar4 < uVar3) break;
local_8 = local_8 + uVar3 / 0x18;
DAT_0052531c = DAT_0052531c + 1;
uVar4 = uVar4 - uVar3;
}
if (((param_2 == 0) || (DAT_00520ef4 == 0)) ||
(bVar2 = FUN_004dfb04(uVar4 % 0x18,uVar4 / 0x18,0,DAT_0052531c - 0x46),
CONCAT31(extraout_var,bVar2) == 0)) {
DAT_00525328 = 0;
}
else {
uVar4 = uVar4 + 1;
DAT_00525328 = 1;
}
DAT_00525310 = uVar4 % 0x18;
DAT_00525324 = uVar4 / 0x18;
DAT_00525320 = (local_8 + DAT_00525324 + 4) % 7;
uVar4 = DAT_00525324 + 1;
DAT_00525314 = uVar4;
if ((((DAT_0052531c & 3) == 0) && (DAT_00525314 = DAT_00525324, uVar4 < 0x3d)) &&
(DAT_00525314 = uVar4, uVar4 == 0x3c)) {
DAT_00525318 = 1;
DAT_00525314 = 0x1d;
}
else {
for (DAT_00525318 = 0; (uint)(int)(char)(&DAT_00520dc4)[DAT_00525318] < DAT_00525314;
DAT_00525318 = DAT_00525318 + 1) {
DAT_00525314 = DAT_00525314 - (int)(char)(&DAT_00520dc4)[DAT_00525318];
}
}
return &DAT_00525308;
}
/* @004df938 file=? name=FUN_004df938 */
void __cdecl FUN_004df938(uint *param_1)
{
FUN_004df7cc(*param_1,0);
return;
}
/* @004df950 file=? name=FUN_004df950 */
undefined4 * __cdecl FUN_004df950(int *param_1)
{
undefined4 *puVar1;
if (*param_1 < DAT_00520ef0) {
return (undefined4 *)0x0;
}
puVar1 = FUN_004df7cc(*param_1 - DAT_00520ef0,1);
return puVar1;
}
/* @004df97c file=? name=FUN_004df97c */
undefined * FUN_004df97c(void)
{
char cVar1;
char *pcVar2;
uint uVar3;
DWORD DVar4;
int iVar5;
undefined *puVar6;
char *pcVar7;
int iVar8;
_TIME_ZONE_INFORMATION local_bc;
pcVar2 = (char *)FUN_004dee74(&DAT_00520ef8);
if ((((((pcVar2 == (char *)0x0) || (uVar3 = FUN_004d4a78(pcVar2), uVar3 < 4)) ||
(((&DAT_005207dd)[*pcVar2] & 0xc) == 0)) ||
((((&DAT_005207dd)[pcVar2[1]] & 0xc) == 0 || (((&DAT_005207dd)[pcVar2[2]] & 0xc) == 0)))) ||
((cVar1 = pcVar2[3], cVar1 != '-' && ((cVar1 != '+' && (((&DAT_005207dd)[cVar1] & 2) == 0)))))
) || ((((&DAT_005207dd)[pcVar2[3]] & 2) == 0 && (((&DAT_005207dd)[pcVar2[4]] & 2) == 0)))) {
DVar4 = GetTimeZoneInformation(&local_bc);
DAT_00520ef4 = (uint)(DVar4 == 2);
DAT_00520ef0 = (local_bc.Bias + local_bc.StandardBias) * 0x3c;
*PTR_DAT_00520ee8 = DAT_00520efb;
puVar6 = PTR_DAT_00520eec;
*PTR_DAT_00520eec = DAT_00520efc;
return puVar6;
}
FUN_004d4988((undefined4 *)PTR_DAT_00520eec,0,4);
FUN_004d4b9c((undefined4 *)PTR_DAT_00520ee8,pcVar2,3);
PTR_DAT_00520ee8[3] = 0;
iVar5 = FUN_004dd1e0(pcVar2 + 3);
DAT_00520ef0 = iVar5 * 0xe10;
iVar5 = 0;
DAT_00520ef4 = 0;
iVar8 = 3;
pcVar7 = pcVar2 + 3;
while( true ) {
cVar1 = *pcVar7;
if (cVar1 == '\0') {
DAT_00520ef4 = 0;
return (undefined *)CONCAT31((int3)((uint)iVar5 >> 8),cVar1);
}
iVar5 = (int)cVar1;
if (((&DAT_005207dd)[iVar5] & 0xc) != 0) break;
iVar8 = iVar8 + 1;
pcVar7 = pcVar7 + 1;
}
puVar6 = (undefined *)FUN_004d4a78(pcVar2 + iVar8);
if (puVar6 < (undefined *)0x3) {
return puVar6;
}
if ((((undefined *)(int)pcVar7[1])[0x5207dd] & 0xc) == 0) {
return (undefined *)(int)pcVar7[1];
}
if ((((undefined *)(int)pcVar7[2])[0x5207dd] & 0xc) == 0) {
return (undefined *)(int)pcVar7[2];
}
FUN_004d4b9c((undefined4 *)PTR_DAT_00520eec,pcVar2 + iVar8,3);
puVar6 = PTR_DAT_00520eec;
PTR_DAT_00520eec[3] = 0;
DAT_00520ef4 = 1;
return puVar6;
}
/* @004dfb04 file=? name=FUN_004dfb04 */
bool __cdecl FUN_004dfb04(uint param_1,uint param_2,uint param_3,uint param_4)
{
uint *puVar1;
int iVar2;
uint uVar3;
bool bVar4;
uint local_8;
if (param_3 == 0) {
local_8 = param_2;
if ((0x3a < param_2) && ((param_4 + 0x46 & 3) == 0)) {
local_8 = param_2 - 1;
}
param_3 = 0;
for (puVar1 = &DAT_00520dd0; *puVar1 <= local_8; puVar1 = puVar1 + 1) {
param_3 = param_3 + 1;
}
}
else {
param_2 = param_2 + (&DAT_00520dcc)[param_3];
if ((2 < param_3) && ((param_4 + 0x46 & 3) == 0)) {
param_2 = param_2 + 1;
}
}
if ((param_3 < 4) || (10 < param_3)) {
bVar4 = false;
}
else if ((param_3 < 5) || (9 < param_3)) {
if ((param_4 < 0x11) || (param_3 != 4)) {
iVar2 = (&DAT_00520dd0)[param_3];
}
else {
iVar2 = iRam00520ddc + 7;
}
if ((param_4 + 0x46 & 3) != 0) {
iVar2 = iVar2 + -1;
}
uVar3 = iVar2 - ((param_4 + 1 >> 2) + iVar2 + param_4 * 0x16d + 4) % 7;
if (param_3 == 4) {
if (uVar3 < param_2) {
bVar4 = true;
}
else if (param_2 < uVar3) {
bVar4 = false;
}
else {
bVar4 = 1 < param_1;
}
}
else if (param_2 < uVar3) {
bVar4 = true;
}
else if (uVar3 < param_2) {
bVar4 = false;
}
else {
bVar4 = param_1 < 2;
}
}
else {
bVar4 = true;
}
return bVar4;
}
/* @004dfc18 file=? name=FUN_004dfc18 */
int __cdecl FUN_004dfc18(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6)
{
int iVar1;
char *pcVar2;
bool bVar3;
char *pcVar4;
int iVar5;
undefined3 extraout_var;
uint uVar6;
int iVar7;
uint uVar8;
uint uVar9;
int local_8;
if ((param_1 < 0x46) || (0x8a < param_1)) {
local_8 = -1;
}
else {
iVar1 = param_5 + param_6 / 0x3c;
iVar5 = param_4 + iVar1 / 0x3c;
uVar8 = param_3 + iVar5 / 0x18;
uVar6 = iVar5 % 0x18;
uVar9 = param_1 + param_2 / 0xc;
pcVar2 = &DAT_00520dc4 + param_2 % 0xc;
iVar5 = param_2 % 0xc;
while (iVar7 = iVar5, pcVar4 = pcVar2, (int)*pcVar4 <= (int)uVar8) {
if (((uVar9 & 3) == 0) && (iVar7 == 1)) {
if ((int)uVar8 < 0x1d) break;
iVar5 = -0x1d;
}
else {
iVar5 = -(int)*pcVar4;
}
uVar8 = uVar8 + iVar5;
pcVar2 = pcVar4 + 1;
iVar5 = iVar7 + 1;
if (0xb < iVar7 + 1) {
uVar9 = uVar9 + 1;
pcVar2 = pcVar4 + -0xb;
iVar5 = iVar7 + -0xb;
}
}
iVar5 = uVar9 - 0x44;
if (iVar5 < 0) {
iVar5 = uVar9 - 0x41;
}
iVar5 = iVar5 >> 2;
if (((uVar9 & 3) == 0) && (iVar7 < 2)) {
iVar5 = iVar5 + -1;
}
local_8 = (iVar5 + (uVar9 - 0x46) * 0x16d + (&DAT_00520dd0)[iVar7] + uVar8) * 0x15180 +
uVar6 * 0xe10 + (iVar1 % 0x3c) * 0x3c + param_6 % 0x3c + DAT_00520ef0;
if ((DAT_00520ef4 != 0) &&
(bVar3 = FUN_004dfb04(uVar6,uVar8,iVar7 + 1,uVar9 - 0x46), CONCAT31(extraout_var,bVar3) != 0)
) {
local_8 = local_8 + -0xe10;
}
if (local_8 < 1) {
local_8 = -1;
}
}
return local_8;
}
/* @004dfd90 file=? name=FUN_004dfd90 */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
int FUN_004dfd90(void)
{
DWORD DVar1;
DVar1 = GetTickCount();
return DVar1 - _DAT_00520f00;
}
/* @004dfda8 file=? name=FUN_004dfda8 */
void __cdecl FUN_004dfda8(int *param_1)
{
int iVar1;
_SYSTEMTIME local_14;
GetLocalTime(&local_14);
iVar1 = FUN_004dfc18(local_14.wYear - 0x76c,local_14.wMonth - 1,local_14.wDay - 1,
(uint)local_14.wHour,(uint)local_14.wMinute,(uint)local_14.wSecond);
if (param_1 != (int *)0x0) {
*param_1 = iVar1;
}
return;
}
/* @004dfdf3 file=? name=GetStartupInfoA */
void GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
{
/* WARNING: Could not recover jumptable at 0x004dfdf3. Too many branches */
/* WARNING: Treating indirect jump as call */
GetStartupInfoA(lpStartupInfo);
return;
}
/* @004dfdf9 file=? name=DeleteFileA */
BOOL DeleteFileA(LPCSTR lpFileName)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfdf9. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = DeleteFileA(lpFileName);
return BVar1;
}
/* @004dfdff file=? name=ExitProcess */
void ExitProcess(UINT uExitCode)
{
/* WARNING: Could not recover jumptable at 0x004dfdff. Too many branches */
/* WARNING: Subroutine does not return */
/* WARNING: Treating indirect jump as call */
ExitProcess(uExitCode);
return;
}
/* @004dfe05 file=? name=CloseHandle */
BOOL CloseHandle(HANDLE hObject)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe05. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = CloseHandle(hObject);
return BVar1;
}
/* @004dfe0b file=? name=GetConsoleMode */
BOOL GetConsoleMode(HANDLE hConsoleHandle,LPDWORD lpMode)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe0b. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = GetConsoleMode(hConsoleHandle,lpMode);
return BVar1;
}
/* @004dfe11 file=? name=GetCurrentDirectoryA */
DWORD GetCurrentDirectoryA(DWORD nBufferLength,LPSTR lpBuffer)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe11. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetCurrentDirectoryA(nBufferLength,lpBuffer);
return DVar1;
}
/* @004dfe17 file=? name=GetCurrentThreadId */
DWORD GetCurrentThreadId(void)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe17. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetCurrentThreadId();
return DVar1;
}
/* @004dfe1d file=? name=GetDriveTypeA */
UINT GetDriveTypeA(LPCSTR lpRootPathName)
{
UINT UVar1;
/* WARNING: Could not recover jumptable at 0x004dfe1d. Too many branches */
/* WARNING: Treating indirect jump as call */
UVar1 = GetDriveTypeA(lpRootPathName);
return UVar1;
}
/* @004dfe23 file=? name=CreateFileA */
HANDLE CreateFileA(LPCSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,HANDLE hTemplateFile)
{
HANDLE pvVar1;
/* WARNING: Could not recover jumptable at 0x004dfe23. Too many branches */
/* WARNING: Treating indirect jump as call */
pvVar1 = CreateFileA(lpFileName,dwDesiredAccess,dwShareMode,lpSecurityAttributes,
dwCreationDisposition,dwFlagsAndAttributes,hTemplateFile);
return pvVar1;
}
/* @004dfe29 file=? name=GetEnvironmentVariableA */
DWORD GetEnvironmentVariableA(LPCSTR lpName,LPSTR lpBuffer,DWORD nSize)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe29. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetEnvironmentVariableA(lpName,lpBuffer,nSize);
return DVar1;
}
/* @004dfe2f file=? name=GetFileAttributesA */
DWORD GetFileAttributesA(LPCSTR lpFileName)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe2f. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetFileAttributesA(lpFileName);
return DVar1;
}
/* @004dfe35 file=? name=GetFileType */
DWORD GetFileType(HANDLE hFile)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe35. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetFileType(hFile);
return DVar1;
}
/* @004dfe3b file=? name=GetLastError */
DWORD GetLastError(void)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe3b. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetLastError();
return DVar1;
}
/* @004dfe41 file=? name=GetLocalTime */
void GetLocalTime(LPSYSTEMTIME lpSystemTime)
{
/* WARNING: Could not recover jumptable at 0x004dfe41. Too many branches */
/* WARNING: Treating indirect jump as call */
GetLocalTime(lpSystemTime);
return;
}
/* @004dfe47 file=? name=GetLogicalDrives */
DWORD GetLogicalDrives(void)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe47. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetLogicalDrives();
return DVar1;
}
/* @004dfe4d file=? name=GetModuleFileNameA */
DWORD GetModuleFileNameA(HMODULE hModule,LPSTR lpFilename,DWORD nSize)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe4d. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetModuleFileNameA(hModule,lpFilename,nSize);
return DVar1;
}
/* @004dfe53 file=? name=GetModuleHandleA */
HMODULE GetModuleHandleA(LPCSTR lpModuleName)
{
HMODULE pHVar1;
/* WARNING: Could not recover jumptable at 0x004dfe53. Too many branches */
/* WARNING: Treating indirect jump as call */
pHVar1 = GetModuleHandleA(lpModuleName);
return pHVar1;
}
/* @004dfe59 file=? name=GetNumberOfConsoleInputEvents */
BOOL GetNumberOfConsoleInputEvents(HANDLE hConsoleInput,LPDWORD lpNumberOfEvents)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe59. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = GetNumberOfConsoleInputEvents(hConsoleInput,lpNumberOfEvents);
return BVar1;
}
/* @004dfe5f file=? name=GetEnvironmentStrings */
LPCH GetEnvironmentStrings(void)
{
LPCH pCVar1;
/* WARNING: Could not recover jumptable at 0x004dfe5f. Too many branches */
/* WARNING: Treating indirect jump as call */
pCVar1 = GetEnvironmentStrings();
return pCVar1;
}
/* @004dfe65 file=? name=GetCommandLineA */
LPSTR GetCommandLineA(void)
{
LPSTR pCVar1;
/* WARNING: Could not recover jumptable at 0x004dfe65. Too many branches */
/* WARNING: Treating indirect jump as call */
pCVar1 = GetCommandLineA();
return pCVar1;
}
/* @004dfe6b file=? name=GetStdHandle */
HANDLE GetStdHandle(DWORD nStdHandle)
{
HANDLE pvVar1;
/* WARNING: Could not recover jumptable at 0x004dfe6b. Too many branches */
/* WARNING: Treating indirect jump as call */
pvVar1 = GetStdHandle(nStdHandle);
return pvVar1;
}
/* @004dfe71 file=? name=GetTickCount */
DWORD GetTickCount(void)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe71. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetTickCount();
return DVar1;
}
/* @004dfe77 file=? name=GetTimeZoneInformation */
DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe77. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetTimeZoneInformation(lpTimeZoneInformation);
return DVar1;
}
/* @004dfe7d file=? name=GetVersion */
DWORD GetVersion(void)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfe7d. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = GetVersion();
return DVar1;
}
/* @004dfe83 file=? name=PeekConsoleInputA */
BOOL PeekConsoleInputA(HANDLE hConsoleInput,PINPUT_RECORD lpBuffer,DWORD nLength,
LPDWORD lpNumberOfEventsRead)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe83. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = PeekConsoleInputA(hConsoleInput,lpBuffer,nLength,lpNumberOfEventsRead);
return BVar1;
}
/* @004dfe89 file=? name=RaiseException */
void RaiseException(DWORD dwExceptionCode,DWORD dwExceptionFlags,DWORD nNumberOfArguments,
ULONG_PTR *lpArguments)
{
/* WARNING: Could not recover jumptable at 0x004dfe89. Too many branches */
/* WARNING: Treating indirect jump as call */
RaiseException(dwExceptionCode,dwExceptionFlags,nNumberOfArguments,lpArguments);
return;
}
/* @004dfe8f file=? name=ReadConsoleInputA */
BOOL ReadConsoleInputA(HANDLE hConsoleInput,PINPUT_RECORD lpBuffer,DWORD nLength,
LPDWORD lpNumberOfEventsRead)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe8f. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = ReadConsoleInputA(hConsoleInput,lpBuffer,nLength,lpNumberOfEventsRead);
return BVar1;
}
/* @004dfe95 file=? name=ReadFile */
BOOL ReadFile(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfe95. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = ReadFile(hFile,lpBuffer,nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped);
return BVar1;
}
/* @004dfe9b file=? name=RtlUnwind */
void RtlUnwind(PVOID TargetFrame,PVOID TargetIp,PEXCEPTION_RECORD ExceptionRecord,PVOID ReturnValue)
{
/* WARNING: Could not recover jumptable at 0x004dfe9b. Too many branches */
/* WARNING: Treating indirect jump as call */
RtlUnwind(TargetFrame,TargetIp,ExceptionRecord,ReturnValue);
return;
}
/* @004dfea1 file=? name=SetConsoleCtrlHandler */
BOOL SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,BOOL Add)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfea1. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = SetConsoleCtrlHandler(HandlerRoutine,Add);
return BVar1;
}
/* @004dfea7 file=? name=SetConsoleMode */
BOOL SetConsoleMode(HANDLE hConsoleHandle,DWORD dwMode)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfea7. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = SetConsoleMode(hConsoleHandle,dwMode);
return BVar1;
}
/* @004dfead file=? name=SetCurrentDirectoryA */
BOOL SetCurrentDirectoryA(LPCSTR lpPathName)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfead. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = SetCurrentDirectoryA(lpPathName);
return BVar1;
}
/* @004dfeb3 file=? name=SetEnvironmentVariableA */
BOOL SetEnvironmentVariableA(LPCSTR lpName,LPCSTR lpValue)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfeb3. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = SetEnvironmentVariableA(lpName,lpValue);
return BVar1;
}
/* @004dfeb9 file=? name=SetFilePointer */
DWORD SetFilePointer(HANDLE hFile,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod
)
{
DWORD DVar1;
/* WARNING: Could not recover jumptable at 0x004dfeb9. Too many branches */
/* WARNING: Treating indirect jump as call */
DVar1 = SetFilePointer(hFile,lDistanceToMove,lpDistanceToMoveHigh,dwMoveMethod);
return DVar1;
}
/* @004dfebf file=? name=SetHandleCount */
UINT SetHandleCount(UINT uNumber)
{
UINT UVar1;
/* WARNING: Could not recover jumptable at 0x004dfebf. Too many branches */
/* WARNING: Treating indirect jump as call */
UVar1 = SetHandleCount(uNumber);
return UVar1;
}
/* @004dfec5 file=? name=UnhandledExceptionFilter */
LONG UnhandledExceptionFilter(_EXCEPTION_POINTERS *ExceptionInfo)
{
LONG LVar1;
/* WARNING: Could not recover jumptable at 0x004dfec5. Too many branches */
/* WARNING: Treating indirect jump as call */
LVar1 = UnhandledExceptionFilter(ExceptionInfo);
return LVar1;
}
/* @004dfecb file=? name=VirtualAlloc */
LPVOID VirtualAlloc(LPVOID lpAddress,SIZE_T dwSize,DWORD flAllocationType,DWORD flProtect)
{
LPVOID pvVar1;
/* WARNING: Could not recover jumptable at 0x004dfecb. Too many branches */
/* WARNING: Treating indirect jump as call */
pvVar1 = VirtualAlloc(lpAddress,dwSize,flAllocationType,flProtect);
return pvVar1;
}
/* @004dfed1 file=? name=VirtualFree */
BOOL VirtualFree(LPVOID lpAddress,SIZE_T dwSize,DWORD dwFreeType)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfed1. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = VirtualFree(lpAddress,dwSize,dwFreeType);
return BVar1;
}
/* @004dfed7 file=? name=WriteFile */
BOOL WriteFile(HANDLE hFile,LPCVOID lpBuffer,DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,LPOVERLAPPED lpOverlapped)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfed7. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = WriteFile(hFile,lpBuffer,nNumberOfBytesToWrite,lpNumberOfBytesWritten,lpOverlapped);
return BVar1;
}
/* @004dfedd file=? name=GetProcAddress */
FARPROC GetProcAddress(HMODULE hModule,LPCSTR lpProcName)
{
FARPROC pFVar1;
/* WARNING: Could not recover jumptable at 0x004dfedd. Too many branches */
/* WARNING: Treating indirect jump as call */
pFVar1 = GetProcAddress(hModule,lpProcName);
return pFVar1;
}
/* @004dfee3 file=? name=MessageBoxA */
int MessageBoxA(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType)
{
int iVar1;
/* WARNING: Could not recover jumptable at 0x004dfee3. Too many branches */
/* WARNING: Treating indirect jump as call */
iVar1 = MessageBoxA(hWnd,lpText,lpCaption,uType);
return iVar1;
}
/* @004dfee9 file=? name=EnumThreadWindows */
BOOL EnumThreadWindows(DWORD dwThreadId,WNDENUMPROC lpfn,LPARAM lParam)
{
BOOL BVar1;
/* WARNING: Could not recover jumptable at 0x004dfee9. Too many branches */
/* WARNING: Treating indirect jump as call */
BVar1 = EnumThreadWindows(dwThreadId,lpfn,lParam);
return BVar1;
}