Skip to content

Commit

Permalink
fix dolphin 2412 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Dec 13, 2024
1 parent 068b0fa commit eb79117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions includes/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <string_view>
#include <optional>
#include <subauth.h>
#include "safetyhook.hpp"

class CallbackHandler
Expand Down
11 changes: 6 additions & 5 deletions includes/dolphin/dolphin.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Dolphin
const auto next_mov = utility::scan_mnemonic(*next_fn_call2, 100, "MOV");
if (next_mov)
{
if (injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 17 || injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 18)
if (injector::ReadMemory<uint8_t>(*next_mov + 1, true) == 1 || injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 17 || injector::ReadMemory<uint32_t>(*next_mov + 1, true) == 18)
{
_SetIsThrottlerTempDisabled = (void(__fastcall*)(bool disable))(injector::GetBranchDestination(*next_fn_call2).as_int());
return _SetIsThrottlerTempDisabled(disable);
Expand Down Expand Up @@ -86,13 +86,14 @@ class Dolphin
const auto candidate_string = utility::scan_string(current_module, "Clear Cache");
if (candidate_string)
{
auto candidate_stringref = utility::scan_displacement_reference(current_module, *candidate_string);
if (candidate_stringref)
auto candidate_stringref = utility::scan_displacement_references(current_module, *candidate_string);
if (!candidate_stringref.empty())
{
*candidate_stringref -= 4;
auto ref = candidate_stringref.back();
ref -= 4;
for (size_t i = 0; i < 100; ++i)
{
const auto disp = utility::resolve_displacement(*candidate_stringref - i);
const auto disp = utility::resolve_displacement(ref - i);
if (disp)
{
_MenuBarClearCache = (void(__fastcall*)())*disp;
Expand Down

0 comments on commit eb79117

Please sign in to comment.