Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cotic opened this issue Dec 15, 2021 · 0 comments

Comments

@cotic
Copy link

cotic commented Dec 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant