Bug fix. Some methods have a body but 0 instrs
This commit is contained in:
parent
f1ff27fd10
commit
5dd6567fc9
|
@ -411,7 +411,7 @@ namespace de4dot {
|
|||
Log.v("Deobfuscating {0} ({1:X8})", method, method.MetadataToken.ToUInt32());
|
||||
Log.indent();
|
||||
|
||||
if (method.HasBody) {
|
||||
if (hasNonEmptyBody(method)) {
|
||||
var blocks = new Blocks(method);
|
||||
|
||||
deob.deobfuscateMethodBegin(blocks);
|
||||
|
@ -434,6 +434,10 @@ namespace de4dot {
|
|||
}
|
||||
}
|
||||
|
||||
bool hasNonEmptyBody(MethodDefinition method) {
|
||||
return method.HasBody && method.Body.Instructions.Count > 0;
|
||||
}
|
||||
|
||||
void deobfuscateStrings(Blocks blocks) {
|
||||
switch (options.StringDecrypterType) {
|
||||
case DecrypterType.None:
|
||||
|
@ -481,7 +485,7 @@ namespace de4dot {
|
|||
Log.v("{0}: {1} ({2:X8})", msg, method, method.MetadataToken.ToUInt32());
|
||||
Log.indent();
|
||||
|
||||
if (method.HasBody) {
|
||||
if (hasNonEmptyBody(method)) {
|
||||
var blocks = new Blocks(method);
|
||||
|
||||
handler(blocks);
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace de4dot.blocks {
|
|||
visited = new Dictionary<BaseBlock, bool>();
|
||||
sorted = new List<BaseBlock>(scopeBlock.BaseBlocks.Count);
|
||||
|
||||
if (scopeBlock.BaseBlocks.Count > 0)
|
||||
search(scopeBlock.BaseBlocks[0]);
|
||||
sorted.Reverse(); // It's in reverse order
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user