Created
April 23, 2018 09:31
-
-
Save yhuag/ffbc65ac6303ce2dca7bcf543ca2757a to your computer and use it in GitHub Desktop.
pin demonstration
This file contains 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
import os | |
def testChar(_char): | |
os.system("echo '"+_char+"' | ../../../pin -t obj-intel64/inscount0.so -- ~/Downloads/break") | |
def getInstr(): | |
return os.popen("cat inscount.out").read() | |
ascii_list = [chr(x) for x in range(48,127)] | |
ans = "" | |
while ans[-1] != '}': | |
curr_instr = 0 | |
max_instr = 0 | |
max_char = '' | |
for j,char in enumerate(ascii_list): | |
testChar(ans + char) | |
curr_instr = int(getInstr()[6:-1]) | |
if (curr_instr > max_instr): | |
max_instr = curr_instr | |
max_char = char | |
ans = ans + max_char | |
print(">>> Current Answer:", ans) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment