From 6b222307a1b75ed74606ae2af70c166b1fa4e23d Mon Sep 17 00:00:00 2001 From: Bluzume <39113159+KuromeSan@users.noreply.github.com> Date: Wed, 29 Jul 2020 18:07:46 +1200 Subject: [PATCH] Add files via upload --- .../MinecraftEducationEdition.c | 24 ++++++++++++------- MinecraftEducationEdition/mee.ptr | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 MinecraftEducationEdition/mee.ptr diff --git a/MinecraftEducationEdition/MinecraftEducationEdition.c b/MinecraftEducationEdition/MinecraftEducationEdition.c index 821e677..4cd39b5 100644 --- a/MinecraftEducationEdition/MinecraftEducationEdition.c +++ b/MinecraftEducationEdition/MinecraftEducationEdition.c @@ -8,8 +8,11 @@ int* pointer_path; int num_ptr; - -HMODULE* GetProcessBaseAddress(HANDLE process) // from stackoverflow +#ifdef _WIN64 +unsigned long long int GetProcessBaseAddress(HANDLE process) // from stackoverflow +#else +unsigned int GetProcessBaseAddress(HANDLE process) // from stackoverflow +#endif { DWORD_PTR baseAddress = 0; HANDLE processHandle = OpenProcess(PROCESS_ALL_ACCESS,TRUE,process); @@ -30,7 +33,12 @@ HMODULE* GetProcessBaseAddress(HANDLE process) // from stackoverflow int moduleCount; moduleCount = bytesRequired / sizeof(HMODULE); - moduleArray = (HMODULE*)moduleArrayBytes; + #ifdef _WIN64 + moduleArray = (unsigned int*)moduleArrayBytes; + #else + moduleArray = (unsigned long long int*)moduleArrayBytes; + #endif + if (EnumProcessModules(processHandle, moduleArray, bytesRequired, &bytesRequired)) { @@ -160,7 +168,7 @@ int main(int argc, char* argv[]) long long int baseAddress = (long long int)GetProcessBaseAddress(proc_id); printf_s("MCEE Base Addr: %llx\n", baseAddress); #else - int baseAddress = (int)GetProcessBaseAddress(hProcess); + int baseAddress = (int)GetProcessBaseAddress(proc_id); printf_s("MCEE Base Addr: %x\n", baseAddress); #endif @@ -175,9 +183,11 @@ int main(int argc, char* argv[]) #ifdef _WIN64 long long int cur_ptr = baseAddress + pointer_path[0]; long long int ptr = 0; + long long int new_ptr = 0; #else int cur_ptr = baseAddress + pointer_path[0]; int ptr = 0; + int new_ptr = 0; #endif while (ptr == 0) @@ -193,11 +203,7 @@ int main(int argc, char* argv[]) for (int i = 1; i < num_ptr-1; i++) // Follow path... { - #ifdef _WIN64 - long long int new_ptr = 0; - #else - int new_ptr = 0; - #endif + cur_ptr = ptr + pointer_path[i]; #ifdef _WIN64 diff --git a/MinecraftEducationEdition/mee.ptr b/MinecraftEducationEdition/mee.ptr new file mode 100644 index 0000000..6b62dda --- /dev/null +++ b/MinecraftEducationEdition/mee.ptr @@ -0,0 +1 @@ +2594A58 > 60 > 138 > 58 > 480 > 10 > A8 > 0 \ No newline at end of file