From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: cleaned up in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64 --- injector/main.cpp | 121 ------------------------------------------------------ 1 file changed, 121 deletions(-) delete mode 100644 injector/main.cpp (limited to 'injector/main.cpp') diff --git a/injector/main.cpp b/injector/main.cpp deleted file mode 100644 index f3d3511..0000000 --- a/injector/main.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include "winapi.h" - -const wchar_t* const kernel32_str = L"KERNEL32.DLL"; -const wchar_t* const ucrtbase_str = L"ucrtbase.dll"; -const char* const loadlib_str = "LoadLibraryA"; -const char* const printf_str = "printf"; - -const char* const printf_fmt = "print: %08x\n\0"; -const char* const fail_msg = "k32 null\n"; -const char* const pause_str = "pause"; -const char* const system_str = "system"; - -uintptr_t printf_addr = ( uintptr_t )&printf; -uintptr_t system_addr = 0; - -//i dont even -//unfinished btw - -__declspec( naked ) int print_var( uint32_t var ) { - __asm { - push ebp - mov ebp, esp - sub esp, __LOCAL_SIZE - - mov eax, var - push eax - push printf_fmt - call printf_addr - - add esp, 8 - mov esp, ebp - pop ebp - - mov eax, 0 - ret - } -} - -__declspec( naked ) void print_error( const char* err ) { - __asm { - push ebp - mov ebp, esp - sub esp, __LOCAL_SIZE - - mov eax, err - push eax - call printf_addr - - add esp, 8 - mov esp, ebp - pop ebp - } -} - -__declspec( naked ) int main( void ) { - void* k32; - void* ucrtbase; - uintptr_t loadlib; - - __asm { - push ebp - mov ebp, esp - sub esp, __LOCAL_SIZE - - mov eax, ds:ucrtbase_str - push eax - call winapi::k32::get_module_handle - add esp, 4 - mov ucrtbase, eax - - mov eax, ds:system_str - push eax - mov ecx, ucrtbase - push ecx - call winapi::k32::get_proc_address - add esp, 4 - mov system_addr, eax - - mov eax, ds:kernel32_str - push eax - call winapi::k32::get_module_handle - add esp, 4 - mov k32, eax - - mov eax, k32 - push eax - call print_var - - cmp k32, 0 - je K32_FAIL - - mov eax, ds:loadlib_str - push eax - mov ecx, k32 - push ecx - call winapi::k32::get_proc_address - - add esp, 8 - mov loadlib, eax - - mov eax, loadlib - push eax - call print_var - - jmp END - - K32_FAIL: - mov eax, fail_msg - push eax - call printf_addr - - END: - mov eax, pause_str - push eax - call system_addr - mov esp, ebp - pop ebp - ret - } -} \ No newline at end of file -- cgit v1.2.3