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

[BugFix]Fix LDR LIT thumb32

parent 911c490a
...@@ -120,6 +120,10 @@ Off T32_LDR_LIT::GetImmPCOffset() { ...@@ -120,6 +120,10 @@ Off T32_LDR_LIT::GetImmPCOffset() {
return Get()->U == add ? Get()->imm12 : -Get()->imm12; return Get()->U == add ? Get()->imm12 : -Get()->imm12;
} }
Addr T32_LDR_LIT::GetImmPCOffsetTarget() {
return ALIGN((Addr) GetPC() + offset, 4);
}
void T32_LDR_LIT::OnOffsetApply(Off offset) { void T32_LDR_LIT::OnOffsetApply(Off offset) {
this->offset = offset; this->offset = offset;
if (offset >= 0) { if (offset >= 0) {
...@@ -153,7 +157,6 @@ void T32_LDR_LIT::Assemble() { ...@@ -153,7 +157,6 @@ void T32_LDR_LIT::Assemble() {
} }
T32_MOV_MOVT_IMM::T32_MOV_MOVT_IMM(void *inst) : InstructionT32(inst) { T32_MOV_MOVT_IMM::T32_MOV_MOVT_IMM(void *inst) : InstructionT32(inst) {
} }
......
...@@ -199,6 +199,8 @@ namespace SandHook { ...@@ -199,6 +199,8 @@ namespace SandHook {
Off GetImmPCOffset() override; Off GetImmPCOffset() override;
Addr GetImmPCOffsetTarget() override;
void OnOffsetApply(Off offset) override; void OnOffsetApply(Off offset) override;
void Disassemble() override; void Disassemble() override;
......
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