mirror of
https://github.com/CrazyRedMachine/popnhax.git
synced 2024-11-24 06:10:12 +01:00
fix autohispeed
This commit is contained in:
parent
8326623306
commit
21303788a7
@ -816,6 +816,7 @@ bool patch_hispeed_auto(uint8_t mode)
|
|||||||
|
|
||||||
/* set g_soflan_retry back to false when leaving options */
|
/* set g_soflan_retry back to false when leaving options */
|
||||||
{
|
{
|
||||||
|
int8_t delta = 0;
|
||||||
int64_t first_loc = _search(data, dllSize, "\x0A\x00\x00\x83\xC0\x04\xBF\x0C\x00\x00\x00\xE8", 12, 0);
|
int64_t first_loc = _search(data, dllSize, "\x0A\x00\x00\x83\xC0\x04\xBF\x0C\x00\x00\x00\xE8", 12, 0);
|
||||||
if (first_loc == -1) {
|
if (first_loc == -1) {
|
||||||
LOG("popnhax: auto hi-speed: cannot retrieve option screen loop function\n");
|
LOG("popnhax: auto hi-speed: cannot retrieve option screen loop function\n");
|
||||||
@ -824,11 +825,16 @@ bool patch_hispeed_auto(uint8_t mode)
|
|||||||
|
|
||||||
int64_t pattern_offset = _search(data, 1000, "\x33\xC9\x51\x50\x8B", 5, first_loc);
|
int64_t pattern_offset = _search(data, 1000, "\x33\xC9\x51\x50\x8B", 5, first_loc);
|
||||||
if (pattern_offset == -1) {
|
if (pattern_offset == -1) {
|
||||||
LOG("popnhax: auto hi-speed: cannot retrieve option screen leave\n");
|
pattern_offset = _search(data, 1000, "\x74\x1A\x8B\x85\x14\x0A\x00\x00\x53\x6A", 10, first_loc); // popn28
|
||||||
return false;
|
delta = 0x23;
|
||||||
|
if (pattern_offset == -1)
|
||||||
|
{
|
||||||
|
LOG("popnhax: auto hi-speed: cannot retrieve option screen leave\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t patch_addr = (int64_t)data + pattern_offset;
|
uint64_t patch_addr = (int64_t)data + pattern_offset + delta;
|
||||||
_MH_CreateHook((LPVOID)patch_addr, (LPVOID)retry_soflan_reset,
|
_MH_CreateHook((LPVOID)patch_addr, (LPVOID)retry_soflan_reset,
|
||||||
(void **)&real_leave_options);
|
(void **)&real_leave_options);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user