mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 04:27:38 +02:00
Implemented verification for if-ltz/gez/gtz/lez
git-svn-id: https://smali.googlecode.com/svn/trunk@586 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -495,6 +495,11 @@ public class MethodAnalyzer {
|
|||||||
case IF_EQZ:
|
case IF_EQZ:
|
||||||
case IF_NEZ:
|
case IF_NEZ:
|
||||||
return handleIfEqzNez(analyzedInstruction);
|
return handleIfEqzNez(analyzedInstruction);
|
||||||
|
case IF_LTZ:
|
||||||
|
case IF_GEZ:
|
||||||
|
case IF_GTZ:
|
||||||
|
case IF_LEZ:
|
||||||
|
return handleIfz(analyzedInstruction);
|
||||||
}
|
}
|
||||||
assert false;
|
assert false;
|
||||||
return false;
|
return false;
|
||||||
@ -1330,6 +1335,20 @@ public class MethodAnalyzer {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean handleIfz(AnalyzedInstruction analyzedInstruction) {
|
||||||
|
SingleRegisterInstruction instruction = (SingleRegisterInstruction)analyzedInstruction.instruction;
|
||||||
|
|
||||||
|
RegisterType registerType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterA());
|
||||||
|
assert registerType != null;
|
||||||
|
|
||||||
|
if (registerType.category == RegisterType.Category.Unknown) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
checkRegister(registerType, Primitive32BitCategories);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private static void checkRegister(RegisterType registerType, EnumSet validCategories) {
|
private static void checkRegister(RegisterType registerType, EnumSet validCategories) {
|
||||||
if (!validCategories.contains(registerType.category)) {
|
if (!validCategories.contains(registerType.category)) {
|
||||||
//TODO: add expected categories to error message
|
//TODO: add expected categories to error message
|
||||||
|
Reference in New Issue
Block a user