|
From: Yan <ya...@ya...> - 2013-09-23 07:04:46
|
Hey guys, I've written up some python bindings for VEX, to be able to write analysis tools that reason about VEX IR in Python. I just GPL'ed them on github here: https://github.com/zardus/pyvex The bindings are used like, for example: import pyvex irsb = pyvex.IRSB(bytes="\x55\xc3") # translates "push ebp; ret" to VEX IR irsb.pp() # prints the VEX IR for s in irsb.statements(): if type(s) == pyvex.IRStmt.WrTmp: print "Temp %d being written:" % s.tmp s.data.pp() And various things like that. I wrote this to support some static analysis, so it has no working interface to Valgrind at the moment. I think this would be cool, but am not sure it's possible, and I'll start another thread about that. At any rate, if anyone's interested, I'd love to hear your comments, suggestions, and especially your pull requests. I think this could be useful for people doing analysis on this stuff. The code has plenty of issues (speed issues, implementation issues, you name it), which are documented in the README, and is a little heavy on macros because there are a lot of structs to interface to in VEX, but it seems to work :-) - Yan |