Skip to content

Instantly share code, notes, and snippets.

@mrT4ntr4
Created April 21, 2020 20:03
Show Gist options
  • Save mrT4ntr4/f7fab85266019eadd71bfd11f47b980f to your computer and use it in GitHub Desktop.
Save mrT4ntr4/f7fab85266019eadd71bfd11f47b980f to your computer and use it in GitHub Desktop.
Implementation of encrypt Function for Position Challenge from Reversing.kr
'''Position
Find the Name when the Serial is 76876-77776
This problem has several answers.
Password is ***p
'''
import string
name = ['g','o','l','u']
serial = [None]*11
serial[5] = '-'
'''
for v6 in string.printable:
v7 = (v6 & 1) + 5;
v48 = ((v6 >> 4) & 1) + 5;
v42 = ((v6 >> 1) & 1) + 5;
v44 = ((v6 >> 2) & 1) + 5;
v46 = ((v6 >> 3) & 1) + 5;
'''
'''proof
v6 = 96
v46 = ((v6 >> 3) & 1) + 5;
print v46
v8 = 115
v38 = ((v8 >> 3) & 1) + 1
print v38
'''
v6=ord('g')
v8=ord('o')
v20=ord('l')
v22=ord('u')
v7 = (v6 & 1) + 5
v9 = ((v8 >> 2) & 1) + 1
v11 = v7+v9
serial[0] = v11
v46 = ((v6 >> 3) & 1) + 5
v38 = ((v8 >> 3) & 1) + 1
v13 = v46+v38
serial[1] = v13
v42 = ((v6 >> 1) & 1) + 5
v40 = ((v8 >> 4) & 1) + 1
v15 = v42+v40
serial[2] = v15
v44 = ((v6 >> 2) & 1) + 5
v34 = (v8 & 1) + 1
v17 = v44+v34
serial[3] = v17
v48 = ((v6 >> 4) & 1) + 5
v36 = ((v8 >> 1) & 1) + 1
v19 = v48+v36
serial[4] = v19
v20 = ord('l')
v21 = (v20 & 1) + 5
v49 = ((v20 >> 4) & 1) + 5
v43 = ((v20 >> 1) & 1) + 5
v45 = ((v20 >> 2) & 1) + 5
v47 = ((v20 >> 3) & 1) + 5
v22 = ord('u')
v35 = (v22 & 1) + 1
v41 = ((v22 >> 4) & 1) + 1
v37 = ((v22 >> 1) & 1) + 1
v23 = ((v22 >> 2) & 1) + 1
v39 = ((v22 >> 3) & 1) + 1
serial[6] = v21+v23
serial[7] = v47+v39
serial[8] = v43+v41
serial[9] = v45+v35
serial[10]= v49+v37
serial = [str(x) for x in serial]
print "".join(name)
print "".join(serial)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment