mirror of
https://github.com/revanced/smali.git
synced 2025-05-20 16:07:05 +02:00
Implemented verification for unary operation instructions
git-svn-id: https://smali.googlecode.com/svn/trunk@616 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
85e17ca30a
commit
1483cc8e68
@ -705,6 +705,61 @@ public class MethodAnalyzer {
|
|||||||
case INVOKE_INTERFACE_RANGE:
|
case INVOKE_INTERFACE_RANGE:
|
||||||
handleInvokeRange(analyzedInstruction, INVOKE_INTERFACE);
|
handleInvokeRange(analyzedInstruction, INVOKE_INTERFACE);
|
||||||
return;
|
return;
|
||||||
|
case NEG_INT:
|
||||||
|
case NOT_INT:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Integer);
|
||||||
|
return;
|
||||||
|
case NEG_LONG:
|
||||||
|
case NOT_LONG:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.LongLo);
|
||||||
|
return;
|
||||||
|
case NEG_FLOAT:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Float);
|
||||||
|
return;
|
||||||
|
case NEG_DOUBLE:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.DoubleLo);
|
||||||
|
return;
|
||||||
|
case INT_TO_LONG:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.LongLo);
|
||||||
|
return;
|
||||||
|
case INT_TO_FLOAT:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Float);
|
||||||
|
return;
|
||||||
|
case INT_TO_DOUBLE:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.DoubleLo);
|
||||||
|
return;
|
||||||
|
case LONG_TO_INT:
|
||||||
|
case DOUBLE_TO_INT:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.Integer);
|
||||||
|
return;
|
||||||
|
case LONG_TO_FLOAT:
|
||||||
|
case DOUBLE_TO_FLOAT:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.Float);
|
||||||
|
return;
|
||||||
|
case LONG_TO_DOUBLE:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.DoubleLo);
|
||||||
|
return;
|
||||||
|
case FLOAT_TO_INT:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Integer);
|
||||||
|
return;
|
||||||
|
case FLOAT_TO_LONG:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.LongLo);
|
||||||
|
return;
|
||||||
|
case FLOAT_TO_DOUBLE:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.DoubleLo);
|
||||||
|
return;
|
||||||
|
case DOUBLE_TO_LONG:
|
||||||
|
handleUnaryOp(analyzedInstruction, WideLowCategories, RegisterType.Category.LongLo);
|
||||||
|
return;
|
||||||
|
case INT_TO_BYTE:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Byte);
|
||||||
|
return;
|
||||||
|
case INT_TO_CHAR:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Char);
|
||||||
|
return;
|
||||||
|
case INT_TO_SHORT:
|
||||||
|
handleUnaryOp(analyzedInstruction, Primitive32BitCategories, RegisterType.Category.Short);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2172,7 +2227,15 @@ public class MethodAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleUnaryOp(AnalyzedInstruction analyzedInstruction, EnumSet validSourceCategories,
|
||||||
|
RegisterType.Category destRegisterCategory) {
|
||||||
|
TwoRegisterInstruction instruction = (TwoRegisterInstruction)analyzedInstruction.instruction;
|
||||||
|
|
||||||
|
getAndCheckSourceRegister(analyzedInstruction, instruction.getRegisterB(), validSourceCategories);
|
||||||
|
|
||||||
|
setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction,
|
||||||
|
RegisterType.getRegisterType(destRegisterCategory, null));
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean checkArrayFieldAssignment(RegisterType.Category arrayFieldCategory,
|
private static boolean checkArrayFieldAssignment(RegisterType.Category arrayFieldCategory,
|
||||||
RegisterType.Category instructionCategory) {
|
RegisterType.Category instructionCategory) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user