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
""" | |
Detects opaque predicates in single basic blocks, see: http://zubcic.re/blog/experimenting-with-z3-proving-opaque-predicates and https://github.com/JonathanSalwan/Triton/blob/master/src/examples/python/proving_opaque_predicates.py | |
Sample output: | |
(angr)sam@angr-dev:~/code/opaque_predicates$ python test.py | |
WARNING | 2016-08-20 21:13:33,412 | angr.path_group | No completion state defined for path group; stepping until all paths deadend | |
0x0: xor eax, eax | |
0x2: jo 9 |
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
import itertools | |
import string | |
length = 4 | |
strings = map(''.join, itertools.product(string.uppercase + string.lowercase,repeat=(length-2))) | |
numbers = [1,2,3,4,5,6,7,8,9,0] | |
lolwat = [] | |
fuckit = [] | |
for s in strings: | |
for i in xrange(len(s) + 1): |
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
work_count = 0 # track one notion of "time taken" | |
def addtoset(theset,index,elt): | |
if not (elt in theset[index]): | |
theset[index] = [elt] + theset[index] | |
return True | |
return False | |
def parse(tokens,grammar): | |
global work_count |