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

Show File Offset for Currently Selected Address #154

Closed
OothecaPickle opened this issue Mar 10, 2019 · 13 comments
Closed

Show File Offset for Currently Selected Address #154

OothecaPickle opened this issue Mar 10, 2019 · 13 comments
Labels
Type: Enhancement New feature or request
Milestone

Comments

@OothecaPickle
Copy link

OothecaPickle commented Mar 10, 2019

Is there a way to get Ghidra to always show the *file offset (in hex) for the currently selected address somewhere?

@OothecaPickle OothecaPickle added the Type: Question Further information is requested label Mar 10, 2019
@ryanmkurtz
Copy link
Collaborator

Currently there is nothing built-in to do this. The file offset to memory address mapping is lost during import. You would have to write a script to figure out the file offset, which would be specific to your binary's file format.

@ryanmkurtz ryanmkurtz self-assigned this Mar 11, 2019
@OothecaPickle
Copy link
Author

@ryanmkurtz is this something that may be added in a future release?

@ryanmkurtz ryanmkurtz added Type: Enhancement New feature or request and removed Type: Question Further information is requested labels Mar 11, 2019
@ryanmkurtz
Copy link
Collaborator

I have switched this over to an enhancement so we can consider it for a future release.

@ryanmkurtz ryanmkurtz reopened this Mar 11, 2019
@OothecaPickle
Copy link
Author

@ryanmkurtz cool :)

@ryanmkurtz ryanmkurtz removed their assignment Mar 13, 2019
@OothecaPickle
Copy link
Author

@ryanmkurtz was this implemented in v9.0.1?

@ryanmkurtz
Copy link
Collaborator

@OothecaPickle, no, it was not implemented for the patch release.

@ryanmkurtz
Copy link
Collaborator

This has been implemented for 9.1. You can test it out in the master branch.

@ryanmkurtz ryanmkurtz added this to the 9.1 milestone Jul 19, 2019
@OothecaPickle
Copy link
Author

great :)

@oshogbo
Copy link

oshogbo commented Mar 30, 2020

Hym, I don't see where the data are displayed. Can you help me with this?

@ryanmkurtz
Copy link
Collaborator

You have to hover on an address in the listing. There's also a new field in the Memory Map to show where each memory block was mapped from in the file.

@jabedude
Copy link

@ryanmkurtz is this available in the Ghidra API? i.e. converting an address to it's file offset?

@ryanmkurtz
Copy link
Collaborator

ryanmkurtz commented Sep 17, 2021

Yes. From Memory you can get the MemoryBlocks, and then for each block you can get its MemoryBlockSourceInfo, and then you can getFileBytesOffset(Address). You'd just have to loop through each MemoryBlock to see if your address of interest is contained in it before getting its MemoryBlockSourceInfo.

@elig0n
Copy link

elig0n commented Nov 12, 2021

Is there a way to "Goto" the file offset's equivalent address?

cooljeanius added a commit to cooljeanius/ghidra that referenced this issue Sep 20, 2024
…uments to formatting function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
cooljeanius added a commit to cooljeanius/ghidra that referenced this issue Sep 20, 2024
Fix code scanning alert NationalSecurityAgency#154: Wrong type of arguments to formatting function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants