mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-30 12:51:48 +08:00
Merge remote-tracking branch
'origin/GP-6333_ghidorahrex_ARM_thumb_BranchWritePC_fix--SQUASHED' into Ghidra_12.1 (Closes #8585)
This commit is contained in:
@@ -235,11 +235,12 @@ macro LoadWritePC(addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Branch depends on version
|
# Branch depends on version
|
||||||
|
# ONLY USED IN ARMinstructions.sinc for thumb use BranchWritePC
|
||||||
macro ALUWritePC(addr) {
|
macro ALUWritePC(addr) {
|
||||||
@if defined(VERSION_7)
|
@if defined(VERSION_7)
|
||||||
BXWritePC(addr);
|
BXWritePC(addr);
|
||||||
@else
|
@else
|
||||||
BranchWritePC(addr);
|
BranchWritePC(addr & 0xfffffffc);
|
||||||
@endif
|
@endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1202,10 +1202,11 @@ with : ARMcondCk=1 {
|
|||||||
Hrd0002 = Hrd0002 + Hrm0305;
|
Hrd0002 = Hrd0002 + Hrm0305;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Destination is PC
|
||||||
:add^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x44 & Hrd0002 & Hrm0305 & hrd0002=7 & h1=1
|
:add^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x44 & Hrd0002 & Hrm0305 & hrd0002=7 & h1=1
|
||||||
{
|
{
|
||||||
build ItCond;
|
build ItCond;
|
||||||
dest:4 = Hrd0002 + Hrm0305;
|
dest:4 = (Hrd0002 + Hrm0305) & 0xfffffffe; # Simple branch, mask off the last bit
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest);
|
||||||
goto [pc];
|
goto [pc];
|
||||||
}
|
}
|
||||||
@@ -2653,18 +2654,20 @@ macro th_set_carry_for_lsr(op1,shift_count) {
|
|||||||
Hrd0002 = Hrm0305;
|
Hrd0002 = Hrm0305;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Destination is PC
|
||||||
:mov^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x46 & Hrm0305 & Hrd0002 & hrd0002=7 & h1=1
|
:mov^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x46 & Hrm0305 & Hrd0002 & hrd0002=7 & h1=1
|
||||||
{
|
{
|
||||||
build ItCond;
|
build ItCond;
|
||||||
dest:4 = Hrm0305;
|
dest:4 = Hrm0305 & 0xfffffffe; # Simple branch, mask off the last bit
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest);
|
||||||
goto [pc];
|
goto [pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Destination is PC
|
||||||
:mov^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x46 & Hrm0305 & rm0306=14 & Hrd0002 & hrd0002=7 & h1=1
|
:mov^ItCond Hrd0002,Hrm0305 is TMode=1 & ItCond & op8=0x46 & Hrm0305 & rm0306=14 & Hrd0002 & hrd0002=7 & h1=1
|
||||||
{
|
{
|
||||||
build ItCond;
|
build ItCond;
|
||||||
dest:4 = Hrm0305;
|
dest:4 = Hrm0305 & 0xfffffffe; # Simple branch, mask off the last bit
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest);
|
||||||
return [pc];
|
return [pc];
|
||||||
}
|
}
|
||||||
@@ -3664,7 +3667,7 @@ macro BitReverse(val) {
|
|||||||
cpsr = *ptr;
|
cpsr = *ptr;
|
||||||
ptr = ptr - 4;
|
ptr = ptr - 4;
|
||||||
dest:4 = *ptr;
|
dest:4 = *ptr;
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest & 0xfffffffe); # Simple branch, mask off the last bit
|
||||||
return [pc];
|
return [pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3676,7 +3679,7 @@ macro BitReverse(val) {
|
|||||||
ptr = ptr - 4;
|
ptr = ptr - 4;
|
||||||
dest:4 = *ptr;
|
dest:4 = *ptr;
|
||||||
part2Rd0003 = ptr;
|
part2Rd0003 = ptr;
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest & 0xfffffffe); # Simple branch, mask off the last bit
|
||||||
return [pc];
|
return [pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3687,7 +3690,7 @@ macro BitReverse(val) {
|
|||||||
cpsr = *ptr;
|
cpsr = *ptr;
|
||||||
ptr = ptr + 4;
|
ptr = ptr + 4;
|
||||||
dest:4 = *ptr;
|
dest:4 = *ptr;
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest & 0xfffffffe); # Simple branch, mask off the last bit
|
||||||
return [pc];
|
return [pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3699,7 +3702,7 @@ macro BitReverse(val) {
|
|||||||
ptr = ptr + 4;
|
ptr = ptr + 4;
|
||||||
dest:4 = *ptr;
|
dest:4 = *ptr;
|
||||||
part2Rd0003 = ptr + 4;
|
part2Rd0003 = ptr + 4;
|
||||||
BranchWritePC(dest);
|
BranchWritePC(dest & 0xfffffffe); # Simple branch, mask off the last bit
|
||||||
return [pc];
|
return [pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user