diff options
author | BDKPlayer <fabian.stotz@yahoo.de> | 2020-03-03 18:54:24 +0100 |
---|---|---|
committer | BDKPlayer <fabian.stotz@yahoo.de> | 2020-03-03 18:54:24 +0100 |
commit | 39be1b0e1ecebf73fbda16a99c4d2aeb3ca5010a (patch) | |
tree | c0454193e52ec04a01710553387fdcf33786dcfc | |
parent | 2eb506165d3d451d9daafdec8b499444bb34351b (diff) |
Disabled: minimapText feature
-rw-r--r-- | Core.cpp | 5 | ||||
-rw-r--r-- | DetourHook64.cpp | 11 | ||||
-rw-r--r-- | MinimapText.cpp | 35 |
3 files changed, 20 insertions, 31 deletions
@@ -31,7 +31,6 @@ void createPlayerTreeNode(Player* player, int playerIndex) { ImGui::PushStyleColor(ImGuiCol_Text, Engine::Get()->GetPlayerColorImGUI(*player->playerColor)); - std::string playerText = "Player " + std::to_string(playerIndex); if (ImGui::TreeNode(playerText.c_str())) { @@ -77,6 +76,7 @@ void createPlayerTreeNode(Player* player, int playerIndex) ImGui::PopStyleColor(); } + void Core::OnPresent() { printf("OnPresent\n"); @@ -86,9 +86,6 @@ void Core::OnPresent() //printf("mainScreen: %p\n", mainScreen); if (!mainScreen) { - ImGui::Begin("AoE Hackbase - BDKPlayer", (bool*)0, ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav); - ImGui::Text("Waiting for game to start..."); - ImGui::End(); return; } diff --git a/DetourHook64.cpp b/DetourHook64.cpp index 0cd0f47..47683ea 100644 --- a/DetourHook64.cpp +++ b/DetourHook64.cpp @@ -12,30 +12,21 @@ BYTE* DetourHook64::Hook(BYTE* hookAddress, BYTE* shellcode, int shellcodeSize, this->pageSize = pageSize; this->originalBytes = new BYTE[length]; - - printf("MinimapText - Hook\n"); - //Make original code writeable (.text segment usually read only). DWORD oldProtection; if (!VirtualProtect(hookAddress, length, PAGE_EXECUTE_READWRITE, &oldProtection)) { return NULL; //Couldn't make memory writeable } - printf("MinimapText - VirtualProtect\n"); - for (int i = 0; i < length; i++) { this->originalBytes[i] = hookAddress[i]; - printf("Original Byte %i: %x\n", i, hookAddress[i]); } - - + //Create VirtualMemoryPage somewhere (NULL) lets system decide trampoline = (BYTE*)VirtualAlloc(NULL, pageSize, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - printf("MinimapText - trampoline\n"); - if (!trampoline) { return NULL; //Couldn't allocate virtual memory diff --git a/MinimapText.cpp b/MinimapText.cpp index c5f3ae6..fc6ef8a 100644 --- a/MinimapText.cpp +++ b/MinimapText.cpp @@ -10,37 +10,38 @@ #include "DetourHook64.h" -#pragma warning( disable : 4244 ) - +#include <map> -bool hookEnabled = true; +#pragma warning( disable : 4244 ) char* name = "NewName"; + void MinimapText::OnInitialise() { - const int shellcodeSize = 29; - BYTE shellcode[shellcodeSize] = { 0x8B, 0x84, 0xF5, 0x24, 0x1, 0x0, 0x0, // mov eax, [rbp+rsi*8+5F8h+var_4D4] <-- orginal code - 0x89, 0x44, 0x24, 0x20, // mov dword ptr[rsp + 6D0h + var_6B0], eax <-- orginal code - 0x44, 0x8B, 0x8C, 0xF5, 0x20, 0x1, 0x0, 0x0, // mov r9d, dword ptr[rbp + rsi * 8 + 5F8h + var_4DC + 4] <-- orginal code - 0x49, 0xB8, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }; //MOV R8, 0x1122334455667788 <-- new code (replaces string to print) - *(uint64_t*)(&shellcode[21]) = (uint64_t)name; - - //8B 84 F5 ? ? ? ? 89 - BYTE* hookAddress = (BYTE*)((int64_t)GetModuleHandle(NULL)+0xA429FD); - - minimapTextDetour = new DetourHook64(); - minimapTextDetour->Hook(hookAddress, shellcode, shellcodeSize, (uint64_t)(hookAddress + 23), 19); + //Working + //const int shellcodeSize = 29; + //BYTE shellcode[shellcodeSize] = { 0x8B, 0x84, 0xF5, 0x24, 0x1, 0x0, 0x0, // mov eax, [rbp+rsi*8+5F8h+var_4D4] <-- orginal code + // 0x89, 0x44, 0x24, 0x20, // mov dword ptr[rsp + 6D0h + var_6B0], eax <-- orginal code + // 0x44, 0x8B, 0x8C, 0xF5, 0x20, 0x1, 0x0, 0x0, // mov r9d, dword ptr[rbp + rsi * 8 + 5F8h + var_4DC + 4] <-- orginal code + // 0x49, 0xB8, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }; //MOV R8, 0x1122334455667788 <-- new code (replaces string to print) + //*(uint64_t*)(&shellcode[21]) = (uint64_t)name; + + ////8B 84 F5 ? ? ? ? 89 + //BYTE* hookAddress = (BYTE*)Utility::Scan("\x8B\x84\xF5\x00\x00\x00\x00\x89", "xxx????x", (char*)0x7ff000000000, 0x800000000000 - 0x7ff000000000); + //printf("hookAddress: %p\n", hookAddress); + //minimapTextDetour = new DetourHook64(); + //minimapTextDetour->Hook(hookAddress, shellcode, shellcodeSize, (uint64_t)(hookAddress + 23), 19); } void MinimapText::OnShutdown() { - minimapTextDetour->Unhook(); + //minimapTextDetour->Unhook(); } void MinimapText::OnMenuMainWindow() { - ImGui::Checkbox("Minimap Ressource Information", &hookEnabled); + //ImGui::Checkbox("Minimap Ressource Information", &hookEnabled); }
\ No newline at end of file |