Repository navigation
Use a single generator for the core and plugin Python bindings - #8593
Conversation
fuzyll
left a comment
There was a problem hiding this comment.
I built and tested this and the only issue I could find was a mismatch in WarpProcessor. You can do this to repro:
bnpython3 -c 'from binaryninja.warp import WarpProcessor; WarpProcessor()' File ".../binaryninja/warp/warp.py", line 625, in __init__
self.handle = warpcore.BNWARPNewProcessor(ctypes.c_int(included_data), ctypes.c_int(included_functions), worker_count)
File ".../binaryninja/warp/_warpcore.py", line 1768, in BNWARPNewProcessor
result = _BNWARPNewProcessor(includedData, includedFunctions, workerCount)
ctypes.ArgumentError: argument 1: TypeError: 'c_int' object cannot be interpreted as an integer
The new bindings correctly require 8-bit enum arguments, but the constructor still supplies ctypes.c_int. Otherwise, this looks good to me.
I don't know if the right move is to merge this and have someone else handle that edge case, or if we can just include a quick fix and then merge. So, consider this comment "conditional acceptance", and let me know if I should just file an issue.
|
Good catch. The fix for that is to remove the two I audited the rest of the various Python bindings and didn't see anywhere else with the same issue. |
95b7ae2 to
b33757d
Compare
WARP, shared cache and kernel cache each had their own fork of generator.cpp. The forks had missed the core generator's later fixes, including correctly sized enums, and each worked around core types differently, down to duplicating core enums in the plugin headers. Now every binding uses the core generator. A plugin passes `CORE_HEADER`, and types declared there are imported from the core bindings rather than redefined.
b33757d to
ff711ea
Compare
WARP, shared cache and kernel cache each had their own fork of generator.cpp. The forks had missed the core generator's later fixes, including correctly sized enums, and each worked around core types differently, down to duplicating core enums in the plugin headers.
Now every binding uses the core generator. A plugin passes
CORE_HEADER, and types declared there are imported from the core bindings rather than redefined.