Conversation
89d5228 to
3da3fb0
Compare
|
Update, i added support for memory events: |
|
Update, add support for register events: I have to investigate why the |
|
Entirely possible we never actually set |
|
TODO:
|
|
Rebased on master. |
d3a2ef4 to
33026f4
Compare
|
I think this PR will just grow bigger and bigger if i want to implement all the LibVMI events interface. postponed in a future PR:
|
|
This one is ready for review. |
|
@smaresca when do you think you can have time in the future to review this PR ? Also, don't mind the Travis CI build fail on |
|
I added tests for single step and reg events. I want instead to use the singlestepping instead of emulation. The problem is that this technique is not 100% reliable yet. We need to debug it. |
|
Merging this one. |
This PR aims to add support for Python bindings to Libvmi's events API.
The status is a big WIP that i wrote in a few hours, but so far i managed to have SingleStep events working, with the Python callback !
Example:
Events
I used a class hirarchy to create the Events, it was the most obvious thing to do for the implementation:
Callback
This was the tricky part.
The problem with
CFFIis that you can only call a callback that you have already defined and compiled in the C library:https://cffi.readthedocs.io/en/latest/using.html#extern-python-new-style-callbacks
That's why i defined a generic callback
in
events_cdef.hAnd i used the
event.datato pass some extra data containing a handle to the PythonEventobject, which also contains the user defined Python callback:Wrapping up into the
vmi_event.dataThis way i can get the handle back from the generic callback, and call the real callback:
Results
you can test the example at
examples/singlestep-event.py:Thanks.