diff options
| author | auth12 <[email protected]> | 2020-07-16 13:37:51 +0100 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-16 13:37:51 +0100 |
| commit | e2379c4956099294994e090b9bede94bbbbdcab1 (patch) | |
| tree | c62f61d77157e8eed8d4ad90db93fc79b587ba36 /client/src/assembler/shellcode.h | |
| parent | Client login handling on server. (diff) | |
| download | loader-e2379c4956099294994e090b9bede94bbbbdcab1.tar.xz loader-e2379c4956099294994e090b9bede94bbbbdcab1.zip | |
Added windows support on client.
Diffstat (limited to 'client/src/assembler/shellcode.h')
| -rw-r--r-- | client/src/assembler/shellcode.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/client/src/assembler/shellcode.h b/client/src/assembler/shellcode.h new file mode 100644 index 0000000..6fb2f61 --- /dev/null +++ b/client/src/assembler/shellcode.h @@ -0,0 +1,29 @@ +#pragma once + +using namespace asmjit; + +class sc { + std::vector<uint8_t> m_buf; + + CodeHolder m_code; + JitRuntime m_runtime; + x86::Assembler m_assembler; + + bool m_x64; + public: + sc(const bool x64 = false) : m_x64{x64} { + Environment env(x64 ? Environment::kArchX64 : Environment::kArchX86); + + m_code.init(env); + m_code.attach(&m_assembler); + } + + void start(); + void push(const std::vector<uintptr_t> &args); + void call(const uintptr_t addr); + void save_ret(const uintptr_t addr); + void end(); + + auto &operator()() const { return m_buf; } + auto &operator->() const { return m_assembler; } +};
\ No newline at end of file |