1
0
mirror of synced 2024-11-18 12:57:12 +01:00
ImHex/include/views/view_disassembler.hpp
WerWolv dbbc525174
Added Plugin support (#102)
* Build refactoring and initial plugin support

* Possibly fixed linux / mac build

* Added libdl to libglad build script

* Add glfw to imgui dependencies

* Refactored common functionality into "libimhex" for plugins

* Added plugin loading and example plugin

* Added proper API for creating a custom view and a custom tools entry with plugins
2020-12-22 18:10:01 +01:00

50 lines
1.2 KiB
C++

#pragma once
#include "helpers/disassembler.hpp"
#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;
size_t size;
std::string bytes;
std::string mnemonic;
std::string operators;
};
class ViewDisassembler : public View {
public:
explicit ViewDisassembler(prv::Provider* &dataProvider);
~ViewDisassembler() override;
void drawContent() override;
void drawMenu() override;
private:
prv::Provider* &m_dataProvider;
bool m_shouldInvalidate = false;
u64 m_baseAddress = 0;
u64 m_codeRegion[2] = { 0 };
bool m_shouldMatchSelection = false;
Architecture m_architecture = Architecture::ARM;
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;
};
}