|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include <decomp/symbol.hpp>
|
|
|
|
|
|
|
|
#define XED_ENCODER
|
|
|
|
extern "C" {
|
|
|
|
#include <xed-decode.h>
|
|
|
|
#include <xed-interface.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
#define INSTR_SPLIT_SECTION_NAME ".obf"
|
|
|
|
|
|
|
|
namespace theo::decomp {
|
|
|
|
class routine_t {
|
|
|
|
public:
|
|
|
|
explicit routine_t(coff::symbol_t* sym,
|
|
|
|
coff::image_t* img,
|
|
|
|
coff::section_header_t* scn,
|
|
|
|
std::vector<std::uint8_t>& fn,
|
|
|
|
sym_type_t dcmp_type);
|
|
|
|
|
|
|
|
std::vector<decomp::symbol_t> decompose();
|
|
|
|
coff::section_header_t* scn();
|
|
|
|
std::vector<std::uint8_t> data();
|
|
|
|
|
|
|
|
private:
|
|
|
|
coff::symbol_t* m_sym;
|
|
|
|
std::vector<std::uint8_t> m_data;
|
|
|
|
coff::image_t* m_img;
|
|
|
|
coff::section_header_t* m_scn;
|
|
|
|
sym_type_t m_dcmp_type;
|
|
|
|
};
|
|
|
|
} // namespace theo::decomp
|