feat: add navigation-parity extensions for Function/BasicBlock/BinaryView#16
Merged
Merged
Conversation
…View Mirrors the object-navigation surface of the official Python binding on the durable hand-written layer, closing the most-used ergonomics gaps the generated binding leaves open (GetFunctionByAddress requires an explicit platform; the generated layer exposes no __contains__/__getitem__/get_ascii_string_at analogs). Function (function.py): __contains__(int) by block span, __contains__(BasicBlock) by owning-function identity, instructions generator over basic blocks. BasicBlock (basicblock.py): __contains__ half-open [Start,End), __getitem__ returns null on miss instead of raising. BinaryView (binaryview.py): get_function_at (platform match + first-at-address fallback), __contains__ via segment lookup, get_ascii_string_at (raw-byte scan, minLength-gated), and view-level instructions/llil_instructions/mlil_instructions/ hlil_instructions lazy generators. All generators are lazy (yield); English comments cite the Python source line each member mirrors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors the object-navigation surface of the official Python binding on the durable hand-written layer, closing the most-used ergonomics gaps the generated binding leaves open (
GetFunctionByAddressrequires an explicit platform; no__contains__/__getitem__/get_ascii_string_atanalogs).function.py):__contains__(int)by block span,__contains__(BasicBlock)by owning-function identity,instructionsgenerator over basic blocks.basicblock.py):__contains__half-open[Start,End),__getitem__returns null on miss instead of raising.binaryview.py):get_function_at(platform match + first-at-address fallback),__contains__via segment lookup,get_ascii_string_at(raw-byte scan, minLength-gated), and view-levelinstructions/llil_instructions/mlil_instructions/hlil_instructionslazy generators.All generators are lazy (
yield); comments cite the Python source line each member mirrors.Verification: 1:1 parity E2E tests in the external harness (9 BinaryView + 5 Function + 4 BasicBlock cases) — 18 green.