libvmi / python

LibVMI Python bindings
http://libvmi.com/
GNU Lesser General Public License v3.0
28 stars 22 forks source link

ffi.error: struct x86_regs: wrong size for field 'cs_arbytes' (cdef says 4, but C compiler says 8). #77

Open cotic opened 2 years ago

cotic commented 2 years ago

In -> fix_vmi_event_version branch (I have not tried the other branches yet).

Running -> python3 singlestep-event.py win7-hvm

I get the following error:

Waiting for events
Exception ignored from cffi callback <function generic_event_callback at 0x7f52a4724af0>:
Traceback (most recent call last):
  File "/home/andrew/Documents/python-virtual-environments/LibVMI/lib/python3.8/site-packages/libvmi-3.5-py3.8-linux-x86_64.egg/libvmi/event.py", line 72, in generic_event_callback
    event_response = event.py_callback(event.vmi, event)
  File "singlestep-event.py", line 25, in callback
    pprint(event.to_dict())
  File "/home/andrew/Documents/python-virtual-environments/LibVMI/lib/python3.8/site-packages/libvmi-3.5-py3.8-linux-x86_64.egg/libvmi/event.py", line 239, in to_dict
    d = super().to_dict()
  File "/home/andrew/Documents/python-virtual-environments/LibVMI/lib/python3.8/site-packages/libvmi-3.5-py3.8-linux-x86_64.egg/libvmi/event.py", line 141, in to_dict
    'rax': hex(self.x86_regs.rax),
ffi.error: struct x86_regs: wrong size for field 'cs_arbytes' (cdef says 4, but C compiler says 8). fix it or use "...;" as the last field in the cdef for struct x86_regs to make it flexible

The C version of the same example appears to work fine :

Waiting for events... Single-step event: VCPU:0 GFN 26ca GLA 00000000826ca5a6 Waiting for events... Single-step event: VCPU:0 GFN 26ca GLA 00000000826ca5b0 Waiting for events... Single-step event: VCPU:0 GFN 26ca GLA 00000000826ca5b4 Waiting for events... Single-step event: VCPU:0 GFN 26ca GLA 00000000826ca5b8 Waiting for events... Single-step event: VCPU:0 GFN 26ca GLA 00000000826ca5bd