摘要 |
The present invention discloses a method for inserting code into .Net program and an apparatus therefor, relating to the field of information security. The method comprises the steps of: writing information of code to be inserted to import table of a .Net executable file; adding address of the code to be inserted to import address table (IAT) of the .Net executable file to form a new import address table; change offset address of entry point of the .Net executable file to address of the new IAT; and change flag in header of metadata table of the .Net executable file to enable the .Net executable file to meet certification requirements when being executed. The apparatus comprises a writing module, a forming module, and a modification module. The method and apparatus provided by the present invention implement code insertion into .Net executable file without the dependency on assembly and disassembly tools and are easy to use. The problems of low efficiency, poor stability, and poor compatibility in inserting code into .Net executable file can be solved by the present invention.
|