Self-modifying code: Difference between revisions

Content deleted Content added
Elosiomek (talk | contribs)
mNo edit summary
Use as camouflage: "Code" is a mass noun here, so it's just "standard code", not "a standard code".
Line 142:
 
===Use as camouflage===
Self-modifying code is more complex to analyze than a standard code and can therefore be used as a protection against [[reverse engineering]] and [[software cracking]]. Self-modifying code was used to hide copy protection instructions in 1980s disk-based programs for platforms such as [[IBM PC]] and [[Apple II]]. For example, on an IBM PC (or [[IBM PC compatible|compatible]]), the [[floppy disk]] drive access instruction <code>[[int 0x13]]</code> would not appear in the executable program's image but it would be written into the executable's memory image after the program started executing.
 
Self-modifying code is also sometimes used by programs that do not want to reveal their presence, such as [[computer virus]]es and some [[shellcode]]s. Viruses and shellcodes that use self-modifying code mostly do this in combination with [[polymorphic code]]. Modifying a piece of running code is also used in certain attacks, such as [[buffer overflow]]s.