Patent ID: 8739119

Claim:
A method for inserting code into .Net program, comprising the steps of: compiling source code of a .NET program to generate a .NET executable file based on the source code; writing information of an external DLL and encryption and decryption functions of the DLL to import table of a the .Net executable file; enabling a new address and copying the content of the import address table of the .Net executable file to the new address; adding the address of the functions to be inserted after the copied content of the import address table to form a new import address table, in which the address of the new import address table is the new address; changing offset address of entry point of the .Net executable file to address of the new import address table; and modifying flag in header of metadata table of the Net executable file to enable the .Net executable file to meet certification requirements when being executed, wherein the modified flag indicates a mixed code set of assembly and IL instructions.