Skip to content

Instantly share code, notes, and snippets.

@amtal
Created April 7, 2012 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amtal/2327355 to your computer and use it in GitHub Desktop.
Save amtal/2327355 to your computer and use it in GitHub Desktop.
DCPU16 obfuscator/trick showcase/interpreter acid test.
; 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