WIP Recompile
This commit is contained in:
17
game_re/CMakeLists.txt
Normal file
17
game_re/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
add_executable(game_re
|
||||
main.cpp
|
||||
gh_global.cxx
|
||||
binders/gh_static_mem.cxx)
|
||||
|
||||
target_include_directories(game_re PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/binders)
|
||||
|
||||
file(GLOB GH_AUTO_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/gh_auto/*.cxx)
|
||||
file(GLOB GH_FIX_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/gh_fix/*.cxx)
|
||||
|
||||
target_sources(game_re PRIVATE
|
||||
)
|
||||
|
||||
target_sources(game_re PRIVATE
|
||||
${GH_AUTO_SOURCES}
|
||||
${GH_FIX_SOURCES}
|
||||
)
|
8
game_re/binders/gh_auto_shared.h
Normal file
8
game_re/binders/gh_auto_shared.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef DF40ED2B_5659_43AA_8A22_499A89C4BD62
|
||||
#define DF40ED2B_5659_43AA_8A22_499A89C4BD62
|
||||
|
||||
#include "gh_types.h"
|
||||
#include "gh_static_mem.h"
|
||||
#include "../gh_global.h"
|
||||
|
||||
#endif /* DF40ED2B_5659_43AA_8A22_499A89C4BD62 */
|
3
game_re/binders/gh_static_mem.cxx
Normal file
3
game_re/binders/gh_static_mem.cxx
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "gh_static_mem.h"
|
||||
|
||||
unsigned char gh_static_mem[GH_STATIC_MEM_SIZE];
|
12
game_re/binders/gh_static_mem.h
Normal file
12
game_re/binders/gh_static_mem.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef A18E3E17_2A80_4DBD_96CD_1CE0120A164E
|
||||
#define A18E3E17_2A80_4DBD_96CD_1CE0120A164E
|
||||
|
||||
#define GH_STATIC_MEM_START 0x005b6400
|
||||
#define GH_STATIC_MEM_END 0x00843fff
|
||||
#define GH_STATIC_MEM_SIZE (GH_STATIC_MEM_END - GH_STATIC_MEM_START)
|
||||
|
||||
extern unsigned char gh_static_mem[GH_STATIC_MEM_SIZE];
|
||||
|
||||
#define GH_STATIC(addr) (*(unsigned char *)(gh_static_mem + (addr - GH_STATIC_MEM_START)))
|
||||
|
||||
#endif /* A18E3E17_2A80_4DBD_96CD_1CE0120A164E */
|
20
game_re/binders/gh_types.h
Normal file
20
game_re/binders/gh_types.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef A523F6DB_0645_4DEB_8AEB_3792CB732B49
|
||||
#define A523F6DB_0645_4DEB_8AEB_3792CB732B49
|
||||
|
||||
// Header included in all decompiled files to fix some common recompilation issues
|
||||
#include <stdint.h>
|
||||
#include <Windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Fallback to int if type is not annotated
|
||||
typedef int64_t undefined;
|
||||
typedef uint32_t undefined4;
|
||||
typedef uint16_t undefined2;
|
||||
typedef unsigned char byte;
|
||||
typedef byte undefined1;
|
||||
typedef uint64_t uint;
|
||||
typedef void* pointer;
|
||||
typedef char *TerminatedCString;
|
||||
typedef char *string;
|
||||
|
||||
#endif /* A523F6DB_0645_4DEB_8AEB_3792CB732B49 */
|
202
game_re/blacklist.txt
Normal file
202
game_re/blacklist.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
0055164b // FUN_0055164b
|
||||
00404e5b // FUN_00404e5b
|
||||
00403a5a // FUN_00403a5a
|
||||
00550643 // __frnd
|
||||
00407853 // FUN_00407853
|
||||
0040924c // FUN_0040924c
|
||||
0040744a // FUN_0040744a
|
||||
0055265d // FUN_0055265d
|
||||
00551451 // FUN_00551451
|
||||
00550a57 // __startOneArgErrorHandling
|
||||
00550655 // FUN_00550655
|
||||
0040747b // FUN_0040747b
|
||||
00409c7b // FUN_00409c7b
|
||||
0054d26e // __fassign
|
||||
00404073 // crt_0
|
||||
00407672 // FUN_00407672
|
||||
00407870 // FUN_00407870
|
||||
00405270 // __aulldiv
|
||||
0040926d // FUN_0040926d
|
||||
00409e6d // FUN_00409e6d
|
||||
0054d070 // __aullshr
|
||||
00550077 // FUN_00550077
|
||||
0040981f // FUN_0040981f
|
||||
0040421d // FUN_0040421d
|
||||
00409419 // FUN_00409419
|
||||
0054c600 // ___timet_from_ft
|
||||
0040a011 // FUN_0040a011
|
||||
00552c04 // FUN_00552c04
|
||||
00407e10 // FUN_00407e10
|
||||
0040280d // FUN_0040280d
|
||||
0040880c // FUN_0040880c
|
||||
00404a0a // __abnormal_termination
|
||||
00402c08 // FUN_00402c08
|
||||
00551e13 // FUN_00551e13
|
||||
00551810 // FUN_00551810
|
||||
00551e16 // FUN_00551e16
|
||||
00403a02 // FUN_00403a02
|
||||
00407e3f // FUN_00407e3f
|
||||
0040703f // FUN_0040703f
|
||||
0055262f // FUN_0055262f
|
||||
00404039 // FUN_00404039
|
||||
00407439 // FUN_00407439
|
||||
00408837 // crt_1
|
||||
00404a36 // FUN_00404a36
|
||||
0054be20 // _strncat
|
||||
00402c31 // enterAllocCriticalSection
|
||||
0054d424 // FUN_0054d424
|
||||
0054ee3b // __ctrandisp2
|
||||
00404a2d // __NLG_Notify1
|
||||
00407628 // FUN_00407628
|
||||
0055183d // FUN_0055183d
|
||||
00406827 // FUN_00406827
|
||||
0054f030 // __trandisp1
|
||||
00409c23 // FUN_00409c23
|
||||
00405a21 // leaveAllocCriticalSection
|
||||
0054d4cb // FUN_0054d4cb
|
||||
00403ade // FUN_00403ade
|
||||
00404cce // __nh_malloc
|
||||
00404ece // FUN_00404ece
|
||||
004076ce // FUN_004076ce
|
||||
005506d8 // FUN_005506d8
|
||||
004040cb // crt_main1?
|
||||
00407ec8 // FUN_00407ec8
|
||||
004028c4 // c_call_static_init_fns
|
||||
004026c0 // _strncpy
|
||||
00402cc0 // trimCharFromStringEnd?
|
||||
00403efb // crt_postMainExcept
|
||||
00404cfa // FUN_00404cfa
|
||||
004096f5 // FUN_004096f5
|
||||
00407ef0 // _memset
|
||||
00550ae5 // __fload_withFB
|
||||
004068e9 // FUN_004068e9
|
||||
005514f0 // FUN_005514f0
|
||||
00405ee2 // malloc?
|
||||
00409ce2 // FUN_00409ce2
|
||||
004028e0 // FUN_004028e0
|
||||
004052e0 // __aullrem
|
||||
0055268a // FUN_0055268a
|
||||
0040709e // FUN_0040709e
|
||||
0054ee8a // FUN_0054ee8a
|
||||
0040629c // FUN_0040629c
|
||||
00409a9c // FUN_00409a9c
|
||||
0054ee83 // FUN_0054ee83
|
||||
00551286 // FUN_00551286
|
||||
00402c92 // FUN_00402c92
|
||||
00402a90 // _strrchr
|
||||
00405490 // FUN_00405490
|
||||
0055149a // FUN_0055149a
|
||||
0040668d // FUN_0040668d
|
||||
0054f097 // __trandisp2
|
||||
00403a81 // FUN_00403a81
|
||||
0051e090 // RtlUnwind
|
||||
004046bf // crt_mainTls?
|
||||
00404cbc // _malloc
|
||||
004028bb // FUN_004028bb
|
||||
00408abb // FUN_00408abb
|
||||
0054d2ac // FUN_0054d2ac
|
||||
004028b2 // FUN_004028b2
|
||||
00406cb1 // FUN_00406cb1
|
||||
00405aaa // FUN_00405aaa
|
||||
004076a5 // FUN_004076a5
|
||||
005518b4 // FUN_005518b4
|
||||
004096a0 // __allmul
|
||||
00550b4b // __math_exit
|
||||
00551149 // FUN_00551149
|
||||
00406d5a // FUN_00406d5a
|
||||
00409559 // FUN_00409559
|
||||
00551d43 // FUN_00551d43
|
||||
0054af41 // crt_set_cfltcvt_etc
|
||||
00407f50 // FUN_00407f50
|
||||
0054d55e // __cfltcvt
|
||||
00405b46 // FUN_00405b46
|
||||
00552751 // FUN_00552751
|
||||
00406940 // FUN_00406940
|
||||
0054b354 // __ftol
|
||||
00406f7e // FUN_00406f7e
|
||||
00409772 // __mbsnbicoll
|
||||
00404b69 // FUN_00404b69
|
||||
0055157c // FUN_0055157c
|
||||
00404d61 // FUN_00404d61
|
||||
00403b61 // __freebuf
|
||||
00404960 // __global_unwind2
|
||||
0054b90e // operator_new
|
||||
0054d30d // FUN_0054d30d
|
||||
00404b15 // __seh_longjmp_unwind@4
|
||||
00404713 // FUN_00404713
|
||||
00551910 // FUN_00551910
|
||||
00404503 // crt_initConsole
|
||||
00404902 // crt_createProgramHeap
|
||||
00408f01 // FUN_00408f01
|
||||
0055032a // FUN_0055032a
|
||||
0054cf20 // _longjmp
|
||||
00404f33 // FUN_00404f33
|
||||
00404b30 // FUN_00404b30
|
||||
00405130 // _strlen
|
||||
00408b30 // _strcmp
|
||||
00404726 // initStaticUnk0
|
||||
005505c9 // FUN_005505c9
|
||||
0054d3cf // FUN_0054d3cf
|
||||
005517cd // FUN_005517cd
|
||||
00406dd6 // getFileTruncateStaticUnk1
|
||||
0051e7c7 // `vector_constructor_iterator'
|
||||
00551bc0 // __allshl
|
||||
0054b3c0 // __alldiv
|
||||
0054edc0 // __cintrindisp2
|
||||
004067d1 // FUN_004067d1
|
||||
004043d1 // crt_setupEnv
|
||||
00407dd0 // _strncmp
|
||||
00406dcd // getFileTruncateStaticUnk0
|
||||
005507d9 // FUN_005507d9
|
||||
004095c8 // FUN_004095c8
|
||||
00408fc5 // FUN_00408fc5
|
||||
005525d1 // ___add_12
|
||||
00404dc0 // FUN_00404dc0
|
||||
00406ffd // FUN_00406ffd
|
||||
004027fc // __exit
|
||||
004029fb // __fclose_lk
|
||||
0054efee // __fload
|
||||
005517e3 // FUN_005517e3
|
||||
005529e4 // FUN_005529e4
|
||||
004089ef // FUN_004089ef
|
||||
004027eb // crt_postMain0
|
||||
004061eb // FUN_004061eb
|
||||
0054edfe // __cintrindisp1
|
||||
004085e8 // FUN_004085e8
|
||||
00402be4 // crt_exitWithFailure
|
||||
0054ddf0 // __CallSettingFrame@12
|
||||
0054b388 // _rand
|
||||
00403998 // somethingWithEnvVar
|
||||
00408f97 // FUN_00408f97
|
||||
00406397 // FUN_00406397
|
||||
00405b8e // FUN_00405b8e
|
||||
00406b8d // FUN_00406b8d
|
||||
0040478d // FUN_0040478d
|
||||
00550799 // FUN_00550799
|
||||
00405988 // allocateArray?
|
||||
0054cf9c // __setjmp3
|
||||
00406985 // FUN_00406985
|
||||
00404184 // crt_main2?
|
||||
00551597 // FUN_00551597
|
||||
00408980 // FUN_00408980
|
||||
00402bbf // __amsg_exit
|
||||
004027be // c_static_init
|
||||
00407bbc // FUN_00407bbc
|
||||
00409fbb // FUN_00409fbb
|
||||
0054d5af // FUN_0054d5af
|
||||
00403bba // FUN_00403bba
|
||||
004047ba // FUN_004047ba
|
||||
0054d1ae // crt_unk?
|
||||
00405bb9 // FUN_00405bb9
|
||||
005515a3 // FUN_005515a3
|
||||
005507a7 // FUN_005507a7
|
||||
004097b1 // FUN_004097b1
|
||||
004053b0 // FUN_004053b0
|
||||
0054efbb // __ctrandisp1
|
||||
005515be // FUN_005515be
|
||||
00407ba5 // FUN_00407ba5
|
||||
005525b0 // FUN_005525b0
|
||||
005507b6 // FUN_005507b6
|
||||
004049a2 // __local_unwind2
|
||||
005517b7 // FUN_005517b7
|
||||
004053a0 // FUN_004053a0
|
0
game_re/functions.txt
Normal file
0
game_re/functions.txt
Normal file
2
game_re/gh_global.cxx
Normal file
2
game_re/gh_global.cxx
Normal file
@@ -0,0 +1,2 @@
|
||||
// AUTO-GENERATED FILE
|
||||
#include <gh_auto_shared.h>
|
2
game_re/gh_global.h
Normal file
2
game_re/gh_global.h
Normal file
@@ -0,0 +1,2 @@
|
||||
// AUTO-GENERATED FILE
|
||||
#include <gh_auto_shared.h>
|
8
game_re/main.cpp
Normal file
8
game_re/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <windows.h>
|
||||
|
||||
int r3_main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR *cmdline,
|
||||
int showCmd);
|
||||
int main() {
|
||||
r3_main(GetModuleHandle(NULL), NULL, NULL, SW_SHOW);
|
||||
return 0;
|
||||
}
|
12
game_re/readme.md
Normal file
12
game_re/readme.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Source structure
|
||||
|
||||
Since many source files are automatically generated from ghidra, the file names correspond to the function names inside ghidra, one source file per function.
|
||||
For each required function in the program the file will be either in gh_auto or gh_fix
|
||||
|
||||
## gh_auto
|
||||
|
||||
Contains the decompiled ghidra source files
|
||||
|
||||
## gh_fix
|
||||
|
||||
Contains decompiled source functions, manually fixed up
|
Reference in New Issue
Block a user