Skip to content

Instantly share code, notes, and snippets.

@JFreegman
Created February 13, 2017 07:17
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 JFreegman/7dbd3de96b8af435c75aca094c7cafe8 to your computer and use it in GitHub Desktop.
Save JFreegman/7dbd3de96b8af435c75aca094c7cafe8 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
key = 'kw6PZq3Zd;ekR[_1'
ret = ''
for i, ch in enumerate(key):
ecx = i + 1
edx = 0x66666667
eax = ecx
eax = edx * eax
eax = eax & 0xffffffff
edx = eax >> 32
edx >>= 3
eax = ecx
eax >>= 0x1f
edx -= eax
eax = edx
eax <<= 2
eax += edx
eax <<= 2
edx = ecx
edx -= eax
eax = edx
print eax
eax ^= ord(ch)
ret += chr(eax)
print ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment