1#ifndef ROSE_BinaryAnalysis_Disassembler_Aarch32_H
2#define ROSE_BinaryAnalysis_Disassembler_Aarch32_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_ASM_AARCH32
5#include <Rose/BinaryAnalysis/Disassembler/Base.h>
7#include <Rose/BinaryAnalysis/Architecture/BasicTypes.h>
9#include <capstone/capstone.h>
12namespace BinaryAnalysis {
13namespace Disassembler {
19class Aarch32:
public Base {
22 using Ptr = Aarch32Ptr;
27 THUMB = CS_MODE_THUMB,
28 MCLASS = CS_MODE_MCLASS,
33 using Modes = BitFlags<Mode>;
38 bool capstoneOpened_ =
false;
42 explicit Aarch32(
const Architecture::BaseConstPtr&, Modes = Modes());
46 static Ptr instanceA32(
const Architecture::BaseConstPtr&);
49 static Ptr instanceT32(
const Architecture::BaseConstPtr&);
52 static Ptr instance(
const Architecture::BaseConstPtr&);
57 Base::Ptr clone()
const override;
58 SgAsmInstruction* disassembleOne(
const MemoryMap::Ptr&, rose_addr_t startVa, AddressSet *successors=
nullptr)
override;
66 uint32_t bytesToWord(
size_t nBytes,
const uint8_t *bytes);
79 void wrapPrePostIncrement(SgAsmAarch32Instruction*,
const cs_insn&,
const uint32_t insnWord);
83 RegisterDescriptor makeRegister(arm_reg);
89 RegisterDescriptor makeCoprocRegister(
int registerNumber);
92 RegisterDescriptor subRegister(RegisterDescriptor,
int idx);
95 SgAsmType* registerType(RegisterDescriptor);
99 SgAsmType* typeForMemoryRead(
const cs_insn&);
102 uint32_t opcode(
const cs_insn&);
Base class for expressions.
Base class for machine instructions.
Base class for binary types.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
const char * Mode(int64_t)
Convert Rose::AST::cmdline::graphviz_t::Mode enum constant to a string.