diff options
| author | auth <[email protected]> | 2020-07-17 15:47:51 +0200 |
|---|---|---|
| committer | auth <[email protected]> | 2020-07-17 15:47:51 +0200 |
| commit | 8e5e48337a6cf7a33ecbee7cf9c594fa18bd93ae (patch) | |
| tree | a3a7293f9ee95755f2530dae0ac6ca35f03ae75f /client | |
| parent | Added certificates. (diff) | |
| download | loader-8e5e48337a6cf7a33ecbee7cf9c594fa18bd93ae.tar.xz loader-8e5e48337a6cf7a33ecbee7cf9c594fa18bd93ae.zip | |
Refactoring.
Diffstat (limited to 'client')
| -rw-r--r-- | client/src/assembler/opcodes.h | 9 | ||||
| -rw-r--r-- | client/src/main.cpp | 10 | ||||
| -rw-r--r-- | client/src/shellcode/shellcode.cpp (renamed from client/src/assembler/assembler.cpp) | 10 | ||||
| -rw-r--r-- | client/src/shellcode/shellcode.h (renamed from client/src/assembler/assembler.h) | 8 |
4 files changed, 12 insertions, 25 deletions
diff --git a/client/src/assembler/opcodes.h b/client/src/assembler/opcodes.h deleted file mode 100644 index 5268b45..0000000 --- a/client/src/assembler/opcodes.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - - -namespace assembler { - enum opcodes : uint8_t { - nop = 0x90, - ret = 0xc3 - }; -};
\ No newline at end of file diff --git a/client/src/main.cpp b/client/src/main.cpp index cbe9f65..aac1c4f 100644 --- a/client/src/main.cpp +++ b/client/src/main.cpp @@ -1,20 +1,12 @@ #include "include.h" #include "util/io.h" #include "client/client.h" -#include "assembler/assembler.h" +#include "shellcode/shellcode.h" #include "injection/mapper.h" int main(int argc, char* argv[]) { io::init(); - /*assembler a; - a.push({1, 2, 3, 7, 9}); - a.end(); - for(auto &b : a()) { - io::logger->info("{:x}", b); - } - std::cin.get();*/ - tcp::client client; std::thread t{tcp::client::monitor, std::ref(client)}; diff --git a/client/src/assembler/assembler.cpp b/client/src/shellcode/shellcode.cpp index cf41ad1..67cbabf 100644 --- a/client/src/assembler/assembler.cpp +++ b/client/src/shellcode/shellcode.cpp @@ -1,9 +1,9 @@ #include "../include.h" -#include "assembler.h" +#include "shellcode.h" -void assembler::start() {} +void sc::generator::start() {} -void assembler::push(const std::vector<uintptr_t>& args) { +void sc::generator::push(const std::vector<uintptr_t>& args) { if (!m_x64) { for (auto it = args.rbegin(); it != args.rend(); ++it) { m_assembler.push(*it); @@ -14,9 +14,9 @@ void assembler::push(const std::vector<uintptr_t>& args) { // 64bit impl } -void assembler::call(const uintptr_t addr) {} +void sc::generator::call(const uintptr_t addr) {} -void assembler::end() { +void sc::generator::end() { if (m_x64) { } diff --git a/client/src/assembler/assembler.h b/client/src/shellcode/shellcode.h index 00c7362..5f0e135 100644 --- a/client/src/assembler/assembler.h +++ b/client/src/shellcode/shellcode.h @@ -4,7 +4,9 @@ using namespace asmjit; -class assembler { +namespace sc { + +class generator { std::vector<uint8_t> m_buf; CodeHolder m_code; @@ -13,7 +15,7 @@ class assembler { bool m_x64; public: - assembler(const bool x64 = false) : m_x64{x64} { + generator(const bool x64 = false) : m_x64{x64} { Environment env(x64 ? Environment::kArchX64 : Environment::kArchX86); m_code.init(env); @@ -28,4 +30,6 @@ class assembler { auto &operator()() const { return m_buf; } auto &operator->() const { return m_assembler; } +}; + };
\ No newline at end of file |