-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCapstoneDisassembler.hpp
More file actions
27 lines (22 loc) · 870 Bytes
/
CapstoneDisassembler.hpp
File metadata and controls
27 lines (22 loc) · 870 Bytes
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
#pragma once
#include <vector>
#include <capstone/capstone.h>
#include <string>
class disassembled_instruction_t
{
public:
cs_insn instruction;
[[nodiscard]] std::string to_string() const;
};
/**
* \brief Disassembles a code buffer to assembly instructions.
* \param address The address where disassembling should start
* \param code The buffer pointing to the code to disassemble
* \param code_size The length of the code buffer. If 0, the code will look for the next 0xCC byte to determine code size.
* \return The vector of disassembled instructions
*/
[[nodiscard]] std::vector<disassembled_instruction_t> disassemble(uint64_t address, const uint8_t* code, size_t code_size = 0);
/**
* \brief See the description of the other overload.
*/
[[nodiscard]] std::vector<disassembled_instruction_t> disassemble(uint64_t address, const std::string &code);