CODE
This commit is contained in:
parent
4092af3513
commit
35b2c67e73
|
@ -5,8 +5,12 @@ project(reman3)
|
|||
option(R3_32BIT "Build for 32-bit compatibility" ON)
|
||||
|
||||
if(R3_32BIT)
|
||||
add_compile_options(-m32)
|
||||
add_link_options(-m32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
add_link_options(/machine:x86)
|
||||
else()
|
||||
add_compile_options(-m32)
|
||||
add_link_options(-m32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(GAME_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/game)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
function(setup_target TARGET DBG_MODE)
|
||||
add_executable(${TARGET}
|
||||
r3/main.cxx
|
||||
r3/binders/stub.cxx
|
||||
gh_global.cxx
|
||||
)
|
||||
|
||||
|
@ -45,11 +46,17 @@ function(setup_target TARGET DBG_MODE)
|
|||
${GH_STUB_SOURCES}
|
||||
)
|
||||
|
||||
# Ignore -Wformat-security
|
||||
target_compile_options(${TARGET} PRIVATE -Wno-format-security)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_definitions(${TARGET} PRIVATE MSVC=1)
|
||||
else()
|
||||
target_compile_definitions(${TARGET} PRIVATE MSVC=0)
|
||||
|
||||
# Ignore -Wmicrosoft-cast
|
||||
target_compile_options(${TARGET} PRIVATE -Wno-microsoft-cast)
|
||||
# Ignore -Wformat-security
|
||||
target_compile_options(${TARGET} PRIVATE -Wno-format-security)
|
||||
|
||||
# Ignore -Wmicrosoft-cast
|
||||
target_compile_options(${TARGET} PRIVATE -Wno-microsoft-cast)
|
||||
endif()
|
||||
|
||||
# Automatically re-run CMake if any gh_*.cxx files change
|
||||
# due to ghidra script runs
|
||||
|
@ -94,7 +101,7 @@ function(setup_target TARGET DBG_MODE)
|
|||
)
|
||||
execute_process(
|
||||
COMMAND ${gh_tool} -d${CMAKE_CURRENT_SOURCE_DIR}/gh.db
|
||||
hooks -o ${CMAKE_CURRENT_BINARY_DIR}/hooks.def
|
||||
hooks -o ${CMAKE_CURRENT_BINARY_DIR}/hooks.def
|
||||
)
|
||||
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
extern "C" {
|
||||
undefined r3_wait_for_dvd(char *param_1, char *param_2,
|
||||
undefined4 param_3); // 0043e540 // r3_wait_for_dvd
|
||||
|
||||
// 004464f0
|
||||
void r3_checkDisc(void)
|
||||
|
||||
{
|
||||
char cVar1;
|
||||
DWORD logicalDriveBits;
|
||||
UINT UVar2;
|
||||
int iVar3;
|
||||
char *pcVar4;
|
||||
char *pcVar5;
|
||||
CHAR local_41c[256];
|
||||
CHAR local_31c[264];
|
||||
char local_214[260];
|
||||
int local_110;
|
||||
char local_10c[260];
|
||||
int local_8;
|
||||
|
||||
logicalDriveBits = GetLogicalDrives();
|
||||
g_driveLetter[0] = s_driveLetterTemplate[0];
|
||||
g_driveLetter[1] = s_driveLetterTemplate[1];
|
||||
g_driveLetter[2] = s_driveLetterTemplate[2];
|
||||
g_driveLetter[3] = s_driveLetterTemplate[3];
|
||||
local_110 = 0;
|
||||
g_currentBinkMovie.movieName[0] = '\0';
|
||||
|
||||
#if RE_AUTHENTIC == 0
|
||||
do {
|
||||
do {
|
||||
if (local_110 != 0) {
|
||||
return;
|
||||
}
|
||||
for (local_8 = 0; local_8 < 0x20; local_8 = local_8 + 1) {
|
||||
if ((logicalDriveBits & 1 << ((byte)local_8 & 0x1f)) != 0) {
|
||||
g_driveLetter[0] = (byte)local_8 + 0x41;
|
||||
UVar2 = GetDriveTypeA(g_driveLetter);
|
||||
if (UVar2 == 5) {
|
||||
GetVolumeInformationA(g_driveLetter, s_volumeNameBuffer, 0x80,
|
||||
(LPDWORD)0x0, (LPDWORD)0x0, (LPDWORD)0x0,
|
||||
(LPSTR)0x0, 0);
|
||||
iVar3 = strcmpi(s_volumeNameBuffer, s_R3_DVD_005bdfd8);
|
||||
if ((iVar3 == 0) ||
|
||||
(iVar3 = strcmpi(s_volumeNameBuffer, s_R3_DVD_005be0ec),
|
||||
iVar3 == 0)) {
|
||||
sprintf(g_currentBinkMovie.movieName, s_fmt_c_colon_s,
|
||||
local_8 + 0x41, s_r3_program_files);
|
||||
local_110 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (local_110 != 0);
|
||||
GetWindowsDirectoryA(local_31c, 0x104);
|
||||
iVar3 = -1;
|
||||
pcVar4 = local_31c;
|
||||
do {
|
||||
pcVar5 = pcVar4;
|
||||
if (iVar3 == 0)
|
||||
break;
|
||||
iVar3 = iVar3 + -1;
|
||||
pcVar5 = pcVar4 + 1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar5;
|
||||
} while (cVar1 != '\0');
|
||||
*(undefined4 *)(pcVar5 + -1) = s_UbiSoft_Ubi_ini + Field<0, 4>();
|
||||
*(undefined4 *)(pcVar5 + 3) = s_UbiSoft_Ubi_ini + Field<4, 4>();
|
||||
*(undefined4 *)(pcVar5 + 7) = s_UbiSoft_Ubi_ini + Field<8, 4>();
|
||||
*(undefined4 *)(pcVar5 + 0xb) = s_UbiSoft_Ubi_ini + Field<12, 4>();
|
||||
pcVar5[0xf] = s_UbiSoft_Ubi_ini[0x10];
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Language_005b6840,
|
||||
s_English_005b684c, local_41c, 0xff, local_31c);
|
||||
iVar3 = strcmpi(local_41c, s_French_005b6828);
|
||||
if (iVar3 == 0) {
|
||||
sprintf(local_10c, s_Veuillez_ins_rer_le_DVD_dans_vot_005be500);
|
||||
sprintf(local_214, s_Impossible_de_trouver_le_DVD_____005be238,
|
||||
s_windowTitle);
|
||||
} else {
|
||||
iVar3 = strcmpi(local_41c, s_Spanish_005b67a0);
|
||||
if (iVar3 == 0) {
|
||||
sprintf(local_10c, s_Introduce_el_DVD_de_Rayman_3_en_l_005be4c0);
|
||||
sprintf(local_214, s_DVD_s_no_v_lido_005be1ec, s_windowTitle);
|
||||
} else {
|
||||
iVar3 = strcmpi(local_41c, s_Italian_005b6730);
|
||||
if (iVar3 == 0) {
|
||||
sprintf(local_10c, s_Inserisci_il_DVD_di_Rayman_3_nel_005be484);
|
||||
sprintf(local_214, s_Impossibile_trovare_il_DVD____s_005be198,
|
||||
s_windowTitle);
|
||||
} else {
|
||||
iVar3 = strcmpi(local_41c, s_German_005b66c4);
|
||||
if (iVar3 == 0) {
|
||||
sprintf(local_10c, s_Bitte_legen_Sie_DVD_von_Rayman_3_005be438);
|
||||
sprintf(local_214, s_Die__s_DVDROM_kann_nicht_gelesen_005be130,
|
||||
s_windowTitle);
|
||||
} else {
|
||||
sprintf(local_10c, s_Please_insert_the_DVD_in_the_DVD_005be400);
|
||||
sprintf(local_214, s__s_DVD_missing_005be0f4, s_windowTitle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
iVar3 = r3_wait_for_dvd(local_10c, local_214, 5);
|
||||
if (iVar3 == 2) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
exit(-1);
|
||||
}
|
||||
} while (true);
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
// 004464b0
|
||||
char * r3_getVolumeInformation(void)
|
||||
|
||||
{
|
||||
s_volumeNameBuffer[0] = (char)lpDefault_005cf96c;
|
||||
GetVolumeInformationA
|
||||
(g_driveLetter,s_volumeNameBuffer,0x80,(LPDWORD)0x0,(LPDWORD)0x0,(LPDWORD)0x0,(LPSTR)0x0
|
||||
,0);
|
||||
return s_volumeNameBuffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
extern "C" {
|
||||
undefined r3_module_big_init(void); // 00443f10 // r3_module_big_init
|
||||
undefined r3_module1_init(void); // 0043e630 // r3_module1_init
|
||||
byte Erm_fn_ucInitErrMsg(void); // 0043e1d0 // Erm_fn_ucInitErrMsg
|
||||
undefined Mmg_fn_vFirstInitMmgModule(undefined1 ucMaxNbChannel); // 0043f830 // Mmg_fn_vFirstInitMmgModule
|
||||
|
||||
// 00401000
|
||||
void r3_initAllModules(void)
|
||||
|
||||
{
|
||||
char cVar1;
|
||||
size_t sVar2;
|
||||
size_t sVar3;
|
||||
uint uVar4;
|
||||
char *pcVar5;
|
||||
CHAR exePath [255];
|
||||
char acStack_101 [257];
|
||||
|
||||
if (g_errModDInput == 0xff) {
|
||||
g_errModDInput = Erm_fn_ucInitErrMsg();
|
||||
}
|
||||
if (g_errModMmg == 0xff) {
|
||||
g_errModMmg = Erm_fn_ucInitErrMsg();
|
||||
}
|
||||
/* Init the memory manager */
|
||||
Mmg_fn_vFirstInitMmgModule(10);
|
||||
/* Set to exe path */
|
||||
GetModuleFileNameA((HMODULE)0x0,exePath,0xff);
|
||||
uVar4 = 0xffffffff;
|
||||
pcVar5 = exePath;
|
||||
do {
|
||||
if (uVar4 == 0) break;
|
||||
uVar4 = uVar4 - 1;
|
||||
cVar1 = *pcVar5;
|
||||
pcVar5 = pcVar5 + 1;
|
||||
} while (cVar1 != '\0');
|
||||
sVar2 = ~uVar4;
|
||||
do {
|
||||
sVar3 = sVar2;
|
||||
sVar2 = sVar3 - 1;
|
||||
if ((int)sVar2 < 0) break;
|
||||
} while (exePath[sVar2] != '\\');
|
||||
strncpy(acStack_101 + 1,exePath,sVar2);
|
||||
acStack_101[sVar3] = '\0';
|
||||
SetCurrentDirectoryA(acStack_101 + 1);
|
||||
r3_module1_init();
|
||||
r3_module_big_init();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +1,35 @@
|
|||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <gh_global.h>
|
||||
#include <r3/config/static.hpp>
|
||||
|
||||
extern "C" {
|
||||
int setupWindow(HINSTANCE instance, undefined4 param_2, int windowedParam); // 00402140 // setupWindow
|
||||
undefined FUN_00470db0(void); // 00470db0 // FUN_00470db0
|
||||
undefined r3_checkDisc(void); // 004464f0 // r3_checkDisc
|
||||
undefined FUN_00503710(void); // 00503710 // FUN_00503710
|
||||
undefined r3_initAllModules(void); // 00401000 // r3_initAllModules
|
||||
undefined FUN_00472150(void); // 00472150 // FUN_00472150
|
||||
undefined r3_wait_for_dvd(char * param_1, char * param_2, undefined4 param_3); // 0043e540 // r3_wait_for_dvd
|
||||
undefined FUN_004725a0(void); // 004725a0 // FUN_004725a0
|
||||
int r3_get_gli_width1(void); // 0047baf0 // r3_get_gli_width1
|
||||
undefined gfx_init2(void); // 00470be0 // gfx_init2
|
||||
void g_setInitVar0(void); // 00401310 // g_setInitVar0
|
||||
int r3_get_gli_height1(void); // 0047bb00 // r3_get_gli_height1
|
||||
undefined FUN_004010b0(void); // 004010b0 // FUN_004010b0
|
||||
undefined FUN_00401320(void); // 00401320 // FUN_00401320
|
||||
void r3_noop(void * p_cTxt1, void * p_cTxt2); // 00401100 // r3_noop
|
||||
undefined FUN_005038e0(void); // 005038e0 // FUN_005038e0
|
||||
undefined FUN_004fb300(void); // 004fb300 // FUN_004fb300
|
||||
undefined spawnThread(void); // 004477d0 // spawnThread
|
||||
undefined r3_engineLoop(void); // 00401220 // r3_engineLoop
|
||||
int setupWindow(HINSTANCE instance, undefined4 param_2,
|
||||
int windowedParam); // 00402140 // setupWindow
|
||||
undefined FUN_00470db0(void); // 00470db0 // FUN_00470db0
|
||||
undefined r3_checkDisc(void); // 004464f0 // r3_checkDisc
|
||||
undefined FUN_00503710(void); // 00503710 // FUN_00503710
|
||||
undefined r3_initAllModules(void); // 00401000 // r3_initAllModules
|
||||
undefined FUN_00472150(void); // 00472150 // FUN_00472150
|
||||
undefined r3_wait_for_dvd(char *param_1, char *param_2,
|
||||
undefined4 param_3); // 0043e540 // r3_wait_for_dvd
|
||||
undefined FUN_004725a0(void); // 004725a0 // FUN_004725a0
|
||||
int r3_get_gli_width1(void); // 0047baf0 // r3_get_gli_width1
|
||||
undefined gfx_init2(void); // 00470be0 // gfx_init2
|
||||
void g_setInitVar0(void); // 00401310 // g_setInitVar0
|
||||
int r3_get_gli_height1(void); // 0047bb00 // r3_get_gli_height1
|
||||
undefined FUN_004010b0(void); // 004010b0 // FUN_004010b0
|
||||
undefined FUN_00401320(void); // 00401320 // FUN_00401320
|
||||
void r3_noop(void *p_cTxt1, void *p_cTxt2); // 00401100 // r3_noop
|
||||
undefined FUN_005038e0(void); // 005038e0 // FUN_005038e0
|
||||
undefined FUN_004fb300(void); // 004fb300 // FUN_004fb300
|
||||
undefined spawnThread(void); // 004477d0 // spawnThread
|
||||
undefined r3_engineLoop(void); // 00401220 // r3_engineLoop
|
||||
|
||||
// 00401630
|
||||
int r3_main(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR *cmdline,int showCmd)
|
||||
int r3_main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR *cmdline,
|
||||
int showCmd)
|
||||
|
||||
{
|
||||
undefined4 uVar1;
|
||||
|
@ -55,22 +59,22 @@ int r3_main(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR *cmdline,int showC
|
|||
undefined4 uStack_858;
|
||||
LPSTR lpBuffer;
|
||||
UINT uiParam;
|
||||
BYTE uStack_83c [4];
|
||||
BYTE uStack_83c[4];
|
||||
DWORD pHStack_838;
|
||||
DWORD pvStack_834;
|
||||
char UStack_830 [16];
|
||||
char tStack_820 [260];
|
||||
CHAR aCStack_71c [256];
|
||||
char acStack_61c [16];
|
||||
CHAR pathToUbi_ini [228];
|
||||
char acStack_528 [16];
|
||||
char acStack_518 [244];
|
||||
char acStack_424 [16];
|
||||
CHAR aCStack_414 [244];
|
||||
char acStack_320 [16];
|
||||
char acStack_310 [240];
|
||||
char acStack_220 [256];
|
||||
char acStack_120 [260];
|
||||
char UStack_830[16];
|
||||
char tStack_820[260];
|
||||
CHAR aCStack_71c[256];
|
||||
char acStack_61c[16];
|
||||
CHAR pathToUbi_ini[228];
|
||||
char acStack_528[16];
|
||||
char acStack_518[244];
|
||||
char acStack_424[16];
|
||||
CHAR aCStack_414[244];
|
||||
char acStack_320[16];
|
||||
char acStack_310[240];
|
||||
char acStack_220[256];
|
||||
char acStack_120[260];
|
||||
HINSTANCE instance;
|
||||
uint *puStack_14;
|
||||
undefined4 uStack_10;
|
||||
|
@ -86,14 +90,15 @@ int r3_main(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR *cmdline,int showC
|
|||
#if RE_AUTHENTIC == 0
|
||||
lpBuffer = pathToUbi_ini;
|
||||
uiParam = 0x104;
|
||||
/* Append windows dir / ubi.ini */
|
||||
/* Append windows dir / ubi.ini */
|
||||
uStack_858 = 0x40164d;
|
||||
GetWindowsDirectoryA(lpBuffer,0x104);
|
||||
GetWindowsDirectoryA(lpBuffer, 0x104);
|
||||
iVar13 = -1;
|
||||
pcVar4 = acStack_61c;
|
||||
do {
|
||||
pcVar17 = pcVar4;
|
||||
if (iVar13 == 0) break;
|
||||
if (iVar13 == 0)
|
||||
break;
|
||||
iVar13 = iVar13 + -1;
|
||||
pcVar17 = pcVar4 + 1;
|
||||
cVar1 = *pcVar4;
|
||||
|
@ -112,28 +117,28 @@ int r3_main(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR *cmdline,int showC
|
|||
pcVar4[(int)(tStack_820 + iVar13)] = cVar1;
|
||||
pcVar4 = pcVar4 + 1;
|
||||
} while (cVar1 != '\0');
|
||||
pcVar4 = strrchr(tStack_820,0x5c); // Get the exe path
|
||||
pcVar4 = strrchr(tStack_820, 0x5c); // Get the exe path
|
||||
if (pcVar4 == (char *)0x0) {
|
||||
/* Read from ubi.ini */
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Directory_005b68f8,s_None,tStack_820,0xff,acStack_61c);
|
||||
iVar13 = strcmpi(tStack_820,s_None);
|
||||
}
|
||||
else { // We have the .exe path
|
||||
pcVar4 = strrchr(tStack_820,0x5c);
|
||||
*pcVar4 = '\0'; // Split into the binary path (strip .exe)
|
||||
/* Read from ubi.ini */
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Directory_005b68f8, s_None,
|
||||
tStack_820, 0xff, acStack_61c);
|
||||
iVar13 = strcmpi(tStack_820, s_None);
|
||||
} else { // We have the .exe path
|
||||
pcVar4 = strrchr(tStack_820, 0x5c);
|
||||
*pcVar4 = '\0'; // Split into the binary path (strip .exe)
|
||||
iVar13 = chdir(tStack_820); // Change into the binary path
|
||||
if (iVar13 != -1) goto LAB_00401765;
|
||||
/* Read from ubi.ini */
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Directory_005b68f8,s_None,tStack_820,0xff,acStack_61c);
|
||||
iVar13 = strcmpi(tStack_820,s_None);
|
||||
if (iVar13 != -1)
|
||||
goto LAB_00401765;
|
||||
/* Read from ubi.ini */
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Directory_005b68f8, s_None,
|
||||
tStack_820, 0xff, acStack_61c);
|
||||
iVar13 = strcmpi(tStack_820, s_None);
|
||||
}
|
||||
if (iVar13 != 0) {
|
||||
chdir(tStack_820);
|
||||
}
|
||||
LAB_00401765:
|
||||
/* strcpy */
|
||||
/* strcpy */
|
||||
iVar13 = 0;
|
||||
do {
|
||||
cVar1 = tStack_820[iVar13];
|
||||
|
@ -144,7 +149,8 @@ LAB_00401765:
|
|||
iVar13 = -1;
|
||||
pcVar4 = r3_main_data_005d28b6.gameDataDir;
|
||||
do {
|
||||
if (iVar13 == 0) break;
|
||||
if (iVar13 == 0)
|
||||
break;
|
||||
iVar13 = iVar13 + -1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar4 + 1;
|
||||
|
@ -154,16 +160,19 @@ joined_r0x00401792:
|
|||
uVar14 = 0xffffffff;
|
||||
pcVar4 = r3_main_data_005d28b6.gameDataDir;
|
||||
do {
|
||||
if (uVar14 == 0) break;
|
||||
if (uVar14 == 0)
|
||||
break;
|
||||
uVar14 = uVar14 - 1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar4 + 1;
|
||||
} while (cVar1 != '\0');
|
||||
if (r3_main_data_005d28b6.gameDataDir[~uVar14 - 2] != '\\') goto LAB_004017ce;
|
||||
if (r3_main_data_005d28b6.gameDataDir[~uVar14 - 2] != '\\')
|
||||
goto LAB_004017ce;
|
||||
uVar14 = 0xffffffff;
|
||||
pcVar4 = r3_main_data_005d28b6.gameDataDir;
|
||||
do {
|
||||
if (uVar14 == 0) break;
|
||||
if (uVar14 == 0)
|
||||
break;
|
||||
uVar14 = uVar14 - 1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar4 + 1;
|
||||
|
@ -172,7 +181,8 @@ joined_r0x00401792:
|
|||
iVar13 = -1;
|
||||
pcVar4 = r3_main_data_005d28b6.gameDataDir;
|
||||
do {
|
||||
if (iVar13 == 0) break;
|
||||
if (iVar13 == 0)
|
||||
break;
|
||||
iVar13 = iVar13 + -1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar4 + 1;
|
||||
|
@ -180,12 +190,12 @@ joined_r0x00401792:
|
|||
goto joined_r0x00401792;
|
||||
}
|
||||
LAB_004017ce:
|
||||
pFVar5 = fopen(acStack_61c,fopen_mode_r_text);
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Adapter_005b68e4,(LPCSTR)&lpDefault_005cf96c,acStack_310,0xff,
|
||||
acStack_61c);
|
||||
pFVar5 = fopen(acStack_61c, fopen_mode_r_text);
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Adapter_005b68e4,
|
||||
(LPCSTR)&lpDefault_005cf96c, acStack_310, 0xff,
|
||||
acStack_61c);
|
||||
if ((pFVar5 == (FILE *)0x0) || (acStack_310[0] == '\0')) {
|
||||
/* Concat game data dir with r3 setup exe */
|
||||
/* Concat game data dir with r3 setup exe */
|
||||
iVar13 = 0;
|
||||
do {
|
||||
cVar1 = r3_main_data_005d28b6.gameDataDir[iVar13];
|
||||
|
@ -196,26 +206,30 @@ LAB_004017ce:
|
|||
pcVar4 = acStack_518;
|
||||
do {
|
||||
pcVar17 = pcVar4;
|
||||
if (iVar13 == 0) break;
|
||||
if (iVar13 == 0)
|
||||
break;
|
||||
iVar13 = iVar13 + -1;
|
||||
pcVar17 = pcVar4 + 1;
|
||||
cVar1 = *pcVar4;
|
||||
pcVar4 = pcVar17;
|
||||
} while (cVar1 != '\0');
|
||||
*(undefined4 *)(pcVar17 + -1) = s__R3_Setup_DX8_exe_005b68d0 + Field<0, 4>();
|
||||
*(undefined4 *)(pcVar17 + -1) =
|
||||
s__R3_Setup_DX8_exe_005b68d0 + Field<0, 4>();
|
||||
*(undefined4 *)(pcVar17 + 3) = s__R3_Setup_DX8_exe_005b68d0 + Field<4, 4>();
|
||||
*(undefined4 *)(pcVar17 + 7) = s__R3_Setup_DX8_exe_005b68d0 + Field<8, 4>();
|
||||
*(undefined4 *)(pcVar17 + 0xb) = s__R3_Setup_DX8_exe_005b68d0 + Field<12, 4>();
|
||||
*(undefined2 *)(pcVar17 + 0xf) = s__R3_Setup_DX8_exe_005b68d0 + Field<16, 2>();
|
||||
pFVar5 = fopen(acStack_518,fopen_mode_r_binary);
|
||||
*(undefined4 *)(pcVar17 + 0xb) =
|
||||
s__R3_Setup_DX8_exe_005b68d0 + Field<12, 4>();
|
||||
*(undefined2 *)(pcVar17 + 0xf) =
|
||||
s__R3_Setup_DX8_exe_005b68d0 + Field<16, 2>();
|
||||
pFVar5 = fopen(acStack_518, fopen_mode_r_binary);
|
||||
if (pFVar5 == (FILE *)0x0) {
|
||||
MessageBoxA((HWND)0x0,s_Unable_to_find_R3_Setup_DX8_exe__005b6880,s_Rayman_3_Error_005b68bc,
|
||||
0x10);
|
||||
MessageBoxA((HWND)0x0, s_Unable_to_find_R3_Setup_DX8_exe__005b6880,
|
||||
s_Rayman_3_Error_005b68bc, 0x10);
|
||||
return -1;
|
||||
}
|
||||
fclose(pFVar5);
|
||||
spawnl(0,acStack_518,acStack_518,0);
|
||||
pFVar5 = fopen(acStack_61c,fopen_mode_r_text);
|
||||
spawnl(0, acStack_518, acStack_518, 0);
|
||||
pFVar5 = fopen(acStack_61c, fopen_mode_r_text);
|
||||
if (pFVar5 == (FILE *)0x0) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -224,32 +238,32 @@ LAB_004017ce:
|
|||
/* Open reg key
|
||||
HKEY_LOCAL_MACHINE\\SOFTWARE\\UBI SOFT\\RAYMAN 3 */
|
||||
HKEY key;
|
||||
LVar6 = RegOpenKeyExA(HKEY_LOCAL_MACHINE,s_SOFTWARE_UBI_SOFT_RAYMAN_3_005b6864,0,0x20019,
|
||||
&key);
|
||||
LVar6 =
|
||||
RegOpenKeyExA(HKEY_LOCAL_MACHINE, s_SOFTWARE_UBI_SOFT_RAYMAN_3_005b6864,
|
||||
0, 0x20019, &key);
|
||||
if (LVar6 == 0) {
|
||||
LVar6 = RegQueryValueExA(key,s_CompleteInstall_005b6854,(LPDWORD)0x0,&pvStack_834,
|
||||
uStack_83c,&pHStack_838);
|
||||
LVar6 = RegQueryValueExA(key, s_CompleteInstall_005b6854, (LPDWORD)0x0,
|
||||
&pvStack_834, uStack_83c, &pHStack_838);
|
||||
DAT_007d9cc4 = (uint)(LVar6 == 0);
|
||||
if (key != (HKEY)0x0) {
|
||||
RegCloseKey(key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
DAT_007d9cc4 = 0;
|
||||
}
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Language_005b6840,s_English_005b684c,aCStack_71c,0xff,acStack_61c)
|
||||
;
|
||||
sprintf(g_mutexName_Rayman3,s_percents,lpAppName_005b68f0);
|
||||
sprintf(g_windowTitle,s_percents,s_windowTitle);
|
||||
/* Setup localized quiting/restoring strings */
|
||||
iVar13 = strcmpi(aCStack_71c,s_French_005b6828);
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Language_005b6840,
|
||||
s_English_005b684c, aCStack_71c, 0xff, acStack_61c);
|
||||
sprintf(g_mutexName_Rayman3, s_percents, lpAppName_005b68f0);
|
||||
sprintf(g_windowTitle, s_percents, s_windowTitle);
|
||||
/* Setup localized quiting/restoring strings */
|
||||
iVar13 = strcmpi(aCStack_71c, s_French_005b6828);
|
||||
if (iVar13 == 0) {
|
||||
sprintf(g_windowTitleRestoring,s_Restauration_fmt,s_windowTitle);
|
||||
sprintf(g_windowTitleRestoring, s_Restauration_fmt, s_windowTitle);
|
||||
chars = s_QUITTER + Field<4, 4>();
|
||||
pcVar4 = s_ou_appuyez_sur_Echap_pour_quitte_005b67d0;
|
||||
pcVar17 = s_quitting1;
|
||||
for (iVar13 = 0xb; uVar22 = s_QUITTER + Field<4, 4>(), iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
for (iVar13 = 0xb; uVar22 = s_QUITTER + Field<4, 4>(), iVar13 != 0;
|
||||
iVar13 = iVar13 + -1) {
|
||||
*(undefined4 *)pcVar17 = *(undefined4 *)pcVar4;
|
||||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
|
@ -258,17 +272,17 @@ LAB_004017ce:
|
|||
s_wndStrQuiting[1] = s_QUITTER[1];
|
||||
s_wndStrQuiting[2] = s_QUITTER[2];
|
||||
s_wndStrQuiting[3] = s_QUITTER[3];
|
||||
/* Wrong decompilation? */
|
||||
/* Wrong decompilation? */
|
||||
s_QUITTER[4] = (char)chars;
|
||||
s_QUITTER[5] = SUB41(chars,1);
|
||||
s_QUITTER[6] = SUB41(chars,2);
|
||||
s_QUITTER[7] = SUB41(chars,3);
|
||||
s_QUITTER[5] = SUB41(chars, 1);
|
||||
s_QUITTER[6] = SUB41(chars, 2);
|
||||
s_QUITTER[7] = SUB41(chars, 3);
|
||||
s_wndStrQuiting[4] = s_QUITTER[4];
|
||||
s_wndStrQuiting[5] = s_QUITTER[5];
|
||||
s_wndStrQuiting[6] = s_QUITTER[6];
|
||||
s_wndStrQuiting[7] = s_QUITTER[7];
|
||||
s_QUITTER + Field<4, 4>() = uVar22;
|
||||
sprintf(g_windowTitle1,s__s___Pause_005b67c4,s_windowTitle);
|
||||
sprintf(g_windowTitle1, s__s___Pause_005b67c4, s_windowTitle);
|
||||
pcVar4 = s_Restauration;
|
||||
pcVar17 = s_wndStrRestoring;
|
||||
for (iVar13 = 7; iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
|
@ -276,15 +290,16 @@ LAB_004017ce:
|
|||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
iVar13 = strcmpi(aCStack_71c,s_Spanish_005b67a0);
|
||||
} else {
|
||||
iVar13 = strcmpi(aCStack_71c, s_Spanish_005b67a0);
|
||||
if (iVar13 == 0) {
|
||||
sprintf(g_windowTitleRestoring,s__s___Restablecer_datos____005b6784,s_windowTitle);
|
||||
sprintf(g_windowTitleRestoring, s__s___Restablecer_datos____005b6784,
|
||||
s_windowTitle);
|
||||
uVar2 = s_SALIR_005b675c + Field<4, 2>();
|
||||
pcVar4 = s_Pulsa_ESC_para_salir_Rayman_3__005b6764;
|
||||
pcVar17 = s_quitting1;
|
||||
for (iVar13 = 7; chars = s_SALIR_005b675c + Field<0, 4>(), iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
for (iVar13 = 7; chars = s_SALIR_005b675c + Field<0, 4>(), iVar13 != 0;
|
||||
iVar13 = iVar13 + -1) {
|
||||
*(undefined4 *)pcVar17 = *(undefined4 *)pcVar4;
|
||||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
|
@ -294,20 +309,20 @@ LAB_004017ce:
|
|||
uVar3 = s_SALIR_005b675c + Field<4, 2>();
|
||||
uVar22 = s_SALIR_005b675c + Field<0, 4>();
|
||||
s_SALIR_005b675c[0] = (char)chars;
|
||||
s_SALIR_005b675c[1] = SUB41(chars,1);
|
||||
s_SALIR_005b675c[2] = SUB41(chars,2);
|
||||
s_SALIR_005b675c[3] = SUB41(chars,3);
|
||||
s_SALIR_005b675c[1] = SUB41(chars, 1);
|
||||
s_SALIR_005b675c[2] = SUB41(chars, 2);
|
||||
s_SALIR_005b675c[3] = SUB41(chars, 3);
|
||||
s_wndStrQuiting[0] = s_SALIR_005b675c[0];
|
||||
s_wndStrQuiting[1] = s_SALIR_005b675c[1];
|
||||
s_wndStrQuiting[2] = s_SALIR_005b675c[2];
|
||||
s_wndStrQuiting[3] = s_SALIR_005b675c[3];
|
||||
s_SALIR_005b675c[4] = (char)uVar2;
|
||||
s_SALIR_005b675c[5] = SUB21(uVar2,1);
|
||||
s_SALIR_005b675c[5] = SUB21(uVar2, 1);
|
||||
s_wndStrQuiting[4] = s_SALIR_005b675c[4];
|
||||
s_wndStrQuiting[5] = s_SALIR_005b675c[5];
|
||||
s_SALIR_005b675c + Field<0, 4>() = uVar22;
|
||||
s_SALIR_005b675c + Field<4, 2>() = uVar3;
|
||||
sprintf(g_windowTitle1,s__s___Rotura_005b6750,s_windowTitle);
|
||||
sprintf(g_windowTitle1, s__s___Rotura_005b6750, s_windowTitle);
|
||||
pcVar4 = s_Restablecer_datos____005b6738;
|
||||
pcVar17 = s_wndStrRestoring;
|
||||
for (iVar13 = 5; iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
|
@ -316,15 +331,16 @@ LAB_004017ce:
|
|||
pcVar17 = pcVar17 + 4;
|
||||
}
|
||||
*pcVar17 = *pcVar4;
|
||||
}
|
||||
else {
|
||||
iVar13 = strcmpi(aCStack_71c,s_Italian_005b6730);
|
||||
} else {
|
||||
iVar13 = strcmpi(aCStack_71c, s_Italian_005b6730);
|
||||
if (iVar13 == 0) {
|
||||
sprintf(g_windowTitleRestoring,s__s___Ripristino_dati____005b6718,s_windowTitle);
|
||||
sprintf(g_windowTitleRestoring, s__s___Ripristino_dati____005b6718,
|
||||
s_windowTitle);
|
||||
uVar2 = s_USCIRE_005b66ec + Field<4, 2>();
|
||||
pcVar4 = s_Premi_ESC_per_uscire_da_Rayman_3_005b66f4;
|
||||
pcVar17 = s_quitting1;
|
||||
for (iVar13 = 8; cVar1 = s_USCIRE_005b66ec[6], iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
for (iVar13 = 8; cVar1 = s_USCIRE_005b66ec[6], iVar13 != 0;
|
||||
iVar13 = iVar13 + -1) {
|
||||
*(undefined4 *)pcVar17 = *(undefined4 *)pcVar4;
|
||||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
|
@ -337,11 +353,11 @@ LAB_004017ce:
|
|||
uVar3 = s_USCIRE_005b66ec + Field<4, 2>();
|
||||
s_wndStrQuiting[6] = cVar1;
|
||||
s_USCIRE_005b66ec[4] = (char)uVar2;
|
||||
s_USCIRE_005b66ec[5] = SUB21(uVar2,1);
|
||||
s_USCIRE_005b66ec[5] = SUB21(uVar2, 1);
|
||||
s_wndStrQuiting[4] = s_USCIRE_005b66ec[4];
|
||||
s_wndStrQuiting[5] = s_USCIRE_005b66ec[5];
|
||||
s_USCIRE_005b66ec + Field<4, 2>() = uVar3;
|
||||
sprintf(g_windowTitle1,s__s___Pausa_005b66e0,s_windowTitle);
|
||||
sprintf(g_windowTitle1, s__s___Pausa_005b66e0, s_windowTitle);
|
||||
s_wndStrRestoring[0] = s_Ripristino_dati____005b66cc[0];
|
||||
s_wndStrRestoring[1] = s_Ripristino_dati____005b66cc[1];
|
||||
s_wndStrRestoring[2] = s_Ripristino_dati____005b66cc[2];
|
||||
|
@ -354,19 +370,22 @@ LAB_004017ce:
|
|||
s_wndStrRestoring[9] = s_Ripristino_dati____005b66cc[9];
|
||||
s_wndStrRestoring[10] = s_Ripristino_dati____005b66cc[10];
|
||||
s_wndStrRestoring[0xb] = s_Ripristino_dati____005b66cc[0xb];
|
||||
s_wndStrRestoring + Field<12, 4>() = s_Ripristino_dati____005b66cc + Field<12, 4>();
|
||||
s_wndStrRestoring + Field<16, 2>() = s_Ripristino_dati____005b66cc + Field<16, 2>();
|
||||
s_wndStrRestoring + Field<12, 4>() =
|
||||
s_Ripristino_dati____005b66cc + Field<12, 4>();
|
||||
s_wndStrRestoring + Field<16, 2>() =
|
||||
s_Ripristino_dati____005b66cc + Field<16, 2>();
|
||||
s_wndStrRestoring[0x12] = s_Ripristino_dati____005b66cc[0x12];
|
||||
}
|
||||
else {
|
||||
iVar13 = strcmpi(aCStack_71c,s_German_005b66c4);
|
||||
} else {
|
||||
iVar13 = strcmpi(aCStack_71c, s_German_005b66c4);
|
||||
if (iVar13 == 0) {
|
||||
sprintf(g_windowTitleRestoring,s__s___Daten_Reparatur____005b66ac,s_windowTitle);
|
||||
sprintf(g_windowTitleRestoring, s__s___Daten_Reparatur____005b66ac,
|
||||
s_windowTitle);
|
||||
chars = s_BEENDIGEN_005b6678 + Field<0, 4>();
|
||||
pcVar4 = &CHAR_E_005b6684;
|
||||
pcVar17 = s_quitting1;
|
||||
for (iVar13 = 9; uVar2 = s_BEENDIGEN_005b6678 + Field<8, 2>(), uVar22 = s_BEENDIGEN_005b6678 + Field<4, 4>(),
|
||||
iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
for (iVar13 = 9; uVar2 = s_BEENDIGEN_005b6678 + Field<8, 2>(),
|
||||
uVar22 = s_BEENDIGEN_005b6678 + Field<4, 4>(), iVar13 != 0;
|
||||
iVar13 = iVar13 + -1) {
|
||||
*(undefined4 *)pcVar17 = *(undefined4 *)pcVar4;
|
||||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
|
@ -374,9 +393,9 @@ LAB_004017ce:
|
|||
*(undefined2 *)pcVar17 = *(undefined2 *)pcVar4;
|
||||
uVar1 = s_BEENDIGEN_005b6678 + Field<0, 4>();
|
||||
s_BEENDIGEN_005b6678[0] = (char)chars;
|
||||
s_BEENDIGEN_005b6678[1] = SUB41(chars,1);
|
||||
s_BEENDIGEN_005b6678[2] = SUB41(chars,2);
|
||||
s_BEENDIGEN_005b6678[3] = SUB41(chars,3);
|
||||
s_BEENDIGEN_005b6678[1] = SUB41(chars, 1);
|
||||
s_BEENDIGEN_005b6678[2] = SUB41(chars, 2);
|
||||
s_BEENDIGEN_005b6678[3] = SUB41(chars, 3);
|
||||
s_wndStrQuiting[0] = s_BEENDIGEN_005b6678[0];
|
||||
s_wndStrQuiting[1] = s_BEENDIGEN_005b6678[1];
|
||||
s_wndStrQuiting[2] = s_BEENDIGEN_005b6678[2];
|
||||
|
@ -386,20 +405,20 @@ LAB_004017ce:
|
|||
uVar3 = s_BEENDIGEN_005b6678 + Field<8, 2>();
|
||||
chars = s_BEENDIGEN_005b6678 + Field<4, 4>();
|
||||
s_BEENDIGEN_005b6678[4] = (char)uVar22;
|
||||
s_BEENDIGEN_005b6678[5] = SUB41(uVar22,1);
|
||||
s_BEENDIGEN_005b6678[6] = SUB41(uVar22,2);
|
||||
s_BEENDIGEN_005b6678[7] = SUB41(uVar22,3);
|
||||
s_BEENDIGEN_005b6678[5] = SUB41(uVar22, 1);
|
||||
s_BEENDIGEN_005b6678[6] = SUB41(uVar22, 2);
|
||||
s_BEENDIGEN_005b6678[7] = SUB41(uVar22, 3);
|
||||
s_wndStrQuiting[4] = s_BEENDIGEN_005b6678[4];
|
||||
s_wndStrQuiting[5] = s_BEENDIGEN_005b6678[5];
|
||||
s_wndStrQuiting[6] = s_BEENDIGEN_005b6678[6];
|
||||
s_wndStrQuiting[7] = s_BEENDIGEN_005b6678[7];
|
||||
s_BEENDIGEN_005b6678[8] = (char)uVar2;
|
||||
s_BEENDIGEN_005b6678[9] = SUB21(uVar2,1);
|
||||
s_BEENDIGEN_005b6678[9] = SUB21(uVar2, 1);
|
||||
s_wndStrQuiting[8] = s_BEENDIGEN_005b6678[8];
|
||||
s_wndStrQuiting[9] = s_BEENDIGEN_005b6678[9];
|
||||
s_BEENDIGEN_005b6678 + Field<4, 4>() = chars;
|
||||
s_BEENDIGEN_005b6678 + Field<8, 2>() = uVar3;
|
||||
sprintf(g_windowTitle1,s__s___Pause_005b67c4,s_windowTitle);
|
||||
sprintf(g_windowTitle1, s__s___Pause_005b67c4, s_windowTitle);
|
||||
s_wndStrRestoring[0] = s_Daten_Reparatur____005b6664[0];
|
||||
s_wndStrRestoring[1] = s_Daten_Reparatur____005b6664[1];
|
||||
s_wndStrRestoring[2] = s_Daten_Reparatur____005b6664[2];
|
||||
|
@ -419,13 +438,14 @@ LAB_004017ce:
|
|||
s_wndStrRestoring[0x10] = s_Daten_Reparatur____005b6664[0x10];
|
||||
s_wndStrRestoring[0x11] = s_Daten_Reparatur____005b6664[0x11];
|
||||
s_wndStrRestoring[0x12] = s_Daten_Reparatur____005b6664[0x12];
|
||||
}
|
||||
else {
|
||||
sprintf(g_windowTitleRestoring,s__s___Restoring_data____005b664c,s_windowTitle);
|
||||
} else {
|
||||
sprintf(g_windowTitleRestoring, s__s___Restoring_data____005b664c,
|
||||
s_windowTitle);
|
||||
chars = s_QUIT + Field<0, 4>();
|
||||
pcVar4 = s_or_press_ESC_to_quit_Rayman_3__005b662c;
|
||||
pcVar17 = s_quitting1;
|
||||
for (iVar13 = 7; cVar1 = s_QUIT[4], iVar13 != 0; iVar13 = iVar13 + -1) {
|
||||
for (iVar13 = 7; cVar1 = s_QUIT[4], iVar13 != 0;
|
||||
iVar13 = iVar13 + -1) {
|
||||
*(undefined4 *)pcVar17 = *(undefined4 *)pcVar4;
|
||||
pcVar4 = pcVar4 + 4;
|
||||
pcVar17 = pcVar17 + 4;
|
||||
|
@ -434,16 +454,16 @@ LAB_004017ce:
|
|||
pcVar17[2] = pcVar4[2];
|
||||
uVar22 = s_QUIT + Field<0, 4>();
|
||||
s_QUIT[0] = (char)chars;
|
||||
s_QUIT[1] = SUB41(chars,1);
|
||||
s_QUIT[2] = SUB41(chars,2);
|
||||
s_QUIT[3] = SUB41(chars,3);
|
||||
s_QUIT[1] = SUB41(chars, 1);
|
||||
s_QUIT[2] = SUB41(chars, 2);
|
||||
s_QUIT[3] = SUB41(chars, 3);
|
||||
s_wndStrQuiting[0] = s_QUIT[0];
|
||||
s_wndStrQuiting[1] = s_QUIT[1];
|
||||
s_wndStrQuiting[2] = s_QUIT[2];
|
||||
s_wndStrQuiting[3] = s_QUIT[3];
|
||||
s_wndStrQuiting[4] = cVar1;
|
||||
s_QUIT + Field<0, 4>() = uVar22;
|
||||
sprintf(g_windowTitle1,s__s___Pause_005b67c4,s_windowTitle);
|
||||
sprintf(g_windowTitle1, s__s___Pause_005b67c4, s_windowTitle);
|
||||
s_wndStrRestoring[0] = s_Restoring_data_____005b6610[0];
|
||||
s_wndStrRestoring[1] = s_Restoring_data_____005b6610[1];
|
||||
s_wndStrRestoring[2] = s_Restoring_data_____005b6610[2];
|
||||
|
@ -456,70 +476,83 @@ LAB_004017ce:
|
|||
s_wndStrRestoring[9] = s_Restoring_data_____005b6610[9];
|
||||
s_wndStrRestoring[10] = s_Restoring_data_____005b6610[10];
|
||||
s_wndStrRestoring[0xb] = s_Restoring_data_____005b6610[0xb];
|
||||
s_wndStrRestoring + Field<12, 4>() = s_Restoring_data_____005b6610 + Field<12, 4>();
|
||||
s_wndStrRestoring + Field<16, 2>() = s_Restoring_data_____005b6610 + Field<16, 2>();
|
||||
s_wndStrRestoring + Field<12, 4>() =
|
||||
s_Restoring_data_____005b6610 + Field<12, 4>();
|
||||
s_wndStrRestoring + Field<16, 2>() =
|
||||
s_Restoring_data_____005b6610 + Field<16, 2>();
|
||||
s_wndStrRestoring[0x12] = s_Restoring_data_____005b6610[0x12];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
auto &config = getDefaultConfig();
|
||||
strcpy(g_windowTitle, "Reman3");
|
||||
strcpy(g_windowTitle1, "Reman3 - Paused");
|
||||
strcpy(g_windowTitleRestoring, "Restoring data");
|
||||
|
||||
|
||||
strcpy(r3_main_data_005d28b6.gameDataDir, config.gameRootDir.c_str());
|
||||
strlwr(r3_main_data_005d28b6.gameDataDir);
|
||||
strcpy(g_mutexName_Rayman3, "Rayman3");
|
||||
#endif
|
||||
/* Create draw semaphore
|
||||
Initial count = 1
|
||||
Maximum count = 1 */
|
||||
g_drawSemaphore = CreateSemaphoreA((LPSECURITY_ATTRIBUTES)0x0,1,1,s_DRAWSEM_005b6608);
|
||||
if (iStack_8 != 0) {
|
||||
|
||||
/* Create draw semaphore
|
||||
Initial count = 1
|
||||
Maximum count = 1 */
|
||||
g_drawSemaphore =
|
||||
CreateSemaphoreA((LPSECURITY_ATTRIBUTES)0x0, 1, 1, s_DRAWSEM_005b6608);
|
||||
|
||||
// FIXME: Not sure where this is set
|
||||
/*if (iStack_8 != 0) {
|
||||
return -1;
|
||||
}
|
||||
/* Load DirectPlay probably unused */
|
||||
}*/
|
||||
|
||||
#if RE_AUTHENTIC == 0
|
||||
/* Load DirectPlay probably unused */
|
||||
hLibModule = LoadLibraryA(s_dpnhpast_dll_005b65f8);
|
||||
if (hLibModule == (HMODULE)0x0) {
|
||||
iVar13 = strcmpi(aCStack_71c,s_French_005b6828);
|
||||
iVar13 = strcmpi(aCStack_71c, s_French_005b6828);
|
||||
if (iVar13 == 0) {
|
||||
MessageBoxA((HWND)0x0,lpText_005b6598,s_Erreur_Rayman_3_005b65e4,0x10);
|
||||
MessageBoxA((HWND)0x0, lpText_005b6598, s_Erreur_Rayman_3_005b65e4, 0x10);
|
||||
return -1;
|
||||
}
|
||||
iVar13 = strcmpi(aCStack_71c,s_Spanish_005b67a0);
|
||||
iVar13 = strcmpi(aCStack_71c, s_Spanish_005b67a0);
|
||||
if (iVar13 == 0) {
|
||||
MessageBoxA((HWND)0x0,lpText_005b6540,s_Rayman_3_005b6588,0x10);
|
||||
MessageBoxA((HWND)0x0, lpText_005b6540, s_Rayman_3_005b6588, 0x10);
|
||||
return -1;
|
||||
}
|
||||
iVar13 = strcmpi(aCStack_71c,s_Italian_005b6730);
|
||||
iVar13 = strcmpi(aCStack_71c, s_Italian_005b6730);
|
||||
if (iVar13 == 0) {
|
||||
MessageBoxA((HWND)0x0,lpText_005b64f0,s_Rayman_3_005b6588,0x10);
|
||||
MessageBoxA((HWND)0x0, lpText_005b64f0, s_Rayman_3_005b6588, 0x10);
|
||||
return -1;
|
||||
}
|
||||
iVar13 = strcmpi(aCStack_71c,s_German_005b66c4);
|
||||
iVar13 = strcmpi(aCStack_71c, s_German_005b66c4);
|
||||
if (iVar13 != 0) {
|
||||
MessageBoxA((HWND)0x0,s_Check_your_version_of_DirectX__V_005b6430,s_Rayman_3_Error_005b68bc,
|
||||
0x10);
|
||||
MessageBoxA((HWND)0x0, s_Check_your_version_of_DirectX__V_005b6430,
|
||||
s_Rayman_3_Error_005b68bc, 0x10);
|
||||
return -1;
|
||||
}
|
||||
MessageBoxA((HWND)0x0,lpText_005b6478,s_Rayman_3_005b6588,0x10);
|
||||
MessageBoxA((HWND)0x0, lpText_005b6478, s_Rayman_3_005b6588, 0x10);
|
||||
return -1;
|
||||
}
|
||||
FreeLibrary(hLibModule);
|
||||
#endif
|
||||
p_cTxt1 = (void *)0x401e2a;
|
||||
CreateMutexA((LPSECURITY_ATTRIBUTES)0x0,1,g_mutexName_Rayman3);
|
||||
CreateMutexA((LPSECURITY_ATTRIBUTES)0x0, 1, g_mutexName_Rayman3);
|
||||
DVar7 = GetLastError();
|
||||
if (DVar7 == 0xb7) {
|
||||
/* Mutex already exists */
|
||||
/* Mutex already exists */
|
||||
return -1;
|
||||
}
|
||||
p_cTxt2 = (void *)0x401e5a;
|
||||
GetWindowsDirectoryA(aCStack_414,0x104);
|
||||
GetWindowsDirectoryA(aCStack_414, 0x104);
|
||||
iVar13 = -1;
|
||||
/* Append ubi.ini */
|
||||
#if RE_AUTHENTIC == 0
|
||||
/* Append ubi.ini */
|
||||
pcVar4 = acStack_424;
|
||||
do {
|
||||
pcVar17 = pcVar4;
|
||||
if (iVar13 == 0) break;
|
||||
if (iVar13 == 0)
|
||||
break;
|
||||
iVar13 = iVar13 + -1;
|
||||
pcVar17 = pcVar4 + 1;
|
||||
cVar1 = *pcVar4;
|
||||
|
@ -530,21 +563,26 @@ LAB_004017ce:
|
|||
*(undefined4 *)(pcVar17 + 7) = s_UbiSoft_Ubi_ini + Field<8, 4>();
|
||||
*(undefined4 *)(pcVar17 + 0xb) = s_UbiSoft_Ubi_ini + Field<12, 4>();
|
||||
pcVar17[0xf] = s_UbiSoft_Ubi_ini[0x10];
|
||||
/* Read graphics settings */
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Adapter_005b68e4,(LPCSTR)&lpDefault_005cf96c,acStack_320,0xff,
|
||||
acStack_424);
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Identifier_005b6420,(LPCSTR)&lpDefault_005cf96c,acStack_120,0xff,
|
||||
acStack_424);
|
||||
GetPrivateProfileStringA
|
||||
(lpAppName_005b68f0,s_Gli_Mode_005b6414,(LPCSTR)&lpDefault_005cf96c,acStack_220,0xff,
|
||||
acStack_424);
|
||||
/* If they're all set */
|
||||
if (((acStack_320[0] != '\0') && (acStack_120[0] != '\0')) && (acStack_220[0] != '\0')) {
|
||||
/* For GLIMode
|
||||
1 = maximize
|
||||
0 = windowed */
|
||||
#else
|
||||
strcpy(acStack_424, config.gameRootDir.c_str());
|
||||
strcat(acStack_424, "/ubi.ini");
|
||||
#endif
|
||||
/* Read graphics settings */
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Adapter_005b68e4,
|
||||
(LPCSTR)&lpDefault_005cf96c, acStack_320, 0xff,
|
||||
acStack_424);
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Identifier_005b6420,
|
||||
(LPCSTR)&lpDefault_005cf96c, acStack_120, 0xff,
|
||||
acStack_424);
|
||||
GetPrivateProfileStringA(lpAppName_005b68f0, s_Gli_Mode_005b6414,
|
||||
(LPCSTR)&lpDefault_005cf96c, acStack_220, 0xff,
|
||||
acStack_424);
|
||||
/* If they're all set */
|
||||
if (((acStack_320[0] != '\0') && (acStack_120[0] != '\0')) &&
|
||||
(acStack_220[0] != '\0')) {
|
||||
/* For GLIMode
|
||||
1 = maximize
|
||||
0 = windowed */
|
||||
g_runMaximized = (int)(acStack_220[0] != '0');
|
||||
r3_checkDisc();
|
||||
dwOptions = 0;
|
||||
|
@ -555,9 +593,9 @@ LAB_004017ce:
|
|||
hTargetProcessHandle = GetCurrentProcess();
|
||||
hSourceHandle = GetCurrentThread();
|
||||
hSourceProcessHandle = GetCurrentProcess();
|
||||
DuplicateHandle(hSourceProcessHandle,hSourceHandle,hTargetProcessHandle,&duplicatedHandle,DVar7,
|
||||
BVar18,dwOptions);
|
||||
/* Copy cmdline */
|
||||
DuplicateHandle(hSourceProcessHandle, hSourceHandle, hTargetProcessHandle,
|
||||
&duplicatedHandle, DVar7, BVar18, dwOptions);
|
||||
/* Copy cmdline */
|
||||
ppCVar8 = puStack_14;
|
||||
g_mainThreadHandle = duplicatedHandle;
|
||||
// do {
|
||||
|
@ -567,23 +605,23 @@ LAB_004017ce:
|
|||
// } while ((char)uVar14 != '\0');
|
||||
LPSTR cmdline = GetCommandLineA();
|
||||
strncpy(g_appCmdLine, cmdline, std::size(g_appCmdLine));
|
||||
/* SEM_FAILCRITICALERRORS */
|
||||
/* SEM_FAILCRITICALERRORS */
|
||||
SetErrorMode(1);
|
||||
pcVar4 = strstr(cmdline, s_dashCC);
|
||||
if (pcVar4 == (char *)0x0) {
|
||||
r3_initAllModules();
|
||||
iVar13 = setupWindow(instance,uStack_10,g_runMaximized);
|
||||
iVar13 = setupWindow(instance, uStack_10, g_runMaximized);
|
||||
if (iVar13 == 0) {
|
||||
return -1;
|
||||
}
|
||||
g_setInitVar0();
|
||||
FUN_00401320();
|
||||
spawnThread();
|
||||
r3_noop(p_cTxt1,p_cTxt2);
|
||||
r3_noop(p_cTxt1, p_cTxt2);
|
||||
gfx_init2();
|
||||
RECT rect;
|
||||
hWnd = GetDesktopWindow();
|
||||
GetWindowRect(hWnd,&rect);
|
||||
GetWindowRect(hWnd, &rect);
|
||||
BVar18 = 1;
|
||||
iVar13 = r3_get_gli_height1();
|
||||
iVar13 = iVar13 + 0x20;
|
||||
|
@ -592,17 +630,18 @@ LAB_004017ce:
|
|||
iVar11 = r3_get_gli_height1();
|
||||
iVar11 = (int)(rect.top - iVar11) / 2;
|
||||
iVar12 = r3_get_gli_width1();
|
||||
MoveWindow(g_gameHWND,(int)(rect.right - iVar12) / 2,iVar11,iVar10,iVar13,BVar18);
|
||||
MoveWindow(g_gameHWND, (int)(rect.right - iVar12) / 2, iVar11, iVar10,
|
||||
iVar13, BVar18);
|
||||
FUN_004010b0();
|
||||
DWORD screensaveActive;
|
||||
SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE,0,&screensaveActive,0);
|
||||
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE,0,(PVOID)0x0,0);
|
||||
SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &screensaveActive, 0);
|
||||
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, 0, (PVOID)0x0, 0);
|
||||
ShowCursor(0);
|
||||
uStack_85c = 0;
|
||||
SystemParametersInfoA(0x61,1,&uStack_85c,0);
|
||||
SystemParametersInfoA(0x61, 1, &uStack_85c, 0);
|
||||
g_engineRunning = 1;
|
||||
r3_engineLoop();
|
||||
/* cleanup starts here */
|
||||
/* cleanup starts here */
|
||||
FUN_004725a0();
|
||||
FUN_005038e0();
|
||||
FUN_00503710();
|
||||
|
@ -610,19 +649,17 @@ LAB_004017ce:
|
|||
FUN_00472150();
|
||||
FUN_00470db0();
|
||||
uStack_85c = 0;
|
||||
SystemParametersInfoA(0x61,0,&uStack_85c,0);
|
||||
SystemParametersInfoA(0x61, 0, &uStack_85c, 0);
|
||||
ShowCursor(1);
|
||||
SystemParametersInfoA(0x11,uiParam,(PVOID)0x0,0);
|
||||
SystemParametersInfoA(0x11, uiParam, (PVOID)0x0, 0);
|
||||
CloseHandle(lpBuffer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
sprintf(UStack_830,s_Please_run_the__s_setup__005b63f4,s_windowTitle);
|
||||
sprintf(acStack_528,s__s_not_initialized__005b63e0,s_windowTitle);
|
||||
r3_wait_for_dvd(UStack_830,acStack_528,0);
|
||||
/* WARNING: Subroutine does not return */
|
||||
sprintf(UStack_830, s_Please_run_the__s_setup__005b63f4, s_windowTitle);
|
||||
sprintf(acStack_528, s__s_not_initialized__005b63e0, s_windowTitle);
|
||||
r3_wait_for_dvd(UStack_830, acStack_528, 0);
|
||||
/* WARNING: Subroutine does not return */
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
extern "C" {
|
||||
undefined FUN_0043e4f0(void); // 0043e4f0 // FUN_0043e4f0
|
||||
void IPT_fn_vReadInput(void); // 00505fe0 // IPT_fn_vReadInput
|
||||
undefined r3_gfxFrameUNK(void); // 0046fed0 // r3_gfxFrame?
|
||||
undefined FUN_00441d70(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined4 param_5); // 00441d70 // FUN_00441d70
|
||||
undefined FUN_0046fe20(undefined4 param_1, undefined4 param_2, undefined4 param_3); // 0046fe20 // FUN_0046fe20
|
||||
|
||||
// 0043e540
|
||||
int r3_wait_for_dvd(char *param_1,char *param_2,uint param_3)
|
||||
|
||||
{
|
||||
ushort uVar1;
|
||||
int iVar2;
|
||||
char local_64 [100];
|
||||
|
||||
FUN_0046fe20(1,1,0);
|
||||
iVar2 = FUN_00441d70((undefined4)param_1,0x42c80000,0x43480000,0,0xffffffff);
|
||||
if (iVar2 == 0) {
|
||||
iVar2 = MessageBoxA(g_gameHWND1,param_1,param_2,param_3 | 0x10000);
|
||||
return iVar2;
|
||||
}
|
||||
if ((param_3 & 5) != 0) {
|
||||
FUN_00441d70((undefined4)s_quitting1,0x42c80000,0x438c0000,0,0xffffffff);
|
||||
FUN_0043e4f0();
|
||||
sprintf(local_64,s__jc_z_d__s_005bd460,DAT_005bd454,s_wndStrQuiting);
|
||||
FUN_00441d70((undefined4)local_64,0x43340000,0x43b40000,0,0xffffffff);
|
||||
r3_gfxFrameUNK();
|
||||
IPT_fn_vReadInput();
|
||||
uVar1 = GetAsyncKeyState(0x1b);
|
||||
return ((uVar1 & 0x8000) != 0) + 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -59,12 +59,34 @@ char(&lpAppName_005b68f0)[8] = reinterpret_cast<char(&)[8]>(GH_MEM(0x005b68f0));
|
|||
const char* s_Directory_005b68f8 = "Directory"; // 005b68f8
|
||||
const char* s_None = "None"; // 005b6904
|
||||
const char* s_UbiSoft_Ubi_ini = "/UbiSoft/Ubi.ini"; // 005b690c
|
||||
undefined1& g_errModDInput= (undefined1&) GH_MEM(0x005bd29c);
|
||||
undefined4& DAT_005bd454= (undefined4&) GH_MEM(0x005bd454);
|
||||
const char* s__jc_z_d__s_005bd460 = "\\jc\\z%d:%s"; // 005bd460
|
||||
undefined1& g_errModMmg= (undefined1&) GH_MEM(0x005bd58c);
|
||||
const char* s_R3_DVD_005bdfd8 = "R3_DVD"; // 005bdfd8
|
||||
const char* s_R3_DVD_005be0ec = "R3_DVD"; // 005be0ec
|
||||
const char* s__s_DVD_missing_005be0f4 = "%s DVD missing "; // 005be0f4
|
||||
const char* s_Die__s_DVDROM_kann_nicht_gelesen_005be130 = "Die %s DVDROM kann nicht gelesen werden"; // 005be130
|
||||
const char* s_Impossibile_trovare_il_DVD____s_005be198 = "Impossibile trovare il DVD : %s"; // 005be198
|
||||
const char* s_DVD_s_no_v_lido_005be1ec = "DVD %s no v£lido "; // 005be1ec
|
||||
const char* s_Impossible_de_trouver_le_DVD_____005be238 = "Impossible de trouver le DVD : %s"; // 005be238
|
||||
const char* s_Please_insert_the_DVD_in_the_DVD_005be400 = "Please insert the DVD in the DVD-Rom drive."; // 005be400
|
||||
const char* s_Bitte_legen_Sie_DVD_von_Rayman_3_005be438 = "Bitte legen Sie DVD von Rayman 3 in Ihr DVD-ROM Laufwerk ein."; // 005be438
|
||||
const char* s_Inserisci_il_DVD_di_Rayman_3_nel_005be484 = "Inserisci il DVD di Rayman 3 nel lettore DVD-ROM."; // 005be484
|
||||
const char* s_Introduce_el_DVD_de_Rayman_3_en_l_005be4c0 = "Introduce el DVD de Rayman 3 en la unidad de DVD-ROM."; // 005be4c0
|
||||
const char* s_Veuillez_ins_rer_le_DVD_dans_vot_005be500 = "Veuillez ins←rer le DVD dans votre lecteur DVD-ROM."; // 005be500
|
||||
const char* s_fmt_c_colon_s = "%c:%s"; // 005be540
|
||||
const char* s_r3_program_files = "\\program files\\Ubi Soft\\Rayman3"; // 005be548
|
||||
const char* s_driveLetterTemplate = "A:\\"; // 005be568
|
||||
HWND& g_gameHWND1= (HWND&) GH_MEM(0x005cf964);
|
||||
long& lpDefault_005cf96c= (long&) GH_MEM(0x005cf96c);
|
||||
dword& DWORD_005cf974= (dword&) GH_MEM(0x005cf974);
|
||||
dword& DWORD_005cf978= (dword&) GH_MEM(0x005cf978);
|
||||
dword& DWORD_005cf97c= (dword&) GH_MEM(0x005cf97c);
|
||||
dword& DWORD_005cf980= (dword&) GH_MEM(0x005cf980);
|
||||
char *& PTR_005cf9b4= (char *&) GH_MEM(0x005cf9b4);
|
||||
GameStructure& g_currentBinkMovie= (GameStructure&) GH_MEM(0x005d2660);
|
||||
char(&s_volumeNameBuffer)[128] = reinterpret_cast<char(&)[128]>(GH_MEM(0x005d27b0));
|
||||
r3_main_data& r3_main_data_005d28b6= (r3_main_data&) GH_MEM(0x005d28b6);
|
||||
int& g_runMaximized= (int&) GH_MEM(0x0077d0a8);
|
||||
undefined4& g_engineRunning= (undefined4&) GH_MEM(0x0077d0b4);
|
||||
|
@ -82,3 +104,4 @@ char *& g_crt_cmdLine= (char *&) GH_MEM(0x0077ea84);
|
|||
char(&s_quitting1)[64] = reinterpret_cast<char(&)[64]>(GH_MEM(0x007825c0));
|
||||
char(&s_wndStrQuiting)[56] = reinterpret_cast<char(&)[56]>(GH_MEM(0x00782600));
|
||||
undefined4& DAT_007d9cc4= (undefined4&) GH_MEM(0x007d9cc4);
|
||||
char(&g_driveLetter)[4] = reinterpret_cast<char(&)[4]>(GH_MEM(0x007d9e70));
|
||||
|
|
|
@ -64,12 +64,34 @@ extern char(&lpAppName_005b68f0)[8]; // 005b68f0
|
|||
extern const char* s_Directory_005b68f8; // 005b68f8
|
||||
extern const char* s_None; // 005b6904
|
||||
extern const char* s_UbiSoft_Ubi_ini; // 005b690c
|
||||
extern undefined1& g_errModDInput; // 005bd29c
|
||||
extern undefined4& DAT_005bd454; // 005bd454
|
||||
extern const char* s__jc_z_d__s_005bd460; // 005bd460
|
||||
extern undefined1& g_errModMmg; // 005bd58c
|
||||
extern const char* s_R3_DVD_005bdfd8; // 005bdfd8
|
||||
extern const char* s_R3_DVD_005be0ec; // 005be0ec
|
||||
extern const char* s__s_DVD_missing_005be0f4; // 005be0f4
|
||||
extern const char* s_Die__s_DVDROM_kann_nicht_gelesen_005be130; // 005be130
|
||||
extern const char* s_Impossibile_trovare_il_DVD____s_005be198; // 005be198
|
||||
extern const char* s_DVD_s_no_v_lido_005be1ec; // 005be1ec
|
||||
extern const char* s_Impossible_de_trouver_le_DVD_____005be238; // 005be238
|
||||
extern const char* s_Please_insert_the_DVD_in_the_DVD_005be400; // 005be400
|
||||
extern const char* s_Bitte_legen_Sie_DVD_von_Rayman_3_005be438; // 005be438
|
||||
extern const char* s_Inserisci_il_DVD_di_Rayman_3_nel_005be484; // 005be484
|
||||
extern const char* s_Introduce_el_DVD_de_Rayman_3_en_l_005be4c0; // 005be4c0
|
||||
extern const char* s_Veuillez_ins_rer_le_DVD_dans_vot_005be500; // 005be500
|
||||
extern const char* s_fmt_c_colon_s; // 005be540
|
||||
extern const char* s_r3_program_files; // 005be548
|
||||
extern const char* s_driveLetterTemplate; // 005be568
|
||||
extern HWND& g_gameHWND1; // 005cf964
|
||||
extern long& lpDefault_005cf96c; // 005cf96c
|
||||
extern dword& DWORD_005cf974; // 005cf974
|
||||
extern dword& DWORD_005cf978; // 005cf978
|
||||
extern dword& DWORD_005cf97c; // 005cf97c
|
||||
extern dword& DWORD_005cf980; // 005cf980
|
||||
extern char *& PTR_005cf9b4; // 005cf9b4
|
||||
extern GameStructure& g_currentBinkMovie; // 005d2660
|
||||
extern char(&s_volumeNameBuffer)[128]; // 005d27b0
|
||||
extern r3_main_data& r3_main_data_005d28b6; // 005d28b6
|
||||
extern int& g_runMaximized; // 0077d0a8
|
||||
extern undefined4& g_engineRunning; // 0077d0b4
|
||||
|
@ -87,4 +109,5 @@ extern char *& g_crt_cmdLine; // 0077ea84
|
|||
extern char(&s_quitting1)[64]; // 007825c0
|
||||
extern char(&s_wndStrQuiting)[56]; // 00782600
|
||||
extern undefined4& DAT_007d9cc4; // 007d9cc4
|
||||
extern char(&g_driveLetter)[4]; // 007d9e70
|
||||
#endif // GH_GENERATED_GLOBALS_H
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 00401000
|
||||
// r3_initAllModules
|
||||
extern "C" undefined r3_initAllModules(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x00401000);
|
||||
// 0043e1d0
|
||||
// Erm_fn_ucInitErrMsg
|
||||
extern "C" byte Erm_fn_ucInitErrMsg(void) {
|
||||
return gh_stub_impl_stdcall<byte>((void*)0x0043e1d0);
|
||||
}
|
|
@ -6,8 +6,8 @@
|
|||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 004464f0
|
||||
// r3_checkDisc
|
||||
extern "C" undefined r3_checkDisc(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x004464f0);
|
||||
// 0043e4f0
|
||||
// FUN_0043e4f0
|
||||
extern "C" undefined FUN_0043e4f0(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x0043e4f0);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 00441d70
|
||||
// FUN_00441d70
|
||||
extern "C" undefined FUN_00441d70(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined4 param_5) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x00441d70, param_1, param_2, param_3, param_4, param_5);
|
||||
}
|
|
@ -6,8 +6,8 @@
|
|||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 0043e540
|
||||
// r3_wait_for_dvd
|
||||
extern "C" undefined r3_wait_for_dvd(char * param_1, char * param_2, undefined4 param_3) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x0043e540, param_1, param_2, param_3);
|
||||
// 0046fe20
|
||||
// FUN_0046fe20
|
||||
extern "C" undefined FUN_0046fe20(undefined4 param_1, undefined4 param_2, undefined4 param_3) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x0046fe20, param_1, param_2, param_3);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 00505fe0
|
||||
// IPT_fn_vReadInput
|
||||
extern "C" void IPT_fn_vReadInput(void) {
|
||||
gh_stub_impl_stdcall<void>((void*)0x00505fe0);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 0043f830
|
||||
// Mmg_fn_vFirstInitMmgModule
|
||||
extern "C" undefined Mmg_fn_vFirstInitMmgModule(undefined1 ucMaxNbChannel) {
|
||||
return gh_stub_impl_stdcall<undefined>((void*)0x0043f830, ucMaxNbChannel);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 0046fed0
|
||||
// r3_gfxFrame?
|
||||
extern "C" undefined r3_gfxFrameUNK(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x0046fed0);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 0043e630
|
||||
// r3_module1_init
|
||||
extern "C" undefined r3_module1_init(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x0043e630);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// AUTO-GENERATED FILE!!!!
|
||||
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
|
||||
// with possible manualy fixes
|
||||
|
||||
#include <r3/binders/auto.h>
|
||||
#include <r3/binders/stub.h>
|
||||
#include <gh_global.h>
|
||||
|
||||
// 00443f10
|
||||
// r3_module_big_init
|
||||
extern "C" undefined r3_module_big_init(void) {
|
||||
return gh_stub_impl_cdecl<undefined>((void*)0x00443f10);
|
||||
}
|
|
@ -545,7 +545,7 @@ struct EngineObject {
|
|||
MS_tdxHandleToMSMagnet h_MSMagnet;
|
||||
};
|
||||
typedef void *GEO_tdxHandleToRadiosity;
|
||||
typedef struct IPT_tdstInput_ *IPT_tdxHandleToInput;
|
||||
typedef struct IPT_Input *IPT_tdxHandleToInput;
|
||||
enum SCR_tde_Link_State_ {
|
||||
SCR_ELS_Link_NotInitialized=0,
|
||||
SCR_ELS_Link_Initialized=1
|
||||
|
@ -734,80 +734,6 @@ struct _s_FuncInfo {
|
|||
unsigned int nIPMapEntries;
|
||||
void *pIPToStateMap;
|
||||
};
|
||||
typedef struct IPT_tdstHistoricElement_ *IPT_tdxHandleToHistoricElement;
|
||||
typedef struct SCR_tdst_DyAr_Header_ SCR_tdst_DyAr_Header;
|
||||
enum SCR_tde_DyAr_State {
|
||||
SCR_EDAS_DyAr_Invalid=0,
|
||||
SCR_EDAS_DyAr_Free=1,
|
||||
SCR_EDAS_DyAr_Occupy=2
|
||||
};
|
||||
struct SCR_tdst_DyAr_Element_ {
|
||||
void *d_vElement;
|
||||
enum SCR_tde_DyAr_State eState;
|
||||
};
|
||||
typedef struct SCR_tdst_DyAr_Element_ SCR_tdst_DyAr_Element;
|
||||
struct SCR_tdst_DyAr_Description_ {
|
||||
SCR_tdst_DyAr_Element *d_stDynArray;
|
||||
unsigned int uiNumValues;
|
||||
unsigned int uiMaxValues;
|
||||
};
|
||||
typedef struct SCR_tdst_DyAr_Description_ SCR_tdst_DyAr_Description;
|
||||
typedef SCR_tdst_DyAr_Description SCR_tda_st_Hash_Table[256];
|
||||
struct SCR_tdst_Link_Table_ {
|
||||
SCR_tdst_DyAr_Header stHeader;
|
||||
SCR_tdst_DyAr_Description stLinkArray;
|
||||
SCR_tda_st_Hash_Table a_stHashTableForValues;
|
||||
SCR_tda_st_Hash_Table a_stHashTableForKeys;
|
||||
};
|
||||
typedef struct SCR_tdst_Link_Table_ SCR_tdst_Link_Table;
|
||||
union tdu_KeyWordElementUnion_ {
|
||||
short swJoyNumber;
|
||||
short swJoyAction;
|
||||
short swJoyValueMin;
|
||||
short swJoyValueMax;
|
||||
short swPadNumber;
|
||||
short swPadAction;
|
||||
short swKey;
|
||||
short swKeyWord;
|
||||
IPT_tdxHandleToEntryElement hEntryElement;
|
||||
unsigned long ulNumberOfSequence;
|
||||
};
|
||||
struct IPT_tdstKeyWordElement_ {
|
||||
IPT_tdxHandleToKeyWordElement hNextBrotherDyn;
|
||||
IPT_tdxHandleToKeyWordElement hPrevBrotherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn *hFatherDyn;
|
||||
union tdu_KeyWordElementUnion_ u_ElementUnion;
|
||||
unsigned char ucResult;
|
||||
unsigned char ucMinCounterInput;
|
||||
unsigned char ucMaxCounterInput;
|
||||
};
|
||||
struct IPT_tdstEntryElement_ {
|
||||
IPT_tdxHandleToEntryElement hNextBrotherDyn;
|
||||
IPT_tdxHandleToEntryElement hPrevBrotherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn *hFatherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn hKeyWordList;
|
||||
unsigned long ulNumberOfKeyWordElement;
|
||||
struct IPT_tdstKeyWordElement_ *d_stKeyWordElementArray;
|
||||
char *p_szActionName;
|
||||
char *p_szEntryName;
|
||||
long lState;
|
||||
float xAnalogicValue;
|
||||
unsigned char bIsActivate;
|
||||
};
|
||||
struct IPT_tdstInput_ {
|
||||
unsigned char ucOnePadActivate;
|
||||
unsigned char p_ucValideAndActiveDevice[0];
|
||||
unsigned char p_ucKeyboardCounter[256];
|
||||
unsigned char p_ucPadAndJoyCounter[0][0];
|
||||
SCR_tdst_Link_Table stEntryLink;
|
||||
SCR_tdst_Link_Table stCommandLink;
|
||||
unsigned char ucKeyboardType;
|
||||
unsigned long ulNumberOfEntryElement;
|
||||
struct IPT_tdstEntryElement_ *d_stEntryElementArray;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn hEntryElement;
|
||||
short sEventHistoricSize;
|
||||
IPT_tdxHandleToHistoricElement hEventHistoric;
|
||||
};
|
||||
#define C_ucMmgInvalidGroup 255
|
||||
struct LST2_tdstAnchorTotdxHandleToFamilyListDyn {
|
||||
tdxHandleToFamilyList hFirstElementDyn;
|
||||
|
@ -823,12 +749,29 @@ struct LST2_tdstAnchorTotdxHandleToStateSLk {
|
|||
union _tduResDisk {
|
||||
};
|
||||
typedef union _tduResDisk tduResDisk;
|
||||
union tdu_KeyWordElementUnion_ {
|
||||
short swJoyNumber;
|
||||
short swJoyAction;
|
||||
short swJoyValueMin;
|
||||
short swJoyValueMax;
|
||||
short swPadNumber;
|
||||
short swPadAction;
|
||||
short swKey;
|
||||
short swKeyWord;
|
||||
IPT_tdxHandleToEntryElement hEntryElement;
|
||||
unsigned long ulNumberOfSequence;
|
||||
};
|
||||
struct _tdstTypeSplitMem {
|
||||
};
|
||||
typedef short ACP_tdxIndex;
|
||||
struct GEO_tdstTripledIndex {
|
||||
ACP_tdxIndex a3_xIndex[3];
|
||||
};
|
||||
enum SCR_tde_DyAr_State {
|
||||
SCR_EDAS_DyAr_Invalid=0,
|
||||
SCR_EDAS_DyAr_Free=1,
|
||||
SCR_EDAS_DyAr_Occupy=2
|
||||
};
|
||||
typedef struct tdstAlwaysModelList_ *ALW_tdxHandleToModelList;
|
||||
#define INO_C_ucConnected 1
|
||||
#define INO_C_ucKeyDown 128
|
||||
|
@ -937,6 +880,15 @@ struct _tdstThemePartOutro {
|
|||
#define C_SOUNDPARAM_NO_DOPPLER 2
|
||||
struct IPT_tdstScriptValue_ {
|
||||
};
|
||||
struct IPT_tdstKeyWordElement_ {
|
||||
IPT_tdxHandleToKeyWordElement hNextBrotherDyn;
|
||||
IPT_tdxHandleToKeyWordElement hPrevBrotherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn *hFatherDyn;
|
||||
union tdu_KeyWordElementUnion_ u_ElementUnion;
|
||||
unsigned char ucResult;
|
||||
unsigned char ucMinCounterInput;
|
||||
unsigned char ucMaxCounterInput;
|
||||
};
|
||||
#define IPT_C_InvalidCommand -1
|
||||
struct tdstTransition_ {
|
||||
};
|
||||
|
@ -990,6 +942,26 @@ typedef struct _tdstSndPolyEvent tdstSndPolyEvent;
|
|||
struct _tdstThemeBridge {
|
||||
};
|
||||
typedef struct _tdstThemeBridge tdstThemeBridge;
|
||||
typedef struct SCR_tdst_DyAr_Header_ SCR_tdst_DyAr_Header;
|
||||
struct SCR_tdst_DyAr_Element_ {
|
||||
void *d_vElement;
|
||||
enum SCR_tde_DyAr_State eState;
|
||||
};
|
||||
typedef struct SCR_tdst_DyAr_Element_ SCR_tdst_DyAr_Element;
|
||||
struct SCR_tdst_DyAr_Description_ {
|
||||
SCR_tdst_DyAr_Element *d_stDynArray;
|
||||
unsigned int uiNumValues;
|
||||
unsigned int uiMaxValues;
|
||||
};
|
||||
typedef struct SCR_tdst_DyAr_Description_ SCR_tdst_DyAr_Description;
|
||||
typedef SCR_tdst_DyAr_Description SCR_tda_st_Hash_Table[256];
|
||||
struct SCR_tdst_Link_Table_ {
|
||||
SCR_tdst_DyAr_Header stHeader;
|
||||
SCR_tdst_DyAr_Description stLinkArray;
|
||||
SCR_tda_st_Hash_Table a_stHashTableForValues;
|
||||
SCR_tda_st_Hash_Table a_stHashTableForKeys;
|
||||
};
|
||||
typedef struct SCR_tdst_Link_Table_ SCR_tdst_Link_Table;
|
||||
#define POS_C_xScaleNotAccepted 256
|
||||
#define UNINITIALIZED_VALUE 305419896
|
||||
#define C_ucMmgDefaultChannel 0
|
||||
|
@ -3764,6 +3736,19 @@ struct FileInner1 {
|
|||
};
|
||||
typedef struct _tdstSampleStreaming tdstSampleStreaming;
|
||||
#define C_NB_MAX_SETS_OF_RASTERS 16
|
||||
struct IPT_tdstEntryElement_ {
|
||||
IPT_tdxHandleToEntryElement hNextBrotherDyn;
|
||||
IPT_tdxHandleToEntryElement hPrevBrotherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn *hFatherDyn;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToKeyWordElementDyn hKeyWordList;
|
||||
unsigned long ulNumberOfKeyWordElement;
|
||||
struct IPT_tdstKeyWordElement_ *d_stKeyWordElementArray;
|
||||
char *p_szActionName;
|
||||
char *p_szEntryName;
|
||||
long lState;
|
||||
float xAnalogicValue;
|
||||
unsigned char bIsActivate;
|
||||
};
|
||||
#define INO_C_uwAnyType 255
|
||||
typedef struct _tdstAllRetObjectSound tdstAllRetObjectSound;
|
||||
#define C_uaBeginKey 2971878763
|
||||
|
@ -4151,7 +4136,6 @@ struct LevelLoadState {
|
|||
undefined *ptrSized; /* len = size * 8 */
|
||||
unsigned int ptrSize;
|
||||
};
|
||||
typedef struct IPT_tdstInput_ IPT_tdstInput;
|
||||
#define __RAD32__ 1
|
||||
typedef struct tdstProhibit_ *tdxHandleToProhibit;
|
||||
struct LST2_tdstAnchorTotdxHandleToProhibitSLk {
|
||||
|
@ -4586,24 +4570,8 @@ struct GameStructure {
|
|||
undefined field45_0x45;
|
||||
undefined field46_0x46;
|
||||
undefined field47_0x47;
|
||||
char *movieName;
|
||||
undefined field49_0x4c;
|
||||
undefined field50_0x4d;
|
||||
undefined field51_0x4e;
|
||||
undefined field52_0x4f;
|
||||
undefined field53_0x50;
|
||||
undefined field54_0x51;
|
||||
undefined field55_0x52;
|
||||
undefined field56_0x53;
|
||||
undefined field57_0x54;
|
||||
undefined field58_0x55;
|
||||
undefined field59_0x56;
|
||||
undefined field60_0x57;
|
||||
undefined field61_0x58;
|
||||
undefined field62_0x59;
|
||||
undefined field63_0x5a;
|
||||
undefined field64_0x5b;
|
||||
float field65_0x5c;
|
||||
char movieName[20];
|
||||
float field49_0x5c;
|
||||
};
|
||||
typedef char * (*tdpfnResNameCallback)(unsigned long param1);
|
||||
#define C_ucFalse 0
|
||||
|
@ -4641,6 +4609,7 @@ struct tdstFamilyList_ {
|
|||
struct tdstObjectsTablesList_ {
|
||||
};
|
||||
typedef union _tduRefRes tduRefRes;
|
||||
typedef struct IPT_tdstHistoricElement_ *IPT_tdxHandleToHistoricElement;
|
||||
struct m7_init_struct {
|
||||
unsigned int threadSignal0;
|
||||
unsigned int threadSignal1;
|
||||
|
@ -5008,112 +4977,49 @@ struct r3_math_interface {
|
|||
undefined *float2_transformXZ;
|
||||
undefined *field10_0x28;
|
||||
undefined *field11_0x2c;
|
||||
undefined field12_0x30;
|
||||
undefined field13_0x31;
|
||||
undefined field14_0x32;
|
||||
undefined field15_0x33;
|
||||
undefined *field16_0x34;
|
||||
undefined field17_0x38;
|
||||
undefined field18_0x39;
|
||||
undefined field19_0x3a;
|
||||
undefined field20_0x3b;
|
||||
undefined field21_0x3c;
|
||||
undefined field22_0x3d;
|
||||
undefined field23_0x3e;
|
||||
undefined field24_0x3f;
|
||||
undefined *field25_0x40;
|
||||
undefined *field26_0x44;
|
||||
undefined *field27_0x48;
|
||||
undefined *field28_0x4c;
|
||||
undefined *field29_0x50;
|
||||
undefined *field30_0x54;
|
||||
undefined *field31_0x58;
|
||||
undefined field32_0x5c;
|
||||
undefined field33_0x5d;
|
||||
undefined field34_0x5e;
|
||||
undefined field35_0x5f;
|
||||
undefined *field36_0x60;
|
||||
undefined *field37_0x64;
|
||||
undefined field38_0x68;
|
||||
undefined field39_0x69;
|
||||
undefined field40_0x6a;
|
||||
undefined field41_0x6b;
|
||||
undefined *field42_0x6c;
|
||||
undefined *field43_0x70;
|
||||
undefined field44_0x74;
|
||||
undefined field45_0x75;
|
||||
undefined field46_0x76;
|
||||
undefined field47_0x77;
|
||||
undefined *field48_0x78;
|
||||
undefined *field49_0x7c;
|
||||
undefined field50_0x80;
|
||||
undefined field51_0x81;
|
||||
undefined field52_0x82;
|
||||
undefined field53_0x83;
|
||||
undefined field54_0x84;
|
||||
undefined field55_0x85;
|
||||
undefined field56_0x86;
|
||||
undefined field57_0x87;
|
||||
undefined field58_0x88;
|
||||
undefined field59_0x89;
|
||||
undefined field60_0x8a;
|
||||
undefined field61_0x8b;
|
||||
undefined field62_0x8c;
|
||||
undefined field63_0x8d;
|
||||
undefined field64_0x8e;
|
||||
undefined field65_0x8f;
|
||||
undefined field66_0x90;
|
||||
undefined field67_0x91;
|
||||
undefined field68_0x92;
|
||||
undefined field69_0x93;
|
||||
undefined field70_0x94;
|
||||
undefined field71_0x95;
|
||||
undefined field72_0x96;
|
||||
undefined field73_0x97;
|
||||
undefined field74_0x98;
|
||||
undefined field75_0x99;
|
||||
undefined field76_0x9a;
|
||||
undefined field77_0x9b;
|
||||
undefined field78_0x9c;
|
||||
undefined field79_0x9d;
|
||||
undefined field80_0x9e;
|
||||
undefined field81_0x9f;
|
||||
undefined field82_0xa0;
|
||||
undefined field83_0xa1;
|
||||
undefined field84_0xa2;
|
||||
undefined field85_0xa3;
|
||||
undefined field86_0xa4;
|
||||
undefined field87_0xa5;
|
||||
undefined field88_0xa6;
|
||||
undefined field89_0xa7;
|
||||
undefined field90_0xa8;
|
||||
undefined field91_0xa9;
|
||||
undefined field92_0xaa;
|
||||
undefined field93_0xab;
|
||||
undefined field94_0xac;
|
||||
undefined field95_0xad;
|
||||
undefined field96_0xae;
|
||||
undefined field97_0xaf;
|
||||
undefined field98_0xb0;
|
||||
undefined field99_0xb1;
|
||||
undefined field100_0xb2;
|
||||
undefined field101_0xb3;
|
||||
undefined field102_0xb4;
|
||||
undefined field103_0xb5;
|
||||
undefined field104_0xb6;
|
||||
undefined field105_0xb7;
|
||||
undefined field106_0xb8;
|
||||
undefined field107_0xb9;
|
||||
undefined field108_0xba;
|
||||
undefined field109_0xbb;
|
||||
undefined *field110_0xbc;
|
||||
undefined *field111_0xc0;
|
||||
undefined *field112_0xc4;
|
||||
undefined *field113_0xc8;
|
||||
undefined *field114_0xcc;
|
||||
undefined *field115_0xd0;
|
||||
undefined *field116_0xd4;
|
||||
undefined *field117_0xd8;
|
||||
pointer field12_0x30;
|
||||
undefined *field13_0x34;
|
||||
pointer field14_0x38;
|
||||
pointer field15_0x3c;
|
||||
undefined *field16_0x40;
|
||||
undefined *field17_0x44;
|
||||
undefined *field18_0x48;
|
||||
undefined *field19_0x4c;
|
||||
undefined *field20_0x50;
|
||||
undefined *field21_0x54;
|
||||
undefined *field22_0x58;
|
||||
pointer field23_0x5c;
|
||||
undefined *field24_0x60;
|
||||
undefined *field25_0x64;
|
||||
undefined *field26_0x68;
|
||||
undefined *field27_0x6c;
|
||||
undefined *field28_0x70;
|
||||
undefined *field29_0x74;
|
||||
undefined *field30_0x78;
|
||||
undefined *field31_0x7c;
|
||||
undefined *field32_0x80;
|
||||
undefined *field33_0x84;
|
||||
undefined *field34_0x88;
|
||||
undefined *field35_0x8c;
|
||||
undefined *field36_0x90;
|
||||
undefined *field37_0x94;
|
||||
undefined *field38_0x98;
|
||||
undefined *field39_0x9c;
|
||||
undefined *field40_0xa0;
|
||||
undefined *field41_0xa4;
|
||||
undefined *field42_0xa8;
|
||||
undefined *field43_0xac;
|
||||
undefined *field44_0xb0;
|
||||
undefined *field45_0xb4;
|
||||
undefined *field46_0xb8;
|
||||
undefined *field47_0xbc;
|
||||
undefined *field48_0xc0;
|
||||
undefined *field49_0xc4;
|
||||
undefined *field50_0xc8;
|
||||
undefined *field51_0xcc;
|
||||
undefined *field52_0xd0;
|
||||
undefined *field53_0xd4;
|
||||
undefined *field54_0xd8;
|
||||
};
|
||||
#define C_SOUNDSPACE_BACK 127
|
||||
struct GAM_astruct_4 {
|
||||
|
@ -5255,6 +5161,20 @@ struct GLD_Viewport {
|
|||
struct GLD_ViewportAttributes stViewAttrib;
|
||||
unsigned char bIsLocked;
|
||||
};
|
||||
struct IPT_Input {
|
||||
unsigned char ucOnePadActivate;
|
||||
unsigned char p_ucValideAndActiveDevice[19];
|
||||
unsigned char p_ucKeyboardCounter[256];
|
||||
unsigned char p_ucPadAndJoyCounter[19][74];
|
||||
SCR_tdst_Link_Table stEntryLink;
|
||||
SCR_tdst_Link_Table stCommandLink;
|
||||
unsigned char ucKeyboardType;
|
||||
unsigned long ulNumberOfEntryElement;
|
||||
struct IPT_tdstEntryElement_ *d_stEntryElementArray;
|
||||
struct LST2_tdstAnchorToIPT_tdxHandleToEntryElementDyn hEntryElement;
|
||||
short sEventHistoricSize;
|
||||
IPT_tdxHandleToHistoricElement hEventHistoric;
|
||||
};
|
||||
#define INO_C_wNbMaxAxis 6
|
||||
struct tdstProhibit_ {
|
||||
};
|
||||
|
|
|
@ -59,6 +59,9 @@ template <size_t Size> struct FieldBinder {
|
|||
return *reinterpret_cast<ExpectedType *>(dst) =
|
||||
*reinterpret_cast<ExpectedType *>(other.dst);
|
||||
}
|
||||
template <typename T = ExpectedType,
|
||||
typename = typename std::enable_if<!std::is_same<T, undefined4>::value>::type>
|
||||
operator undefined4() const { return reinterpret_cast<undefined4>(dst); }
|
||||
};
|
||||
|
||||
template <size_t Offset, size_t Size>
|
||||
|
|
|
@ -20,6 +20,7 @@ typedef uint32_t undefined4;
|
|||
typedef uint16_t undefined2;
|
||||
typedef uint16_t word;
|
||||
typedef uint32_t dword;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned long uint;
|
||||
|
|
|
@ -11,10 +11,14 @@ void *gh_stub_impl_ptr(void *ptr);
|
|||
|
||||
template <typename T, typename... Args>
|
||||
T gh_stub_impl_cdecl(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __cdecl T (*)(Args...);
|
||||
static Callable fn = (Callable)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#if RE_DBG_INJECTED
|
||||
#if MSVC
|
||||
static T (*__cdecl ptr)(Args...) = (T(*)(Args...))gh_stub_impl_ptr(ptr_);
|
||||
#else
|
||||
using TFn = __cdecl T (*)(Args...);
|
||||
static TFn ptr = (TFn)gh_stub_impl_ptr(ptr_);
|
||||
#endif
|
||||
return ptr(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
#endif
|
||||
|
@ -23,9 +27,14 @@ T gh_stub_impl_cdecl(void *ptr_, Args... args) {
|
|||
template <typename T, typename... Args>
|
||||
T gh_stub_impl_stdcall(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __stdcall T (*)(Args...);
|
||||
static Callable fn = (Callable)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#if MSVC
|
||||
static T (*__stdcall ptr)(Args...) =
|
||||
(T(*__stdcall)(Args...))gh_stub_impl_ptr(ptr_);
|
||||
#else
|
||||
using TFn = __stdcall T (*)(Args...);
|
||||
static TFn ptr = (TFn)gh_stub_impl_ptr(ptr_);
|
||||
#endif
|
||||
return ptr(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.io.File;
|
|||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -33,7 +34,7 @@ public class FunctionDumper {
|
|||
public boolean createdFile = false;
|
||||
// Collects functions called by the current function
|
||||
public HashSet<Function> functionReferences = new HashSet<>();
|
||||
|
||||
|
||||
// Add flag to force Fix type
|
||||
public boolean forceFixType = false;
|
||||
|
||||
|
@ -115,11 +116,11 @@ public class FunctionDumper {
|
|||
Address entrypoint = function.getEntryPoint();
|
||||
List<FunctionDatabase.FunctionEntry> entries = functionDatabase.findEntriesByAddress(entrypoint);
|
||||
FunctionDatabase.Type targetType = FunctionDatabase.Type.Auto;
|
||||
|
||||
|
||||
// Handle forceFixType flag
|
||||
if (forceFixType) {
|
||||
targetType = FunctionDatabase.Type.Fix;
|
||||
|
||||
|
||||
// Remove any existing Auto entries for this function
|
||||
for (FunctionDatabase.FunctionEntry entry : entries) {
|
||||
if (entry.type == FunctionDatabase.Type.Auto) {
|
||||
|
@ -139,7 +140,7 @@ public class FunctionDumper {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Always remove stub entries regardless of mode
|
||||
for (FunctionDatabase.FunctionEntry entry : entries) {
|
||||
if (entry.type == FunctionDatabase.Type.Stub) {
|
||||
|
@ -162,12 +163,12 @@ public class FunctionDumper {
|
|||
} else {
|
||||
targetFilename = new File(RemanConfig.INSTANCE.dirDecompAuto, fileName);
|
||||
}
|
||||
|
||||
|
||||
// Handle overwrite prompting for Fix type
|
||||
if (targetFilename.exists()) {
|
||||
if (targetType == FunctionDatabase.Type.Fix) {
|
||||
script.println("Fix file already exists: " + targetFilename);
|
||||
boolean overwrite = script.askYesNo("Overwrite existing Fix file?",
|
||||
boolean overwrite = script.askYesNo("Overwrite existing Fix file?",
|
||||
"The Fix file " + targetFilename.getName() + " already exists. Do you want to overwrite it?");
|
||||
if (!overwrite) {
|
||||
script.println("Aborted: User chose not to overwrite existing Fix file.");
|
||||
|
@ -189,6 +190,7 @@ public class FunctionDumper {
|
|||
functionDatabase.addEntryAt(newEntry);
|
||||
|
||||
List<Function> externalFunctionCalls = new ArrayList<>();
|
||||
HashMap<String, String> replacementMap = new HashMap<>();
|
||||
|
||||
DecompileResults decompRes = RemanConfig.INSTANCE.decompCache.getOrInsert(function);
|
||||
try (PrintWriter writer2 = new PrintWriter(f0, "UTF-8")) {
|
||||
|
@ -297,6 +299,11 @@ public class FunctionDumper {
|
|||
if (calledFunction != null) {
|
||||
if (isValidFunction(calledFunction)) {
|
||||
externalFunctionCalls.add(calledFunction);
|
||||
String fname = calledFunction.getName();
|
||||
String fsname = Utils.sanitizeIdentifier(fname);
|
||||
if (fsname != fname) {
|
||||
replacementMap.put(fname, fsname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -314,9 +321,11 @@ public class FunctionDumper {
|
|||
|
||||
for (Function externalFunction : externalFunctionCalls) {
|
||||
String proto = externalFunction.getSignature().getPrototypeString(false);
|
||||
String name = externalFunction.getName();
|
||||
proto = proto.replace(name, Utils.sanitizeIdentifier(name));
|
||||
headers.add("" + proto
|
||||
+ "; // " + externalFunction.getEntryPoint() + " // "
|
||||
+ externalFunction.getName());
|
||||
+ name);
|
||||
}
|
||||
|
||||
for (String header : headers) {
|
||||
|
@ -324,7 +333,13 @@ public class FunctionDumper {
|
|||
}
|
||||
writer2.println();
|
||||
writer2.print("// " + function.getEntryPoint());
|
||||
writer2.print(codeWriter.toString());
|
||||
String codeString = codeWriter.toString();
|
||||
for (HashMap.Entry<String, String> entry : replacementMap.entrySet()) {
|
||||
String oldName = entry.getKey();
|
||||
String newName = entry.getValue();
|
||||
codeString = codeString.replace(oldName, newName);
|
||||
}
|
||||
writer2.print(codeString);
|
||||
writer2.println("}");
|
||||
writer2.println();
|
||||
}
|
||||
|
@ -360,15 +375,18 @@ public class FunctionDumper {
|
|||
writer2.println();
|
||||
writer2.println("// " + externalFunction.getEntryPoint());
|
||||
writer2.println("// " + externalFunction.getName());
|
||||
|
||||
// Parse function signature to extract calling convention, return type, and parameters
|
||||
|
||||
// Parse function signature to extract calling convention, return type, and
|
||||
// parameters
|
||||
String signature = externalFunction.getSignature().getPrototypeString(false);
|
||||
signature = signature.replace(externalFunction.getName(), sanitizedExtFunctionName);
|
||||
script.println("Santiziaed Signature: " + signature);
|
||||
String callingConvention = externalFunction.getCallingConventionName();
|
||||
String returnType = externalFunction.getReturnType().toString();
|
||||
|
||||
|
||||
// Generate function stub using appropriate forwarding function
|
||||
writer2.println("extern \"C\" " + signature + " {");
|
||||
|
||||
|
||||
// Determine which stub function to use based on calling convention
|
||||
String stubFunction;
|
||||
if (callingConvention != null && callingConvention.equals("__stdcall")) {
|
||||
|
@ -377,26 +395,27 @@ public class FunctionDumper {
|
|||
// Default to cdecl for most cases
|
||||
stubFunction = "gh_stub_impl_cdecl";
|
||||
}
|
||||
|
||||
|
||||
// Generate parameter list for the call
|
||||
StringBuilder paramList = new StringBuilder();
|
||||
var params = externalFunction.getParameters();
|
||||
for (int i = 0; i < params.length; i++) {
|
||||
if (i > 0) paramList.append(", ");
|
||||
if (i > 0)
|
||||
paramList.append(", ");
|
||||
paramList.append(params[i].getName());
|
||||
}
|
||||
|
||||
|
||||
// Generate the stub call
|
||||
if (returnType.equals("void")) {
|
||||
writer2.println(" " + stubFunction + "<void>((void*)0x" +
|
||||
externalFunction.getEntryPoint().toString().replace("0x", "") +
|
||||
(paramList.length() > 0 ? ", " + paramList.toString() : "") + ");");
|
||||
writer2.println(" " + stubFunction + "<void>((void*)0x" +
|
||||
externalFunction.getEntryPoint().toString().replace("0x", "") +
|
||||
(paramList.length() > 0 ? ", " + paramList.toString() : "") + ");");
|
||||
} else {
|
||||
writer2.println(" return " + stubFunction + "<" + returnType + ">((void*)0x" +
|
||||
externalFunction.getEntryPoint().toString().replace("0x", "") +
|
||||
(paramList.length() > 0 ? ", " + paramList.toString() : "") + ");");
|
||||
writer2.println(" return " + stubFunction + "<" + returnType + ">((void*)0x" +
|
||||
externalFunction.getEntryPoint().toString().replace("0x", "") +
|
||||
(paramList.length() > 0 ? ", " + paramList.toString() : "") + ");");
|
||||
}
|
||||
|
||||
|
||||
writer2.println("}");
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,10 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static String sanitizeIdentifier(String name) {
|
||||
return name.replaceAll("[^a-zA-Z0-9_]", "_");
|
||||
String r = name;
|
||||
r = r.replaceAll("\\?", "UNK");
|
||||
r = r.replaceAll("[^a-zA-Z0-9_]", "_");
|
||||
return r;
|
||||
}
|
||||
|
||||
public static HashSet<String> loadSimpleBlacklist(String path) {
|
||||
|
|
Loading…
Reference in New Issue