Skip to content

Instantly share code, notes, and snippets.

@InersIn
Created December 5, 2022 01:30
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 InersIn/ce8a94174b4d78f20911477c2979340a to your computer and use it in GitHub Desktop.
Save InersIn/ce8a94174b4d78f20911477c2979340a to your computer and use it in GitHub Desktop.
from subprocess import Popen, PIPE
for x in range(599):
a = Popen(["objdump", "-d", f"bertanya{x}"], stdout=PIPE)
stdout = a.communicate()[0].splitlines()
n = stdout[16].decode().split(" ")
logic = n[-5]
num2 = n[-1].split(",")[0][1:]
num = stdout[17].decode().split(" ")[-1].split(",")[0][1:]
n = ""
if "add" in logic:
n = int(num, 16)-int(num2, 16)
elif "sub" in logic:
n = int(num, 16)+int(num2, 16)
if n>256:
n-=256
elif "xor" in logic:
n = int(num, 16)^int(num2, 16)
else:
print(logic, f"bertanya{x}")
exit()
print(chr(n),end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment