aboutsummaryrefslogtreecommitdiff
path: root/client/src/assembler
diff options
context:
space:
mode:
authorauth <[email protected]>2020-07-17 15:49:00 +0200
committerauth <[email protected]>2020-07-17 15:49:00 +0200
commitbc9a539dc2dc40435f3e7b63306ed80a5198458b (patch)
tree85bc4addae613067e175b7c7d7af1593f09b9c4d /client/src/assembler
parentMerge branch 'master' into windows (diff)
parentRefactoring. (diff)
downloadloader-bc9a539dc2dc40435f3e7b63306ed80a5198458b.tar.xz
loader-bc9a539dc2dc40435f3e7b63306ed80a5198458b.zip
Merge branch 'master' into windows
Diffstat (limited to 'client/src/assembler')
-rw-r--r--client/src/assembler/shellcode.cpp31
-rw-r--r--client/src/assembler/shellcode.h29
2 files changed, 0 insertions, 60 deletions
diff --git a/client/src/assembler/shellcode.cpp b/client/src/assembler/shellcode.cpp
deleted file mode 100644
index af3160b..0000000
--- a/client/src/assembler/shellcode.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "../include.h"
-#include "shellcode.h"
-
-void sc::start() {}
-
-void sc::push(const std::vector<uintptr_t>& args) {
- if (!m_x64) {
- for (auto it = args.rbegin(); it != args.rend(); ++it) {
- m_assembler.push(*it);
- }
- return;
- }
-
- // 64bit impl
-}
-
-void sc::call(const uintptr_t addr) {}
-
-void sc::end() {
- if (m_x64) {
- }
-
- void* func;
- m_runtime.add(&func, &m_code);
-
- const size_t size = m_code.codeSize();
-
- m_buf.resize(size);
-
- std::memcpy(&m_buf[0], func, size);
-} \ No newline at end of file
diff --git a/client/src/assembler/shellcode.h b/client/src/assembler/shellcode.h
deleted file mode 100644
index 6fb2f61..0000000
--- a/client/src/assembler/shellcode.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#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