Skip to content

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

@cotic

Description

@cotic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions