Fix function pointer types in globals
This commit is contained in:
parent
8c53aa61be
commit
010e3825da
|
@ -22,6 +22,8 @@ import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.data.AbstractStringDataType;
|
import ghidra.program.model.data.AbstractStringDataType;
|
||||||
import ghidra.program.model.data.Array;
|
import ghidra.program.model.data.Array;
|
||||||
import ghidra.program.model.data.DataType;
|
import ghidra.program.model.data.DataType;
|
||||||
|
import ghidra.program.model.data.FunctionDefinition;
|
||||||
|
import ghidra.program.model.data.Pointer;
|
||||||
import ghidra.program.model.data.PointerDataType;
|
import ghidra.program.model.data.PointerDataType;
|
||||||
import ghidra.program.model.listing.Data;
|
import ghidra.program.model.listing.Data;
|
||||||
import ghidra.program.model.pcode.HighSymbol;
|
import ghidra.program.model.pcode.HighSymbol;
|
||||||
|
@ -106,17 +108,17 @@ public class GlobalDumper {
|
||||||
// Load globals directly from database
|
// Load globals directly from database
|
||||||
List<FunctionDatabase.GlobalEntry> dbGlobals = functionDatabase.loadAllGlobals();
|
List<FunctionDatabase.GlobalEntry> dbGlobals = functionDatabase.loadAllGlobals();
|
||||||
List<GlobalRec> globals = new ArrayList<>();
|
List<GlobalRec> globals = new ArrayList<>();
|
||||||
|
|
||||||
// Convert database entries to GlobalRec objects
|
// Convert database entries to GlobalRec objects
|
||||||
for (FunctionDatabase.GlobalEntry entry : dbGlobals) {
|
for (FunctionDatabase.GlobalEntry entry : dbGlobals) {
|
||||||
DataType type = null;
|
DataType type = null;
|
||||||
|
|
||||||
// Try to get from existing data at address
|
// Try to get from existing data at address
|
||||||
Data data = script.getDataAt(entry.address);
|
Data data = script.getDataAt(entry.address);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
type = data.getDataType();
|
type = data.getDataType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
script.println("WARNING: Could not determine type for global: " + entry.name + " at " + entry.address);
|
script.println("WARNING: Could not determine type for global: " + entry.name + " at " + entry.address);
|
||||||
// Get the dataTypeManagerService for parsing types
|
// Get the dataTypeManagerService for parsing types
|
||||||
|
@ -132,7 +134,7 @@ public class GlobalDumper {
|
||||||
if (sym != null) {
|
if (sym != null) {
|
||||||
currentName = sym.getName();
|
currentName = sym.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.add(new GlobalRec(entry.address, currentName, type));
|
globals.add(new GlobalRec(entry.address, currentName, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,10 +165,17 @@ public class GlobalDumper {
|
||||||
// String type
|
// String type
|
||||||
initBlk += "\"" + escapeCString(readCString(addr, 2048)) + "\"";
|
initBlk += "\"" + escapeCString(readCString(addr, 2048)) + "\"";
|
||||||
fullyDefinedType = true;
|
fullyDefinedType = true;
|
||||||
} else if (dt instanceof PointerDataType) {
|
} else if (dt instanceof Pointer) {
|
||||||
PointerDataType pdt = (PointerDataType) dt;
|
DataType baseType = ((Pointer) dt).getDataType();
|
||||||
DataType baseType = pdt.getDataType();
|
if (baseType == null) {
|
||||||
dataType = baseType.getDisplayName() + "*";
|
script.println("WARNING: Missing base type for pointer: " + name + " at " + addr);
|
||||||
|
dataType = "pointer";
|
||||||
|
} else if (baseType instanceof FunctionDefinition) {
|
||||||
|
script.println("Value is a function type " + name + " at " + addr);
|
||||||
|
dataType = ((FunctionDefinition) baseType).getDisplayName();
|
||||||
|
} else {
|
||||||
|
dataType = baseType.getDisplayName() + "*";
|
||||||
|
}
|
||||||
initBlk += "(" + dataType + ")&GH_MEM(0x" + addr + ")";
|
initBlk += "(" + dataType + ")&GH_MEM(0x" + addr + ")";
|
||||||
fullyDefinedType = true;
|
fullyDefinedType = true;
|
||||||
}
|
}
|
||||||
|
@ -230,15 +239,16 @@ public class GlobalDumper {
|
||||||
}
|
}
|
||||||
// script.println("Global: " + addr + " - " + sym.getName() + " - " +
|
// script.println("Global: " + addr + " - " + sym.getName() + " - " +
|
||||||
// dt.getDisplayName());
|
// dt.getDisplayName());
|
||||||
|
|
||||||
// Add directly to database instead of storing in memory
|
// Add directly to database instead of storing in memory
|
||||||
functionDatabase.addGlobal(addr, sym.getName());
|
functionDatabase.addGlobal(addr, sym.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sanitizeGlobalSymbols() throws Exception {
|
public void sanitizeGlobalSymbols() throws Exception {
|
||||||
// Load globals from database, sanitize symbol names, and update both Ghidra symbols and database
|
// Load globals from database, sanitize symbol names, and update both Ghidra
|
||||||
|
// symbols and database
|
||||||
List<FunctionDatabase.GlobalEntry> dbGlobals = functionDatabase.loadAllGlobals();
|
List<FunctionDatabase.GlobalEntry> dbGlobals = functionDatabase.loadAllGlobals();
|
||||||
|
|
||||||
for (FunctionDatabase.GlobalEntry entry : dbGlobals) {
|
for (FunctionDatabase.GlobalEntry entry : dbGlobals) {
|
||||||
String sanitizedName = Utils.sanitizeIdentifier(entry.name);
|
String sanitizedName = Utils.sanitizeIdentifier(entry.name);
|
||||||
if (!sanitizedName.equals(entry.name)) {
|
if (!sanitizedName.equals(entry.name)) {
|
||||||
|
@ -259,4 +269,3 @@ public class GlobalDumper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
undefined FUN_00447130(void); // 00447130 // FUN_00447130 // cdecl
|
undefined FUN_00447130(void); // 00447130 // FUN_00447130 // cdecl
|
||||||
void doGraphics(byte param_1); // 00447460 // doGraphics // stdcall
|
void doGraphics(byte param_1); // 00447460 // doGraphics // stdcall
|
||||||
undefined UNKr3_renderViewport(undefined4 viewportIdx); // 00447200 // ?r3_renderViewport // cdecl
|
bool UNKr3_renderViewport(byte viewportIdx); // 00447200 // ?r3_renderViewport // stdcall
|
||||||
undefined FUN_0046fec0(void); // 0046fec0 // FUN_0046fec0 // cdecl
|
undefined FUN_0046fec0(void); // 0046fec0 // FUN_0046fec0 // cdecl
|
||||||
int get_one(void); // 0046f2c0 // get_one // cdecl
|
int get_one(void); // 0046f2c0 // get_one // cdecl
|
||||||
undefined FUN_00451530(undefined4 param_1); // 00451530 // FUN_00451530 // cdecl
|
undefined FUN_00451530(undefined4 param_1); // 00451530 // FUN_00451530 // cdecl
|
||||||
|
@ -22,7 +22,6 @@ void __cdecl r3_levelDisplayFn(byte param)
|
||||||
int iVar1;
|
int iVar1;
|
||||||
int *piVar2;
|
int *piVar2;
|
||||||
char cVar3;
|
char cVar3;
|
||||||
undefined3 in_stack_00000005;
|
|
||||||
|
|
||||||
FUN_00447130();
|
FUN_00447130();
|
||||||
WaitForSingleObject(g_stEngineStructure.drawSemaphore,0xffffffff);
|
WaitForSingleObject(g_stEngineStructure.drawSemaphore,0xffffffff);
|
||||||
|
@ -35,19 +34,19 @@ void __cdecl r3_levelDisplayFn(byte param)
|
||||||
g_stEngineStructure.stEngineTimer.ulUsefulDeltaTime);
|
g_stEngineStructure.stEngineTimer.ulUsefulDeltaTime);
|
||||||
FUN_00451530(param);
|
FUN_00451530(param);
|
||||||
DAT_0063be24 = 1;
|
DAT_0063be24 = 1;
|
||||||
UNKr3_renderViewport(_param);
|
UNKr3_renderViewport(param);
|
||||||
doGraphics(param);
|
doGraphics(param);
|
||||||
if (DAT_005d2b18 != 0) {
|
if (DAT_005d2b18 != 0) {
|
||||||
if (param == 0) {
|
if (param == 0) {
|
||||||
_param = 0;
|
param = 0;
|
||||||
for (piVar2 = (int *)g_stEngineStructure + Field<1500, 4>(); piVar2 != (int *)0x0;
|
for (piVar2 = (int *)(g_stEngineStructure + Field<1500, 4>()); piVar2 != (int *)0x0;
|
||||||
piVar2 = (int *)piVar2[1]) {
|
piVar2 = (int *)piVar2[1]) {
|
||||||
iVar1 = *(int *)(*(int *)(*piVar2 + 4) + 0x10);
|
iVar1 = *(int *)(*(int *)(*piVar2 + 4) + 0x10);
|
||||||
cVar3 = FUN_0045fc70(*(undefined4 *)(iVar1 + 4));
|
cVar3 = FUN_0045fc70(*(undefined4 *)(iVar1 + 4));
|
||||||
if (cVar3 != '\0') {
|
if (cVar3 != '\0') {
|
||||||
_param = _param + 1;
|
param = param + 1;
|
||||||
}
|
}
|
||||||
if (_param == DAT_005d2b18) {
|
if (param == (uint32_t&)DAT_005d2b18) {
|
||||||
FUN_0045fc70(*(undefined4 *)(iVar1 + 4));
|
FUN_0045fc70(*(undefined4 *)(iVar1 + 4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ undefined FUN_00445440(void); // 00445440 // FUN_00445440 // cdecl
|
||||||
undefined SND_fn_vResumeSound(void); // 0040a1e0 // SND_fn_vResumeSound // cdecl
|
undefined SND_fn_vResumeSound(void); // 0040a1e0 // SND_fn_vResumeSound // cdecl
|
||||||
undefined IPT_fn_vActivateAllEntryElements(void); // 00505490 // IPT_fn_vActivateAllEntryElements // cdecl
|
undefined IPT_fn_vActivateAllEntryElements(void); // 00505490 // IPT_fn_vActivateAllEntryElements // cdecl
|
||||||
undefined r3_windowLockCursor(void); // 00401320 // r3_windowLockCursor // cdecl
|
undefined r3_windowLockCursor(void); // 00401320 // r3_windowLockCursor // cdecl
|
||||||
undefined FUN_00402470(undefined4 param_1); // 00402470 // FUN_00402470 // cdecl
|
undefined FUN_00402470(HWND param_1); // 00402470 // FUN_00402470 // cdecl
|
||||||
undefined gfx_init2(void); // 00470be0 // gfx_init2 // cdecl
|
undefined gfx_init2(void); // 00470be0 // gfx_init2 // cdecl
|
||||||
undefined FUN_004725a0(void); // 004725a0 // FUN_004725a0 // cdecl
|
undefined FUN_004725a0(void); // 004725a0 // FUN_004725a0 // cdecl
|
||||||
undefined FUN_0051a900(short hGLDDevice); // 0051a900 // FUN_0051a900 // cdecl
|
undefined FUN_0051a900(short hGLDDevice); // 0051a900 // FUN_0051a900 // cdecl
|
||||||
|
@ -52,11 +52,11 @@ undefined4 __stdcall r3_restore(undefined4 param_1)
|
||||||
SetWindowTextA(g_gameHWND,g_windowTitleRestoring);
|
SetWindowTextA(g_gameHWND,g_windowTitleRestoring);
|
||||||
UpdateWindow(hWnd);
|
UpdateWindow(hWnd);
|
||||||
SetForegroundWindow(hWnd);
|
SetForegroundWindow(hWnd);
|
||||||
if (p_fn_vDisplayAll == r3_noop) {
|
if (p_fn_vDisplayAll == (void*)&r3_noop) {
|
||||||
/* Set window callback? */
|
/* Set window callback? */
|
||||||
p_fn_vDisplayAll = level_displayFn;
|
p_fn_vDisplayAll = &r3_levelDisplayFn;
|
||||||
}
|
}
|
||||||
if ((code *)PTR_r3_processInput1_005bdb1c == r3_noop) {
|
if (PTR_r3_processInput1_005bdb1c == (void*)&r3_noop) {
|
||||||
PTR_r3_processInput1_005bdb1c = r3_processInput1;
|
PTR_r3_processInput1_005bdb1c = r3_processInput1;
|
||||||
IPT_fn_vActivateAllEntryElements();
|
IPT_fn_vActivateAllEntryElements();
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,8 @@ undefined1& g_errModDInput= (undefined1&) GH_MEM(0x005bd29c);
|
||||||
undefined4& DAT_005bd454= (undefined4&) GH_MEM(0x005bd454);
|
undefined4& DAT_005bd454= (undefined4&) GH_MEM(0x005bd454);
|
||||||
const char* s__jc_z_d__s_005bd460 = "\\jc\\z%d:%s"; // 005bd460
|
const char* s__jc_z_d__s_005bd460 = "\\jc\\z%d:%s"; // 005bd460
|
||||||
undefined1& g_errModMmg= (undefined1&) GH_MEM(0x005bd58c);
|
undefined1& g_errModMmg= (undefined1&) GH_MEM(0x005bd58c);
|
||||||
pointer& PTR_r3_processInput1_005bdb1c= (pointer&) GH_MEM(0x005bdb1c);
|
FnProcessInput PTR_r3_processInput1_005bdb1c = (FnProcessInput)&GH_MEM(0x005bdb1c); // 005bdb1c
|
||||||
level_displayFn *& p_fn_vDisplayAll= (level_displayFn *&) GH_MEM(0x005bdb24);
|
FnDisplay p_fn_vDisplayAll = (FnDisplay)&GH_MEM(0x005bdb24); // 005bdb24
|
||||||
const char* s_R3_DVD_005bdfd8 = "R3_DVD"; // 005bdfd8
|
const char* s_R3_DVD_005bdfd8 = "R3_DVD"; // 005bdfd8
|
||||||
const char* s_R3_DVD_005be0ec = "R3_DVD"; // 005be0ec
|
const char* s_R3_DVD_005be0ec = "R3_DVD"; // 005be0ec
|
||||||
const char* s__s_DVD_missing_005be0f4 = "%s DVD missing "; // 005be0f4
|
const char* s__s_DVD_missing_005be0f4 = "%s DVD missing "; // 005be0f4
|
||||||
|
@ -73,7 +73,7 @@ const char* s_Die__s_DVDROM_kann_nicht_gelesen_005be130 = "Die %s DVDROM kann ni
|
||||||
const char* s_Impossibile_trovare_il_DVD____s_005be198 = "Impossibile trovare il DVD : %s"; // 005be198
|
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_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_Impossible_de_trouver_le_DVD_____005be238 = "Impossible de trouver le DVD : %s"; // 005be238
|
||||||
pointer& s_Yes= (pointer&) GH_MEM(0x005be304);
|
pointer s_Yes = (pointer)&GH_MEM(0x005be304); // 005be304
|
||||||
const char* s_SingleProcessor_005be308 = "SingleProcessor"; // 005be308
|
const char* s_SingleProcessor_005be308 = "SingleProcessor"; // 005be308
|
||||||
const char* lpDefault_005be318 = "No"; // 005be318
|
const char* lpDefault_005be318 = "No"; // 005be318
|
||||||
const char* s_StartDirectory_005be31c = "StartDirectory"; // 005be31c
|
const char* s_StartDirectory_005be31c = "StartDirectory"; // 005be31c
|
||||||
|
@ -111,7 +111,7 @@ dword& DWORD_005cf974= (dword&) GH_MEM(0x005cf974);
|
||||||
dword& DWORD_005cf978= (dword&) GH_MEM(0x005cf978);
|
dword& DWORD_005cf978= (dword&) GH_MEM(0x005cf978);
|
||||||
dword& DWORD_005cf97c= (dword&) GH_MEM(0x005cf97c);
|
dword& DWORD_005cf97c= (dword&) GH_MEM(0x005cf97c);
|
||||||
dword& DWORD_005cf980= (dword&) GH_MEM(0x005cf980);
|
dword& DWORD_005cf980= (dword&) GH_MEM(0x005cf980);
|
||||||
char *& PTR_005cf9b4= (char *&) GH_MEM(0x005cf9b4);
|
char* PTR_005cf9b4 = (char*)&GH_MEM(0x005cf9b4); // 005cf9b4
|
||||||
GameStructure& g_currentBinkMovie= (GameStructure&) GH_MEM(0x005d2660);
|
GameStructure& g_currentBinkMovie= (GameStructure&) GH_MEM(0x005d2660);
|
||||||
char(&s_volumeNameBuffer)[128] = reinterpret_cast<char(&)[128]>(GH_MEM(0x005d27b0));
|
char(&s_volumeNameBuffer)[128] = reinterpret_cast<char(&)[128]>(GH_MEM(0x005d27b0));
|
||||||
r3_main_data& r3_main_data_005d28b6= (r3_main_data&) GH_MEM(0x005d28b6);
|
r3_main_data& r3_main_data_005d28b6= (r3_main_data&) GH_MEM(0x005d28b6);
|
||||||
|
@ -135,7 +135,7 @@ HWND& g_gameHWND= (HWND&) GH_MEM(0x0077d4c4);
|
||||||
HANDLE& g_mainThreadHandle= (HANDLE&) GH_MEM(0x0077d4c8);
|
HANDLE& g_mainThreadHandle= (HANDLE&) GH_MEM(0x0077d4c8);
|
||||||
char(&g_appCmdLine)[256] = reinterpret_cast<char(&)[256]>(GH_MEM(0x0077d4e0));
|
char(&g_appCmdLine)[256] = reinterpret_cast<char(&)[256]>(GH_MEM(0x0077d4e0));
|
||||||
char(&s_wndStrRestoring)[256] = reinterpret_cast<char(&)[256]>(GH_MEM(0x0077d5e0));
|
char(&s_wndStrRestoring)[256] = reinterpret_cast<char(&)[256]>(GH_MEM(0x0077d5e0));
|
||||||
char *& g_crt_cmdLine= (char *&) GH_MEM(0x0077ea84);
|
char* g_crt_cmdLine = (char*)&GH_MEM(0x0077ea84); // 0077ea84
|
||||||
char(&s_quitting1)[64] = reinterpret_cast<char(&)[64]>(GH_MEM(0x007825c0));
|
char(&s_quitting1)[64] = reinterpret_cast<char(&)[64]>(GH_MEM(0x007825c0));
|
||||||
char(&s_wndStrQuiting)[56] = reinterpret_cast<char(&)[56]>(GH_MEM(0x00782600));
|
char(&s_wndStrQuiting)[56] = reinterpret_cast<char(&)[56]>(GH_MEM(0x00782600));
|
||||||
GAM_EngineStructure& g_stEngineStructure= (GAM_EngineStructure&) GH_MEM(0x007d7dc0);
|
GAM_EngineStructure& g_stEngineStructure= (GAM_EngineStructure&) GH_MEM(0x007d7dc0);
|
||||||
|
|
|
@ -69,8 +69,8 @@ extern undefined1& g_errModDInput; // 005bd29c
|
||||||
extern undefined4& DAT_005bd454; // 005bd454
|
extern undefined4& DAT_005bd454; // 005bd454
|
||||||
extern const char* s__jc_z_d__s_005bd460; // 005bd460
|
extern const char* s__jc_z_d__s_005bd460; // 005bd460
|
||||||
extern undefined1& g_errModMmg; // 005bd58c
|
extern undefined1& g_errModMmg; // 005bd58c
|
||||||
extern pointer& PTR_r3_processInput1_005bdb1c; // 005bdb1c
|
extern FnProcessInput PTR_r3_processInput1_005bdb1c; // 005bdb1c
|
||||||
extern level_displayFn *& p_fn_vDisplayAll; // 005bdb24
|
extern FnDisplay p_fn_vDisplayAll; // 005bdb24
|
||||||
extern const char* s_R3_DVD_005bdfd8; // 005bdfd8
|
extern const char* s_R3_DVD_005bdfd8; // 005bdfd8
|
||||||
extern const char* s_R3_DVD_005be0ec; // 005be0ec
|
extern const char* s_R3_DVD_005be0ec; // 005be0ec
|
||||||
extern const char* s__s_DVD_missing_005be0f4; // 005be0f4
|
extern const char* s__s_DVD_missing_005be0f4; // 005be0f4
|
||||||
|
@ -78,7 +78,7 @@ 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_Impossibile_trovare_il_DVD____s_005be198; // 005be198
|
||||||
extern const char* s_DVD_s_no_v_lido_005be1ec; // 005be1ec
|
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_Impossible_de_trouver_le_DVD_____005be238; // 005be238
|
||||||
extern pointer& s_Yes; // 005be304
|
extern pointer s_Yes; // 005be304
|
||||||
extern const char* s_SingleProcessor_005be308; // 005be308
|
extern const char* s_SingleProcessor_005be308; // 005be308
|
||||||
extern const char* lpDefault_005be318; // 005be318
|
extern const char* lpDefault_005be318; // 005be318
|
||||||
extern const char* s_StartDirectory_005be31c; // 005be31c
|
extern const char* s_StartDirectory_005be31c; // 005be31c
|
||||||
|
@ -116,7 +116,7 @@ extern dword& DWORD_005cf974; // 005cf974
|
||||||
extern dword& DWORD_005cf978; // 005cf978
|
extern dword& DWORD_005cf978; // 005cf978
|
||||||
extern dword& DWORD_005cf97c; // 005cf97c
|
extern dword& DWORD_005cf97c; // 005cf97c
|
||||||
extern dword& DWORD_005cf980; // 005cf980
|
extern dword& DWORD_005cf980; // 005cf980
|
||||||
extern char *& PTR_005cf9b4; // 005cf9b4
|
extern char* PTR_005cf9b4; // 005cf9b4
|
||||||
extern GameStructure& g_currentBinkMovie; // 005d2660
|
extern GameStructure& g_currentBinkMovie; // 005d2660
|
||||||
extern char(&s_volumeNameBuffer)[128]; // 005d27b0
|
extern char(&s_volumeNameBuffer)[128]; // 005d27b0
|
||||||
extern r3_main_data& r3_main_data_005d28b6; // 005d28b6
|
extern r3_main_data& r3_main_data_005d28b6; // 005d28b6
|
||||||
|
@ -140,7 +140,7 @@ extern HWND& g_gameHWND; // 0077d4c4
|
||||||
extern HANDLE& g_mainThreadHandle; // 0077d4c8
|
extern HANDLE& g_mainThreadHandle; // 0077d4c8
|
||||||
extern char(&g_appCmdLine)[256]; // 0077d4e0
|
extern char(&g_appCmdLine)[256]; // 0077d4e0
|
||||||
extern char(&s_wndStrRestoring)[256]; // 0077d5e0
|
extern char(&s_wndStrRestoring)[256]; // 0077d5e0
|
||||||
extern char *& g_crt_cmdLine; // 0077ea84
|
extern char* g_crt_cmdLine; // 0077ea84
|
||||||
extern char(&s_quitting1)[64]; // 007825c0
|
extern char(&s_quitting1)[64]; // 007825c0
|
||||||
extern char(&s_wndStrQuiting)[56]; // 00782600
|
extern char(&s_wndStrQuiting)[56]; // 00782600
|
||||||
extern GAM_EngineStructure& g_stEngineStructure; // 007d7dc0
|
extern GAM_EngineStructure& g_stEngineStructure; // 007d7dc0
|
||||||
|
|
|
@ -3987,6 +3987,7 @@ struct tdstAviHeader_ {
|
||||||
};
|
};
|
||||||
typedef struct _tdstSndBankHead tdstSndBankHead;
|
typedef struct _tdstSndBankHead tdstSndBankHead;
|
||||||
#define C_ucNeverPlay 255
|
#define C_ucNeverPlay 255
|
||||||
|
typedef undefined (*FnProcessInput)(void);
|
||||||
#define IPT_C_Duplicate 0
|
#define IPT_C_Duplicate 0
|
||||||
#define C_uwAllocSize 4
|
#define C_uwAllocSize 4
|
||||||
#define C_ulOverflowCheckKey 3777185134
|
#define C_ulOverflowCheckKey 3777185134
|
||||||
|
@ -4890,6 +4891,7 @@ enum enum_1 {
|
||||||
eFuckedObjet=6
|
eFuckedObjet=6
|
||||||
};
|
};
|
||||||
#define C_SOUNDPAN_MEDIAN 64
|
#define C_SOUNDPAN_MEDIAN 64
|
||||||
|
typedef void (*FnDisplay)(unsigned char param1);
|
||||||
#define IPT_C_AZERTYKeyBoardType 1
|
#define IPT_C_AZERTYKeyBoardType 1
|
||||||
#define E_ucDynamic 255
|
#define E_ucDynamic 255
|
||||||
typedef struct tdstObjectsTableElement_ *tdxHandleToObjectsTableElement;
|
typedef struct tdstObjectsTableElement_ *tdxHandleToObjectsTableElement;
|
||||||
|
@ -5153,7 +5155,6 @@ struct tdstCsaList_ {
|
||||||
#define C_wTimerPaused 4
|
#define C_wTimerPaused 4
|
||||||
struct _tdstRangeSplitListDisk {
|
struct _tdstRangeSplitListDisk {
|
||||||
};
|
};
|
||||||
typedef undefined (*level_displayFn)(void);
|
|
||||||
#define __STDC__ 1
|
#define __STDC__ 1
|
||||||
#define C_SNDREAL_0 0
|
#define C_SNDREAL_0 0
|
||||||
#define C_SNDREAL_1 65536
|
#define C_SNDREAL_1 65536
|
||||||
|
|
|
@ -59,9 +59,16 @@ template <size_t Size> struct FieldBinder {
|
||||||
return *reinterpret_cast<ExpectedType *>(dst) =
|
return *reinterpret_cast<ExpectedType *>(dst) =
|
||||||
*reinterpret_cast<ExpectedType *>(other.dst);
|
*reinterpret_cast<ExpectedType *>(other.dst);
|
||||||
}
|
}
|
||||||
template <typename T = ExpectedType,
|
template <typename T = ExpectedType,
|
||||||
typename = typename std::enable_if<!std::is_same<T, undefined4>::value>::type>
|
typename = typename std::enable_if<
|
||||||
operator undefined4() const { return reinterpret_cast<undefined4>(dst); }
|
!std::is_same<T, undefined4>::value>::type>
|
||||||
|
operator undefined4() const {
|
||||||
|
return reinterpret_cast<undefined4>(dst);
|
||||||
|
}
|
||||||
|
template<typename T>
|
||||||
|
operator T*() const {
|
||||||
|
return reinterpret_cast<T*>(dst);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t Offset, size_t Size>
|
template <size_t Offset, size_t Size>
|
||||||
|
@ -70,6 +77,12 @@ inline FieldBinder<Size> operator+(const void *str,
|
||||||
return FieldBinder<Size>{.dst = (uint8_t *)str + Offset};
|
return FieldBinder<Size>{.dst = (uint8_t *)str + Offset};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <size_t Offset, size_t Size, typename T>
|
||||||
|
inline FieldBinder<Size> operator+(const T& v,
|
||||||
|
Field<Offset, Size> offset) {
|
||||||
|
return FieldBinder<Size>{.dst = (uint8_t*)&v + Offset};
|
||||||
|
}
|
||||||
|
|
||||||
typedef uint32_t cc_type_t;
|
typedef uint32_t cc_type_t;
|
||||||
|
|
||||||
template <typename T0, typename T1>
|
template <typename T0, typename T1>
|
||||||
|
|
Loading…
Reference in New Issue