summaryrefslogtreecommitdiff
path: root/injector/main.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
committerboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
commit3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch)
tree26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /injector/main.cpp
parente4729e4393d90271a3814c7a79950a660c48325a (diff)
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
Diffstat (limited to 'injector/main.cpp')
-rw-r--r--injector/main.cpp121
1 files changed, 0 insertions, 121 deletions
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 <stdio.h>
-#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