Skip to content

Instantly share code, notes, and snippets.

@ymgve
Created December 24, 2016 02:06
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 ymgve/f8d1a489b4567dc7860e1e30237646fc to your computer and use it in GitHub Desktop.
Save ymgve/f8d1a489b4567dc7860e1e30237646fc to your computer and use it in GitHub Desktop.
# for ( i = 0LL; i <= 0xC0DE41; ++i )
# {
# v3 = divide(i, 0x29uLL);
# v4 = pow(v3, 3uLL);
# v5 = add_numbers(v4, v9);
# v6 = multiply(v5, i);
# v9 = mod(v6, 0x41DEADBABEC0FFEEuLL);
# }
import psyco; psyco.full()
def main():
total = 0
for i in xrange(0xc0de42):
if i % 0x100000 == 0:
print hex(i)
t = pow(3, (i / 41), 0x10000000000000000)
t = (t + total) % 0x10000000000000000
t = (t * i) % 0x10000000000000000
total = t % 0x41deadbabec0ffee
if (total >> 40) == 0x334453:
print hex(total)
print "3DS{%016x}" % total
main()
# 3DS{39a667347306e209}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment