summaryrefslogtreecommitdiff
path: root/legacy/loader/x86.h
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 /legacy/loader/x86.h
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 'legacy/loader/x86.h')
-rw-r--r--legacy/loader/x86.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/legacy/loader/x86.h b/legacy/loader/x86.h
new file mode 100644
index 0000000..5208225
--- /dev/null
+++ b/legacy/loader/x86.h
@@ -0,0 +1,47 @@
+#pragma once
+#include <inttypes.h>
+
+namespace x86
+{
+ enum class reg : size_t {
+ eax = 0,
+ ecx,
+ edx,
+ ebx,
+ esp,
+ ebp,
+ esi,
+ edi,
+
+ /*
+ x64:
+ r8,
+ r9,
+ r10,
+ r11,
+ r12,
+ r13,
+ r14,
+ r15,*/
+ };
+
+ enum instruction : uint8_t {
+ retn_imm16 = 0xc2,
+ retn = 0xc3,
+ fs = 0x64,
+ //its big nigga season
+ call = 0xff
+ };
+
+ __forceinline static uint32_t encode_mov_imm32( x86::reg dreg ) {
+ return ( 0xb8 + ( size_t( dreg ) ) );
+ }
+
+ __forceinline static uint32_t encode_push_reg( x86::reg dreg ) {
+ return ( 0x50 | ( ( size_t( dreg ) ) & 7 ) );
+ }
+
+ __forceinline static uint32_t encode_pop_reg( x86::reg dreg ) {
+ return ( 0x58 | ( ( size_t( dreg ) ) & 7 ) );
+ }
+}; \ No newline at end of file