Created
April 7, 2012 10:39
-
-
Save amtal/2327355 to your computer and use it in GitHub Desktop.
DCPU16 obfuscator/trick showcase/interpreter acid test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Code Obfuscator | |
; | |
; The loader has nice properties shorter versions don't: | |
; 1. doesn't touch registers or stack | |
; 2. can be based anywhere via 'set a,stub' | |
; 3. exercises interpreters ;) | |
:stub xor [begin],0x5eed | |
mul [2+a],25173 ; Grogono LCG | |
add [2+a],13849 | |
add [1+a],1 | |
ifg end,[1+a] | |
set pc,a | |
; The obfuscated code should toggle a between 0 and 0xFFFF, forever. | |
; (Unless the assembler or interpreter are buggy.) | |
:begin dat 0xdaee | |
dat 0xf121 | |
dat 0x5124 | |
dat 0x0ea3 | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment