Skip to content

Instantly share code, notes, and snippets.

"""
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
@sam-b
sam-b / generate_strings
Created December 8, 2014 22:29
This is the ugliest thing I've ever created :(
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):
@sam-b
sam-b / parser
Created August 5, 2012 21:02
a parser
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