Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Source Anti ILDasm Protection (DNLib)

  • Thread starter Gelöschtes Mitglied 144
  • Start date
G

Gelöschtes Mitglied 144

Guest
Lieber MasterOf13FPS Member!

In diesem Thread möchte ich mit dir eine "simple" Anti ILDasm Protection teilen.
C#:
using dnlib.DotNet;

namespace vektus.Protection.Analysis
{
    class AntiILDasmProtection
    {
        
        Public Void ProtectionPhase(Context ctx)
        {
            var ManifestModule = ctx.ManifestModule;
            //Create Ref
            TypeRef supressref = ManifestModule.CorLibTypes.GetTypeRef("System.Runtime.CompilerServices", "SuppressIldasmAttribute");
            var ctorRef = new MemberRefUser(ManifestModule, ".ctor", MethodSig.CreateInstance(ManifestModule.CorLibTypes.Void), supressref);

            var supressattribute = new CustomAttribute(ctorRef);
            //add Attribute
            ManifestModule.CustomAttributes.Add(supressattribute);
        }
    }
}

mfg, vektus!​
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top