You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
881 B
39 lines
881 B
#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 {
|
|
enum decomp_type_t { none, instr_split };
|
|
|
|
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,
|
|
decomp_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;
|
|
decomp_type_t m_dcmp_type;
|
|
};
|
|
} // namespace theo::decomp
|