mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 09:37:05 +08:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
+4
-2
@@ -169,8 +169,10 @@ public class ReturnParameterDB extends ParameterDB {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SourceType getSource() {
|
public SourceType getSource() {
|
||||||
// VARDO: What source-type should be used ?
|
if (dataType == null || Undefined.isUndefined(dataType)) {
|
||||||
return function.getSymbol().getSource();
|
return SourceType.DEFAULT;
|
||||||
|
}
|
||||||
|
return function.getSignatureSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+13
-8
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.program.emulation;
|
package ghidra.program.emulation;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
|
||||||
import ghidra.pcode.emulate.Emulate;
|
import ghidra.pcode.emulate.Emulate;
|
||||||
import ghidra.pcode.emulate.EmulateInstructionStateModifier;
|
import ghidra.pcode.emulate.EmulateInstructionStateModifier;
|
||||||
import ghidra.pcode.emulate.callother.CountLeadingZerosOpBehavior;
|
import ghidra.pcode.emulate.callother.CountLeadingZerosOpBehavior;
|
||||||
@@ -24,8 +26,6 @@ import ghidra.program.model.lang.Register;
|
|||||||
import ghidra.program.model.lang.RegisterValue;
|
import ghidra.program.model.lang.RegisterValue;
|
||||||
import ghidra.program.model.pcode.PcodeOp;
|
import ghidra.program.model.pcode.PcodeOp;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
public class ARMEmulateInstructionStateModifier extends EmulateInstructionStateModifier {
|
public class ARMEmulateInstructionStateModifier extends EmulateInstructionStateModifier {
|
||||||
|
|
||||||
private Register TModeReg;
|
private Register TModeReg;
|
||||||
@@ -37,12 +37,14 @@ public class ARMEmulateInstructionStateModifier extends EmulateInstructionStateM
|
|||||||
super(emu);
|
super(emu);
|
||||||
TModeReg = language.getRegister("TMode");
|
TModeReg = language.getRegister("TMode");
|
||||||
TBreg = language.getRegister("ISAModeSwitch");
|
TBreg = language.getRegister("ISAModeSwitch");
|
||||||
if (TModeReg != null && TBreg == null) {
|
if (TModeReg != null) {
|
||||||
throw new RuntimeException("Expected language " + language.getLanguageID() +
|
if (TBreg == null) {
|
||||||
" to have TB register defined");
|
throw new RuntimeException("Expected language " + language.getLanguageID() +
|
||||||
|
" to have TB register defined");
|
||||||
|
}
|
||||||
|
tMode = new RegisterValue(TModeReg, BigInteger.ONE);
|
||||||
|
aMode = new RegisterValue(TModeReg, BigInteger.ZERO);
|
||||||
}
|
}
|
||||||
tMode = new RegisterValue(TModeReg, BigInteger.ONE);
|
|
||||||
aMode = new RegisterValue(TModeReg, BigInteger.ZERO);
|
|
||||||
|
|
||||||
registerPcodeOpBehavior("count_leading_zeroes", new CountLeadingZerosOpBehavior());
|
registerPcodeOpBehavior("count_leading_zeroes", new CountLeadingZerosOpBehavior());
|
||||||
|
|
||||||
@@ -115,6 +117,9 @@ public class ARMEmulateInstructionStateModifier extends EmulateInstructionStateM
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) throws LowlevelError {
|
public void initialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) throws LowlevelError {
|
||||||
|
if (TModeReg == null) {
|
||||||
|
return; // Thumb mode not supported
|
||||||
|
}
|
||||||
BigInteger tModeValue = BigInteger.ZERO;
|
BigInteger tModeValue = BigInteger.ZERO;
|
||||||
if (contextRegisterValue != null) {
|
if (contextRegisterValue != null) {
|
||||||
tModeValue = contextRegisterValue.getRegisterValue(TModeReg).getUnsignedValueIgnoreMask();
|
tModeValue = contextRegisterValue.getRegisterValue(TModeReg).getUnsignedValueIgnoreMask();
|
||||||
@@ -136,7 +141,7 @@ public class ARMEmulateInstructionStateModifier extends EmulateInstructionStateM
|
|||||||
PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress)
|
PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress)
|
||||||
throws LowlevelError {
|
throws LowlevelError {
|
||||||
if (TModeReg == null) {
|
if (TModeReg == null) {
|
||||||
return;
|
return; // Thumb mode not supported
|
||||||
}
|
}
|
||||||
if (lastPcodeIndex < 0) {
|
if (lastPcodeIndex < 0) {
|
||||||
// ignore fall-through condition
|
// ignore fall-through condition
|
||||||
|
|||||||
Reference in New Issue
Block a user