-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Options Toggle to show map packs again
- Loading branch information
1 parent
72f6731
commit 71ebfb4
Showing
8 changed files
with
88 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "GameManager.h" | ||
#include <Windows.h> | ||
|
||
void GameManager::mem_init() { | ||
size_t base = reinterpret_cast<size_t>(GetModuleHandle(0)); | ||
getSharedState = reinterpret_cast<decltype(getSharedState)>(base + 0xC4A50); | ||
getGameVariable = reinterpret_cast<decltype(getGameVariable)>(base + 0xC9D30); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
namespace GameManager { | ||
inline void* (__cdecl* getSharedState)(); | ||
inline bool(__thiscall* getGameVariable)(void* self, const char* key); | ||
void mem_init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "MenuOptions.h" | ||
#include "MinHook.h" | ||
|
||
bool __fastcall MenuOptions::initHook(void* self) | ||
{ | ||
bool result = MenuOptions::init(self); | ||
|
||
MenuOptions::addToggle( | ||
self, | ||
"Show Map Packs", | ||
"mp-show", | ||
"Re-adds Map Packs to the game"); | ||
|
||
return result; | ||
} | ||
|
||
void MenuOptions::mem_init() { | ||
size_t base = reinterpret_cast<size_t>(GetModuleHandle(0)); | ||
MH_CreateHook( | ||
(PVOID)(base + 0x1DE8F0), | ||
MenuOptions::initHook, | ||
(PVOID*)&MenuOptions::init); | ||
|
||
MenuOptions::addToggle = reinterpret_cast<decltype(MenuOptions::addToggle)>(base + 0x1DF6B0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
namespace MenuOptions { | ||
|
||
inline int(__thiscall* addToggle)(void* self, const char* display, const char* key, const char* extraInfo); | ||
inline bool(__thiscall* init)(void*); | ||
bool __fastcall initHook(void* self); | ||
void mem_init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters