Handle call instrs with invalid metadata tokens
This commit is contained in:
parent
4ce90dbfc0
commit
49b2976965
|
@ -470,12 +470,17 @@ namespace de4dot.deobfuscators {
|
|||
|
||||
// May not return all args. The args are returned in reverse order.
|
||||
PushedArgs getPushedArgInstructions(IList<Instruction> instructions, int index) {
|
||||
try {
|
||||
int pushes, pops;
|
||||
DotNetUtils.calculateStackUsage(instructions[index], false, out pushes, out pops);
|
||||
if (pops == -1)
|
||||
return new PushedArgs(0);
|
||||
if (pops != -1)
|
||||
return getPushedArgInstructions(instructions, index, pops);
|
||||
}
|
||||
catch (System.NullReferenceException) {
|
||||
// Here if eg. invalid metadata token in a call instruction (operand is null)
|
||||
}
|
||||
return new PushedArgs(0);
|
||||
}
|
||||
|
||||
// May not return all args. The args are returned in reverse order.
|
||||
PushedArgs getPushedArgInstructions(IList<Instruction> instructions, int index, int numArgs) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user