2020-11-22 23:07:50 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-12-05 17:32:30 +01:00
|
|
|
#include "helpers/disassembler.hpp"
|
2020-11-22 23:07:50 +01:00
|
|
|
#include "views/view.hpp"
|
|
|
|
|
|
|
|
#include <capstone/capstone.h>
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
namespace prv { class Provider; }
|
|
|
|
|
|
|
|
struct Disassembly {
|
|
|
|
u64 address;
|
|
|
|
u64 offset;
|
2020-11-23 13:10:14 +01:00
|
|
|
size_t size;
|
2020-11-22 23:07:50 +01:00
|
|
|
std::string bytes;
|
2020-11-23 15:22:26 +01:00
|
|
|
std::string mnemonic;
|
|
|
|
std::string operators;
|
2020-11-22 23:07:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class ViewDisassembler : public View {
|
|
|
|
public:
|
|
|
|
explicit ViewDisassembler(prv::Provider* &dataProvider);
|
|
|
|
~ViewDisassembler() override;
|
|
|
|
|
|
|
|
void createView() override;
|
|
|
|
void createMenu() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
prv::Provider* &m_dataProvider;
|
|
|
|
bool m_shouldInvalidate = false;
|
|
|
|
|
|
|
|
u64 m_baseAddress = 0;
|
2020-11-28 16:15:12 +01:00
|
|
|
u64 m_codeRegion[2] = { 0 };
|
|
|
|
bool m_shouldMatchSelection = false;
|
2020-11-22 23:07:50 +01:00
|
|
|
|
2020-12-05 17:32:30 +01:00
|
|
|
Architecture m_architecture = Architecture::ARM;
|
2020-11-22 23:07:50 +01:00
|
|
|
cs_mode m_modeBasicARM = cs_mode(0), m_modeExtraARM = cs_mode(0), m_modeBasicMIPS = cs_mode(0), m_modeBasicPPC = cs_mode(0), m_modeBasicX86 = cs_mode(0);
|
|
|
|
bool m_littleEndianMode = true, m_micoMode = false, m_sparcV9Mode = false;
|
|
|
|
|
|
|
|
std::vector<Disassembly> m_disassembly;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|