Skip to content
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

BSim fails when attempting to compare with a matching function that originates from an overlay address space #6896

Open
je0xffrey opened this issue Sep 8, 2024 · 3 comments · May be fixed by #6897
Assignees
Labels
Feature: BSim Status: Internal This is being tracked internally by the Ghidra team

Comments

@je0xffrey
Copy link

BSim assumes that a function always lives in the default address space and it only stores the "offset" of that function as the address. No address space information is stored alongside this offset in the FunctionDescription object. The default address space is used to attempt to retrieve the matching function to do a comparison. If the function lives in an overlay address space an error will consistently occur.

To Reproduce

  1. Create an overlay address space in your program
    2024-08-25_19-24
  2. Pick a function that was mapped into this new address space (I picked time and renamed the one in the other address space mapped_time)
  3. Perform a BSim query on one of the functions
    2024-08-25_19-26_1
  4. We successfully find mapped_time as one of the search results
    2024-08-25_19-27
  5. Attempt to compare the two functions and encounter the error
    2024-08-25_19-28

Expected behavior
The BSim tool should be able to compare functions results no matter the address space they live in.

Attachments
Uploading libc with an overlay address space created. For my testing I used the functions time and mapped_time. An error will occur when trying to compare the two functions.
libc.so.6.zip

Environment (please complete the following information):

  • OS: [Ubuntu 18]
  • Java Version: [21.0]
  • Ghidra Version: [11.2]
  • Ghidra Origin: [locally built]
@je0xffrey je0xffrey linked a pull request Sep 8, 2024 that will close this issue
@ryanmkurtz ryanmkurtz added Status: Triage Information is being gathered Feature: BSim labels Sep 9, 2024
@ryanmkurtz ryanmkurtz linked a pull request Sep 9, 2024 that will close this issue
@ghidracadabra ghidracadabra added Status: Prioritize This is currently being prioritized and removed Status: Triage Information is being gathered labels Sep 9, 2024
@ghidracadabra ghidracadabra added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Prioritize This is currently being prioritized labels Sep 19, 2024
@je0xffrey
Copy link
Author

Just checking in, any update on this?

@ghidracadabra
Copy link
Contributor

We should definitely be storing the address space. I haven't had a chance to evaluate the PR yet but I hope to get to it soon.

@je0xffrey
Copy link
Author

Hey @ghidracadabra, Are there any updates for this by chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: BSim Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants