Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions de4dot.code/deobfuscators/Agile_NET/ProxyCallFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
*/

using System;
using de4dot.blocks;
using dnlib.DotNet;
using dnlib.DotNet.Emit;

Expand All @@ -41,6 +42,17 @@ public void FindDelegateCreator() {
SetDelegateCreatorMethod(method);
return;
}
// Sometimes, the method name is different.
if (method.IsStatic && !method.IsStaticConstructor && DotNetUtils.IsMethod(method, "System.Void", "(System.Int32)")) {
var instrs = DotNetUtils.GetInstructions(method.Body.Instructions, 0, OpCodes.Ldsflda,
OpCodes.Ldc_I4, OpCodes.Ldarg_0, OpCodes.Add, OpCodes.Call, OpCodes.Call);
if (instrs != null && instrs[1].GetLdcI4Value() == 0x2000001
// This is important to differentiate from SmartAssembly
&& DotNetUtils.CallsMethod(method, "System.Byte[] System.Convert::FromBase64String(System.String)")) {
SetDelegateCreatorMethod(method);
return;
}
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions de4dot.code/deobfuscators/Confuser/ProxyCallFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public IEnumerable<FieldDef> Fields {
var fields = new List<FieldDef>(fieldToMethods.GetKeys());
var type = DotNetUtils.GetModuleType(module);
if (fields.Count > 0 && type != null) {
foreach (var field in type.Fields) {
var fieldType = field.FieldType.TryGetTypeDef();
foreach (var tField in type.Fields) {
var fieldType = tField.FieldType.TryGetTypeDef();
if (fieldType != null && delegateTypesDict.ContainsKey(fieldType))
fields.Add(field);
fields.Add(tField);
}
}
return fields;
Expand Down
Loading