Created
August 26, 2020 02:59
-
-
Save CreateRemoteThread/7114c2ae082231197347532c7eb2ab80 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
import subprocess | |
rebuildDb = {} | |
for char_pos in range(0,8): | |
for byte_pos in range(0,7): | |
out = ["9","9","9","9","9","9","9","9"] | |
out[char_pos] = ("%d" % byte_pos) | |
outstr = "".join(out) | |
p = subprocess.run(["./main", outstr], capture_output=True) | |
# print("%d:%d:%s" % (char_pos,byte_pos,outstr)) | |
x = bin(int(p.stdout.rstrip()))[2:] | |
if len(x) != 56: | |
x = (56 - len(x)) * "0" + x | |
print(x) | |
q = x.index('1') | |
rebuildDb[q] = (char_pos,byte_pos) | |
# print(q) | |
key = "0000" + bin(3008192072309708)[2:] | |
print(key) | |
in_array = [0,0,0,0,0,0,0,0] | |
print("OK, let's go!") | |
for i in range(0,len(key)): | |
if key[i] == '1': | |
(cpos,bpos) = rebuildDb[i] | |
in_array[cpos] += (1 << bpos) | |
print([chr(c) for c in in_array]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment