Commit aebe7002 authored by swift_gan's avatar swift_gan Committed by swift_gan

add inst type

parent 2c5124f5
......@@ -17,14 +17,22 @@ namespace SandHook {
class InstructionA64 : public Instruction<InstStruct> {
public:
InstStruct mask(InstStruct raw) {
inline InstStruct mask(InstStruct raw) {
return raw & (InstStruct) *this;
}
bool IsPCRelAddressing() {
inline bool IsPCRelAddressing() {
return mask(PCRelAddressingFMask) == PCRelAddressingFixed;
}
inline InstType instType() override {
return A64;
}
inline Arch arch() override {
return arm64;
}
int getImmBranch() {
//TODO
return 0;
......@@ -46,7 +54,7 @@ namespace SandHook {
class A64_ADR_ADRP : public A64_INST_PC_REL {
public:
bool isADRP() {
inline bool isADRP() {
return get().op == 1;
}
......
......@@ -27,6 +27,14 @@ namespace SandHook {
return (void *) this;
}
virtual InstType instType() {
return unkownInst;
}
virtual Arch arch() {
return unkownArch;
}
bool pcRelate() {
return false;
}
......
......@@ -26,14 +26,16 @@ const ADDR PAGE_SIZE = 2 << PAGE_OFFSET;
enum Arch {
arm32,
arm64
arm64,
unkownArch
};
enum InstType {
A32,
thumb16,
thumb32,
A64
A64,
unkownInst
};
template <int SizeInBits>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment