mirror of
https://github.com/CrazyRedMachine/popnhax.git
synced 2025-01-23 15:02:10 +01:00
enhance custom popkuns handling for record mode
This commit is contained in:
parent
0ecb8a8d58
commit
f4f97e0b24
@ -4494,7 +4494,7 @@ static bool version_check() {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *popkun_change = "system27/gmcmh.ifs";
|
||||
const char *popkun_change = "gmcmh.ifs";
|
||||
void (*gm_ifs_load)();
|
||||
void loadtexhook() {
|
||||
if(p_record) {
|
||||
@ -6569,22 +6569,31 @@ static bool patch_record_mode(bool quickretire)
|
||||
}
|
||||
{
|
||||
// recmode pop-kun change
|
||||
int64_t pattern_offset = search(data, dllSize,
|
||||
"\x5E\x83\xC4\x10\xC3\x51\xE8", 7, 0);
|
||||
if (pattern_offset == -1) {
|
||||
LOG("popnhax: record: ifs load address not found.\n");
|
||||
return false;
|
||||
// Check if custom popkuns are present
|
||||
if (access("data_mods\\_popnhax_assets\\tex\\gmcmh.ifs", F_OK) == 0)
|
||||
{
|
||||
LOG("popnhax: record: custom popkun assets found. Using %s\n", popkun_change);
|
||||
|
||||
int64_t pattern_offset = search(data, dllSize,
|
||||
"\x5E\x83\xC4\x10\xC3\x51\xE8", 7, 0);
|
||||
if (pattern_offset == -1) {
|
||||
LOG("popnhax: record: ifs load address not found.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64_t patch_addr = (int64_t)data + pattern_offset +13;
|
||||
|
||||
MH_CreateHook((LPVOID)(patch_addr), (LPVOID)loadtexhook,
|
||||
(void **)&gm_ifs_load);
|
||||
|
||||
#if DEBUG == 1
|
||||
LOG("popnhax: record: loadtexhook_addr is 0x%llX\n", patch_addr);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("popnhax: record: custom popkun assets not found. Using regular ones\n");
|
||||
}
|
||||
|
||||
uint64_t patch_addr = (int64_t)data + pattern_offset +13;
|
||||
|
||||
MH_CreateHook((LPVOID)(patch_addr), (LPVOID)loadtexhook,
|
||||
(void **)&gm_ifs_load);
|
||||
|
||||
#if DEBUG == 1
|
||||
LOG("popnhax: record: loadtexhook_addr is 0x%llX\n", patch_addr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if DEBUG == 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user