-
Notifications
You must be signed in to change notification settings - Fork 567
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
add BinExport tests #2340
add BinExport tests #2340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good start, I like how BE2_DICT
visualizes our expectations for the breakdown expression
, operand
, etc.. My concern here is that these tests won't catch if an underlying tool (Ghidra, IDA, etc.) changes how it stores expressions, operands, etc. because we our using our expectations to model the data, which as we've learned, isn't consistent across the tools. Your suggestion of generating BinExport files for smaller programs to use for these tests may be a better fit.
I'm working on something using a small ELF file for the tests now. |
tests/test_binexport_accessors.py
Outdated
) | ||
|
||
|
||
def _TODO_test_is_stack_register_expression(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no stack expressions in the small ELF so using the hardcoded BE2 data here
62b6019
to
c662176
Compare
a97afb7
to
7142bf7
Compare
), | ||
), | ||
), | ||
# 00210184 02 68 61 38 ldrb w2,[x0, x1, LSL ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, still a bug in Ghidra? anyway, we can ignore LSL #0
02 68 61 38 ldrb w2, [x0, x1]
02 78 61 38 ldrb w2, [x0, x1, lsl #0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah ghidra is definitely missing the #0
constant, at least the BinExport is. locally i have a fix, but of course it would be nice for this to be fixed upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommend we merge this and keep making changes to the BinExport2 PR as necessary.
sounds good to me |
WIP to discuss the approach
Is this to brittle / confusing or does it make sense?
Checklist