Skip to content

Commit

Permalink
Remove watermarking process
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamranardo committed Aug 31, 2017
1 parent 905bb2d commit 43a7e7e
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions Confuser.Core/ConfuserEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,32 +299,6 @@ public static class ConfuserEngine {
if (!marker.IsMarked(cctor))
marker.Mark(cctor, null);
}

context.Logger.Debug("Watermarking...");
foreach (ModuleDefMD module in context.Modules) {
TypeRef attrRef = module.CorLibTypes.GetTypeRef("System", "Attribute");
var attrType = new TypeDefUser("", "ConfusedByAttribute", attrRef);
module.Types.Add(attrType);
marker.Mark(attrType, null);

var ctor = new MethodDefUser(
".ctor",
MethodSig.CreateInstance(module.CorLibTypes.Void, module.CorLibTypes.String),
MethodImplAttributes.Managed,
MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);
ctor.Body = new CilBody();
ctor.Body.MaxStack = 1;
ctor.Body.Instructions.Add(OpCodes.Ldarg_0.ToInstruction());
ctor.Body.Instructions.Add(OpCodes.Call.ToInstruction(new MemberRefUser(module, ".ctor", MethodSig.CreateInstance(module.CorLibTypes.Void), attrRef)));
ctor.Body.Instructions.Add(OpCodes.Ret.ToInstruction());
attrType.Methods.Add(ctor);
marker.Mark(ctor, null);

var attr = new CustomAttribute(ctor);
attr.ConstructorArguments.Add(new CAArgument(module.CorLibTypes.String, Version));

module.CustomAttributes.Add(attr);
}
}

static void CopyPEHeaders(PEHeadersOptions writerOptions, ModuleDefMD module) {
Expand Down

1 comment on commit 43a7e7e

@mol
Copy link

@mol mol commented on 43a7e7e Aug 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference this was done to avoid an issue where Windows Defender would cause Mailbird to take a long time to start - likely due to some malware using ConfuserEx and Microsoft adding a signature check for it in Defender.

Please sign in to comment.