Make sure string decrypter methods aren't detected as inlined methods
This commit is contained in:
parent
870dab5b90
commit
83dc4226c1
|
@ -268,7 +268,7 @@ done:
|
|||
void removeInlinedMethods() {
|
||||
if (!options.InlineMethods || !options.RemoveInlinedMethods)
|
||||
return;
|
||||
removeInlinedMethods(DsInlinedMethodsFinder.find(module));
|
||||
removeInlinedMethods(DsInlinedMethodsFinder.find(module, staticStringInliner.Methods));
|
||||
}
|
||||
|
||||
public override IEnumerable<int> getStringDecrypterMethods() {
|
||||
|
|
|
@ -22,12 +22,16 @@ using Mono.Cecil;
|
|||
|
||||
namespace de4dot.code.deobfuscators.DeepSea {
|
||||
static class DsInlinedMethodsFinder {
|
||||
public static List<MethodDefinition> find(ModuleDefinition module) {
|
||||
public static List<MethodDefinition> find(ModuleDefinition module, IEnumerable<MethodDefinition> notInlinedMethods) {
|
||||
var notInlinedMethodsDict = new Dictionary<MethodDefinition, bool>();
|
||||
foreach (var method in notInlinedMethods)
|
||||
notInlinedMethodsDict[method] = true;
|
||||
|
||||
var inlinedMethods = new List<MethodDefinition>();
|
||||
|
||||
foreach (var type in module.GetTypes()) {
|
||||
foreach (var method in type.Methods) {
|
||||
if (DsMethodCallInliner.canInline(method))
|
||||
if (!notInlinedMethodsDict.ContainsKey(method) && DsMethodCallInliner.canInline(method))
|
||||
inlinedMethods.Add(method);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user