r3xq1 Posted November 3, 2021 Posted November 3, 2021 var module = ModuleDefMD.Load(@"C:\Temp\DemoDLL.dll"); var type = module.GetTypes().FirstOrDefault(t => t.Name == "Demo"); // Create the Main signature var main = new MethodDefUser("Main", MethodSig.CreateStatic(module.CorLibTypes.Void, new SZArraySig(module.CorLibTypes.String))) { Attributes = MethodAttributes.Static, ImplAttributes = MethodImplAttributes.IL | MethodImplAttributes.Managed }; // Add Main param main.ParamDefs.Add(new ParamDefUser("args", 1)); // Create Main body var mainBody = new CilBody(); main.Body = mainBody; // Instance of Execute method var exec = type.Methods.FirstOrDefault(m => m.Name == "Execute"); var exec = type.Methods.FirstOrDefault(m => m.Name == "Execute"); // - This Line Execute How add 2 arguments to the Execute(string line, string key)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now