This paper reveals the theoretical aspects behind run-time crypters and describes a reference implementation for Portable Executables.
You can download it from the following link: https://packetstormsecurity.com/files/download/112539/nullsec-pe-crypter.pdf
Source: https://packetstormsecurity.com/files/112539/Hyperion-Implementation-Of-A-PE-Crypter.html

