1. 8

  2. 4

    I got very curious about the allusion to self checksumming in the article. I found this write up (http://www.wincent.com/a/about/wincent/weblog/archives/2006/04/a_farewell_to_s.php) which contains a brief description of how this can be done, and some challenges that the OS can present to such checksumming.

    In summary, the challenge is that the checksum for the code needs to be included in the code, leading to a chicken-and-egg problem. This author “cheated” by storing the checksum in a set location of the code which they zeroed out when computing the checksum. This way the numbers actually did not affect the final value.

    1. 3

      The author doesn’t name the technique, but it’s straightforward code instrumentation. Albeit a covert, performance conscious one.


      It was popular before debugging facilities were added to the operating system. The PC architecture has the INT 3 interrupt for inserting breakpoints. Some HLLs implement their profiling extensions by patching the bytecode in this manner.