3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-24 06:10:12 +01:00

fix force_unlock without patch_db

This commit is contained in:
CrazyRedMachine 2024-10-04 21:34:52 +02:00
parent 4d735a3d05
commit 51c51effda

View File

@ -32,7 +32,7 @@
#include "SearchFile.h" #include "SearchFile.h"
#define PROGRAM_VERSION "2.3" #define PROGRAM_VERSION "2.4.dev"
const char *g_game_dll_fn = NULL; const char *g_game_dll_fn = NULL;
char *g_config_fn = NULL; char *g_config_fn = NULL;
@ -2567,13 +2567,13 @@ bool force_unlock_songs() {
{ {
// 0xac here is the size of music_entry. May change in the future // 0xac here is the size of music_entry. May change in the future
int64_t pattern_offset = _search(data, dllSize, "\x69\xC0\xAC\x00\x00\x00\x8B\x80", 8, 0); int64_t pattern_offset = _search(data, dllSize, "\x75\x0E\x98\x69\xC0\xAC\x00\x00\x00\x8B\x80", 11, 0);
if (pattern_offset == -1) { if (pattern_offset == -1) {
LOG("popnhax: couldn't unlock songs and charts\n"); LOG("popnhax: couldn't unlock songs and charts\n");
return false; return false;
} }
uint32_t buffer_offset = *(uint32_t*)((int64_t)data + pattern_offset + 8); uint32_t buffer_offset = *(uint32_t*)((int64_t)data + pattern_offset + 11);
buffer_offset -= 0x1c; // The difference between music_entry.mask and music_entry.fw_genre_ptr to put it at the beginning of the entry buffer_offset -= 0x1c; // The difference between music_entry.mask and music_entry.fw_genre_ptr to put it at the beginning of the entry
music_entry *entry = (music_entry*)buffer_offset; music_entry *entry = (music_entry*)buffer_offset;