aboutsummaryrefslogtreecommitdiff
path: root/client/src/shellcode/shellcode.cpp
blob: 67cbabf474018e7d1c4d13bc59fde11d61ee7c61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "../include.h"
#include "shellcode.h"

void sc::generator::start() {}

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);
    }
    return;
  }
  
  // 64bit impl
}

void sc::generator::call(const uintptr_t addr) {}

void sc::generator::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);
}