Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/python
from capstone import *
for i in range(1,9):
f = open("pieces/fragment_%d.dat" % i)
md = Cs(CS_ARCH_X86,CS_MODE_32)
n = 0
for x in md.disasm(f.read(),0x1000):
if n > 5:
break
else:
print "%d %s\t%s" % (i,x.mnemonic,x.op_str)
n += 1
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment