This commit is contained in:
Bluzume 2020-11-15 14:02:44 +13:00 committed by GitHub
parent 6b222307a1
commit 928dde5ba0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 66 deletions

View file

@ -21,6 +21,7 @@ Global
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Debug|x86.ActiveCfg = Debug|Win32 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Debug|x86.ActiveCfg = Debug|Win32
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Debug|x86.Build.0 = Debug|Win32 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Debug|x86.Build.0 = Debug|Win32
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|Any CPU.ActiveCfg = Release|Win32 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|Any CPU.ActiveCfg = Release|Win32
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|Any CPU.Build.0 = Release|Win32
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x64.ActiveCfg = Release|x64 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x64.ActiveCfg = Release|x64
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x64.Build.0 = Release|x64 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x64.Build.0 = Release|x64
{917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x86.ActiveCfg = Release|Win32 {917B2AEB-964D-4499-8108-4E356C91D5E9}.Release|x86.ActiveCfg = Release|Win32

View file

@ -8,11 +8,7 @@
int* pointer_path; int* pointer_path;
int num_ptr; int num_ptr;
#ifdef _WIN64 uintptr_t GetProcessBaseAddress(HANDLE process) // from stackoverflow
unsigned long long int GetProcessBaseAddress(HANDLE process) // from stackoverflow
#else
unsigned int GetProcessBaseAddress(HANDLE process) // from stackoverflow
#endif
{ {
DWORD_PTR baseAddress = 0; DWORD_PTR baseAddress = 0;
HANDLE processHandle = OpenProcess(PROCESS_ALL_ACCESS,TRUE,process); HANDLE processHandle = OpenProcess(PROCESS_ALL_ACCESS,TRUE,process);
@ -33,11 +29,7 @@ unsigned int GetProcessBaseAddress(HANDLE process) // from stackoverflow
int moduleCount; int moduleCount;
moduleCount = bytesRequired / sizeof(HMODULE); moduleCount = bytesRequired / sizeof(HMODULE);
#ifdef _WIN64 moduleArray = (uintptr_t*)moduleArrayBytes;
moduleArray = (unsigned int*)moduleArrayBytes;
#else
moduleArray = (unsigned long long int*)moduleArrayBytes;
#endif
if (EnumProcessModules(processHandle, moduleArray, bytesRequired, &bytesRequired)) if (EnumProcessModules(processHandle, moduleArray, bytesRequired, &bytesRequired))
@ -61,19 +53,38 @@ int main(int argc, char* argv[])
HWND hWnd = NULL; HWND hWnd = NULL;
FILE* ptr_file; FILE* ptr_file;
char MEE_POINTER_FILE[0x2048]; char MEE_POINTER_FILE[0x2048];
int LOGIN_STEP_VALUE = -1;
char* tmp;
#ifdef _WIN64 #ifdef _WIN64
printf_s("!!! x64 Version can ONLY be used for the 64 Bit Versions of the game!\n"); printf_s("!!! x64 Version can ONLY be used for the 64 Bit Versions of the game!\n");
#else #else
printf_s("!!! x86 Version can ONLY be used for the 32 Bit Versions of the game!\n"); printf_s("!!! x86 Version can ONLY be used for the 32 Bit Versions of the game!\n");
#endif #endif
strncpy_s(MEE_POINTER_FILE, 0x2048, "mee.ptr", 0x2048);
if(argc > 1)
{
for (int i = 0; i < argc; i++)
{
if (argc == 1) if (strcmp(argv[i], "--help") == 0)
{ {
strncpy_s(MEE_POINTER_FILE, 0x2048, "mee.ptr", 0x2048); printf_s("--ptr <mee.ptr file>\n");
} printf_s("--lstep <custom login step value>\n");
else return;
{ }
strncpy_s(MEE_POINTER_FILE, 0x2048, argv[1], 0x2048);
if(strcmp(argv[i],"--ptr") == 0)
strncpy_s(MEE_POINTER_FILE, 0x2048, argv[i+1], 0x2048);
if (strcmp(argv[i], "--lstep") == 0)
LOGIN_STEP_VALUE = strtol(argv[i + 1], &tmp, 10);
}
printf_s("MEE.PTR FILE : %s\nLOGIN STEP VALUE: %i\n", MEE_POINTER_FILE, LOGIN_STEP_VALUE);
} }
// Read text file // Read text file
@ -108,7 +119,6 @@ int main(int argc, char* argv[])
memcpy_s(work_buf, sz, file_contents, sz); memcpy_s(work_buf, sz, file_contents, sz);
char* next_token2 = NULL; char* next_token2 = NULL;
char* tmp;
char* ptrs = strtok_s(work_buf, " > ",&next_token2); char* ptrs = strtok_s(work_buf, " > ",&next_token2);
pointer_path[0] = (int)strtol(ptrs, &tmp, 16); pointer_path[0] = (int)strtol(ptrs, &tmp, 16);
@ -164,13 +174,9 @@ int main(int argc, char* argv[])
printf_s("MCEE Process ID: %x\n", proc_id); printf_s("MCEE Process ID: %x\n", proc_id);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, proc_id); HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, proc_id);
printf_s("MCEE Process Handle: %x\n", hProcess); printf_s("MCEE Process Handle: %x\n", hProcess);
#ifdef _WIN64
long long int baseAddress = (long long int)GetProcessBaseAddress(proc_id); uintptr_t baseAddress = (uintptr_t)GetProcessBaseAddress(proc_id);
printf_s("MCEE Base Addr: %llx\n", baseAddress); printf_s("MCEE Base Addr: %llx\n", baseAddress);
#else
int baseAddress = (int)GetProcessBaseAddress(proc_id);
printf_s("MCEE Base Addr: %x\n", baseAddress);
#endif
if (!hProcess) if (!hProcess)
{ {
@ -178,79 +184,78 @@ int main(int argc, char* argv[])
} }
else else
{ {
printf_s("Waiting for game to initalize....\n");
read_ptr_path:
// Read first ptr // Read first ptr
printf_s("Waiting for game to Initalize.\n"); "weird compiler shiz right here..";
#ifdef _WIN64
long long int cur_ptr = baseAddress + pointer_path[0]; uintptr_t cur_ptr = baseAddress + pointer_path[0];
long long int ptr = 0; uintptr_t ptr = 0;
long long int new_ptr = 0; uintptr_t new_ptr = 0;
#else
int cur_ptr = baseAddress + pointer_path[0];
int ptr = 0;
int new_ptr = 0;
#endif
while (ptr == 0) while (ptr == 0)
{ {
#ifdef _WIN64 ReadProcessMemory(hProcess, cur_ptr, &ptr, sizeof(uintptr_t), 0);
ReadProcessMemory(hProcess, cur_ptr, &ptr, sizeof(long long int), 0);
#else
ReadProcessMemory(hProcess, cur_ptr, &ptr, sizeof(int), 0);
#endif
} }
printf_s("Pointer 1: %x == %x\n", cur_ptr, ptr);
for (int i = 1; i < num_ptr-1; i++) // Follow path... for (int i = 1; i < num_ptr-1; i++) // Follow path...
{ {
cur_ptr = ptr + pointer_path[i]; cur_ptr = ptr + pointer_path[i];
#ifdef _WIN64 ReadProcessMemory(hProcess, cur_ptr, &new_ptr, sizeof(uintptr_t), 0);
ReadProcessMemory(hProcess, cur_ptr, &new_ptr, sizeof(long long int), 0);
#else
ReadProcessMemory(hProcess, cur_ptr, &new_ptr, sizeof(int), 0);
#endif
if (new_ptr == 0) { if (new_ptr == 0) {
i -= 1; i -= 1;
continue; goto read_ptr_path;
} }
else else
{ {
ptr = new_ptr; ptr = new_ptr;
} }
printf_s("Pointer %i: %x == %x\n", i, cur_ptr, ptr);
} }
// Wait for 0x1 // Wait for 0x1
printf_s("Waiting for login screen.\n"); int login_step_value = 0;
int login_stage = 0; ReadProcessMemory(hProcess, (void*)ptr, &login_step_value, sizeof(int), 0);
while (1) if (login_step_value != 0x0)
{ {
ReadProcessMemory(hProcess, (void*)ptr, &login_stage, sizeof(int), 0); if (LOGIN_STEP_VALUE != -1)
if (login_stage == 0x1 || login_stage == 0x4)
{ {
printf_s("Trying login stage 6...\n"); // Backwards Comp (1.9 and lower) printf_s("Trying login stage %i", LOGIN_STEP_VALUE);
int login_success = 6; WriteProcessMemory(hProcess, (void*)ptr, &LOGIN_STEP_VALUE, sizeof(int), 0);
WriteProcessMemory(hProcess, (void*)ptr, &login_success, sizeof(int), 0); goto finish;
Sleep(1 * 500);
printf_s("Trying login stage 8...\n");
login_success = 8;
WriteProcessMemory(hProcess, (void*)ptr, &login_success, sizeof(int), 0);
break;
} }
printf_s("Trying login stage 6...\n"); // Backwards Comp (1.9 and lower)
int login_step_value = 6;
WriteProcessMemory(hProcess, (void*)ptr, &login_step_value, sizeof(int), 0);
Sleep(1 * 500);
printf_s("Trying login stage 8...\n");
login_step_value = 8;
WriteProcessMemory(hProcess, (void*)ptr, &login_step_value, sizeof(int), 0);
} }
else
{
goto read_ptr_path;
}
finish:
CloseHandle(hProcess); CloseHandle(hProcess);
printf_s("\nBlessed Be!\n"); printf_s("\nBlessed Be!\n");
Sleep(5 * 1000);
return 0; return 0;
} }
} }

View file

@ -23,7 +23,7 @@
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{917b2aeb-964d-4499-8108-4e356c91d5e9}</ProjectGuid> <ProjectGuid>{917b2aeb-964d-4499-8108-4e356c91d5e9}</ProjectGuid>
<RootNamespace>MinecraftEducationEdition</RootNamespace> <RootNamespace>MinecraftEducationEdition</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>MinecraftEducationEdition</ProjectName> <ProjectName>MinecraftEducationEdition</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -91,6 +91,10 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>MaxSpeed</Optimization>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>