Skip to content

Commit

Permalink
fix score multiplier scan for some configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciremun committed Mar 15, 2024
1 parent 55523ea commit 363de4d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions freedom/features/score_multiplier.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#include "features/score_multiplier.h"

uintptr_t score_multiplier_code_start = 0;
uintptr_t score_multiplier_offset = 0;
uintptr_t score_multiplier_hook_jump_back = 0;

Hook<Detour32> ScoreMultiplierHook;

void init_score_multiplier()
{
if (score_multiplier_code_start)
if (score_multiplier_offset)
{
ScoreMultiplierHook = Hook<Detour32>(score_multiplier_code_start, (BYTE *)set_score_multiplier, 5);
ScoreMultiplierHook = Hook<Detour32>(score_multiplier_offset, (BYTE *)set_score_multiplier, 5);
if (cfg_score_multiplier_enabled)
enable_score_multiplier_hooks();
}
Expand Down
4 changes: 2 additions & 2 deletions freedom/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ static void try_find_hook_offsets()

if (score_multiplier_code_start)
{
score_multiplier_code_start += 0x2;
score_multiplier_hook_jump_back = score_multiplier_code_start + 0x5;
score_multiplier_offset = score_multiplier_code_start + 0xA;
score_multiplier_hook_jump_back = score_multiplier_offset + 0x5;
}

if (check_timewarp_code_start)
Expand Down
3 changes: 2 additions & 1 deletion freedom/ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void update_ui()
if (!unmod_hidden_found)
ImGui::EndDisabled();
ImGui::Dummy(ImVec2(.0f, 5.f));
uintptr_t score_multiplier_found = score_multiplier_code_start;
uintptr_t score_multiplier_found = score_multiplier_offset;
if (!score_multiplier_found)
ImGui::BeginDisabled();
ImGui::Text("Score Multiplier");
Expand Down Expand Up @@ -571,6 +571,7 @@ void update_ui()
colored_if_null("Username: %08X", username_offset);
colored_if_null("Check Timewarp: %08X", check_timewarp_offset);
colored_if_null("Update Mods: %08X", update_mods_offset);
colored_if_null("Score Multiplier: %08X", score_multiplier_offset);
}
if (ImGui::CollapsingHeader("Hook Jumps", ImGuiTreeNodeFlags_None))
{
Expand Down
4 changes: 2 additions & 2 deletions include/baked_utils_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ static const unsigned int utils_dll_data[9728/4] =
{
0x00905a4d, 0x00000003, 0x00000004, 0x0000ffff, 0x000000b8, 0x00000000, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x0eba1f0e, 0xcd09b400, 0x4c01b821, 0x685421cd, 0x70207369, 0x72676f72, 0x63206d61, 0x6f6e6e61,
0x65622074, 0x6e757220, 0x206e6920, 0x20534f44, 0x65646f6d, 0x0a0d0d2e, 0x00000024, 0x00000000, 0x00004550, 0x0003014c, 0x65f39ca5, 0x00000000,
0x65622074, 0x6e757220, 0x206e6920, 0x20534f44, 0x65646f6d, 0x0a0d0d2e, 0x00000024, 0x00000000, 0x00004550, 0x0003014c, 0x65f4c27d, 0x00000000,
0x00000000, 0x202200e0, 0x0030010b, 0x00001e00, 0x00000600, 0x00000000, 0x00003c2a, 0x00002000, 0x00004000, 0x10000000, 0x00002000, 0x00000200,
0x00000004, 0x00000000, 0x00000004, 0x00000000, 0x00008000, 0x00000200, 0x00000000, 0x85400003, 0x00100000, 0x00001000, 0x00100000, 0x00001000,
0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00003bd8, 0x0000004f, 0x00004000, 0x00000298, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
Expand Down Expand Up @@ -148,7 +148,7 @@ static const unsigned int utils_dll_data[9728/4] =
0x0035005f, 0x00300054, 0x003d006f, 0x00233f00, 0x007a003d, 0x00300045, 0x00440056, 0x0066005a, 0x004a0077, 0x00480045, 0x007a0033, 0x00440036,
0x00580033, 0x00710047, 0x0054006d, 0x0044006b, 0x00460052, 0x0077006b, 0x00470066, 0x3f000100, 0x003d0023, 0x004e007a, 0x00740044, 0x00300073,
0x00360067, 0x0058004a, 0x00240045, 0x005f0059, 0x00700059, 0x00650068, 0x00760053, 0x00670062, 0x007a007a, 0x007a0068, 0x006f0070, 0x17000051,
0x003d0023, 0x004f007a, 0x00710035, 0x0062006d, 0x00550070, 0x0000003d, 0x03c77b7f, 0x4b4df063, 0x30dd4db7, 0xf08bfe1e, 0x01200400, 0x20030801,
0x003d0023, 0x004f007a, 0x00710035, 0x0062006d, 0x00550070, 0x0000003d, 0x5d1d72ad, 0x45d05450, 0x352c37a2, 0x70c9062d, 0x01200400, 0x20030801,
0x20050100, 0x11110101, 0x01012005, 0x07041d11, 0x04311101, 0x65120000, 0x12012005, 0x20050e35, 0x0e391201, 0x11002004, 0x00200331, 0x01000418,
0x07061808, 0x112d1102, 0x1215072d, 0x110e0229, 0x0120052d, 0x06001302, 0x01130120, 0x00050013, 0x08181802, 0x11020007, 0x71111c2d, 0x01022007,
0x01130013, 0x11010704, 0x0307082d, 0x0824111d, 0x20032411, 0x20030e00, 0x070e0800, 0x113d1106, 0x113d113d, 0x41121d3d, 0x00200408, 0x20043d11,
Expand Down
1 change: 1 addition & 0 deletions include/features/score_multiplier.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "ui/config.h"

extern uintptr_t score_multiplier_code_start;
extern uintptr_t score_multiplier_offset;
extern uintptr_t score_multiplier_hook_jump_back;

void init_score_multiplier();
Expand Down
2 changes: 1 addition & 1 deletion include/signatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ constexpr auto binding_manager_sig { pattern::build<"8D 45 D8 50 8B 0D"
constexpr auto selected_replay_sig { pattern::build<"8B 46 38 83 78 30 00"> };
constexpr auto osu_username_sig { pattern::build<"8B 01 8B 40 28 FF 50 18 8B 15"> };
constexpr auto window_manager_sig { pattern::build<"8B 15 . . . . 83 C2 04 39 09 E8 . . . . 59"> };
constexpr auto score_multiplier_sig { pattern::build<"8B F1 D9 E8 83 FA 04 0F 83"> };
constexpr auto score_multiplier_sig { pattern::build<"55 8B EC 57 56 83 EC . 8B F1 D9 E8 83 FA 04"> };
constexpr auto update_timing_sig { pattern::build<"D9 C0 DD 05"> };
constexpr auto update_timing_sig_2 { pattern::build<"DE E9 DD 1D"> };
constexpr auto check_timewarp_sig { pattern::build<"D9 E8 DE F1 DE C9"> };
Expand Down
Binary file modified nobuild.exe
Binary file not shown.

0 comments on commit 363de4d

Please sign in to comment.