Hey all,
I'm brand new to CFFI, so this may be a simple question. I've been attempting to get the UCSB's angr tool to work on Windows. For the most part, I can get it working correctly and compiling. However, a module called pyVEX utilizes CFFI to load up a libvex library. Now on to the strange part...
When I attempt to use the library to, say, change some basic assembly into VEX, it usually crashes. However, every so often (maybe 5 times out of 25) it will actually work. I'm not doing anything differently between runs, and in fact can just use a script. Using some print statements I was able to track down the segfaulting to one line:
(line 137 pyvex\__init__.py)
c_irsb = pvc.vex_block_bytes(vex_arch, arch.vex_archinfo, c_bytes + bytes_offset, mem_addr, num_bytes, 1)
where pvc was loaded via the ffi.dlopen call.
I've gone so far as to print out all the arguments to the function and pickle of the calling class and none of that is different between when it succeeds in calling the function and when it fails. It almost feels like ASLR or something is causing the dll to be opened up in a different way each time? idk..
For reference, the code can be found here:
https://github.com/Owlz/pyvex/tree/master/pyvexAnd my installable wheel files for Windows can be found here:
https://github.com/Owlz/angr-Windows/blob/master/README.mdAny help would be appreciated as the non-deterministic nature is driving me bonkers.
Thanks!