Commit 48cfbe09 authored by swift_gan's avatar swift_gan Committed by swift_gan

tweak asm

parent 80c60326
...@@ -18,7 +18,15 @@ U32 InstructionA64<InstStruct>::size() { ...@@ -18,7 +18,15 @@ U32 InstructionA64<InstStruct>::size() {
//Unknow //Unknow
A64_UNKNOW::A64_UNKNOW(STRUCT_A64(UNKNOW) &inst) : InstructionA64(&inst) { A64_UNKNOW::A64_UNKNOW(STRUCT_A64(UNKNOW) &inst) : InstructionA64(&inst) {
inst_backup = inst; decode(&inst);
}
void A64_UNKNOW::decode(A64_STRUCT_UNKNOW *inst) {
inst_backup = *inst;
}
void A64_UNKNOW::assembler() {
set(inst_backup);
} }
//PC Rel Inst //PC Rel Inst
......
...@@ -188,6 +188,10 @@ namespace SandHook { ...@@ -188,6 +188,10 @@ namespace SandHook {
return true; return true;
} }
void decode(A64_STRUCT_UNKNOW *inst) override;
void assembler() override;
private: private:
STRUCT_A64(UNKNOW) inst_backup; STRUCT_A64(UNKNOW) inst_backup;
}; };
......
...@@ -18,7 +18,7 @@ CodeRelocateA64::CodeRelocateA64(AssemblerA64 &assembler) : CodeRelocate(assembl ...@@ -18,7 +18,7 @@ CodeRelocateA64::CodeRelocateA64(AssemblerA64 &assembler) : CodeRelocate(assembl
} }
void CodeRelocateA64::relocate(void *startPc, void *toPc, Addr len) throw(ErrorCodeException) { void CodeRelocateA64::relocate(void *startPc, void *toPc, Addr len) throw(ErrorCodeException) {
__ finish();
} }
void CodeRelocateA64::relocate(Instruction<Base> *instruction, void *toPc) throw(ErrorCodeException) { void CodeRelocateA64::relocate(Instruction<Base> *instruction, void *toPc) throw(ErrorCodeException) {
...@@ -33,6 +33,8 @@ void CodeRelocateA64::relocate(Instruction<Base> *instruction, void *toPc) throw ...@@ -33,6 +33,8 @@ void CodeRelocateA64::relocate(Instruction<Base> *instruction, void *toPc) throw
CASE(CBZ_CBNZ) CASE(CBZ_CBNZ)
CASE(LDR_LIT) CASE(LDR_LIT)
CASE(ADR_ADRP) CASE(ADR_ADRP)
default:
__ Emit(instruction);
} }
} }
......
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