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

enable parsing from loaded image #312

Open
shuffle2 opened this issue Jun 2, 2022 · 2 comments
Open

enable parsing from loaded image #312

shuffle2 opened this issue Jun 2, 2022 · 2 comments

Comments

@shuffle2
Copy link

shuffle2 commented Jun 2, 2022

Most image formats handled by goblin are stored on disk in a different layout than they'd actually appear in memory if mapped for execution.

At least for PE, pointing goblin at an image that has been loaded into memory results in it erroring out (during processing imports, but i didn't look closer). It would be nice if it Just Worked.

btw, looking at the ImageBase field in the header and comparing to the address of the base of the PE is a reliable way to detect if you're parsing an on-disk image or one which has been loaded.

@m4b
Copy link
Owner

m4b commented Jun 3, 2022

I believe we have the infra necessary to do this, it’s the pe config you pass to parser to eg resolve rvas I believe. It would be neat to perhaps use the heuristic you suggested to enter into an in-memory parsing mode (by setting the flag perhaps ?)

would you be interested in investigating the issue ?

@shuffle2
Copy link
Author

shuffle2 commented Jun 9, 2022

My use case was pretty small so I just rewrote my code (which needed to follow some pointers in the PE) to do the VA translations using the PE headers. It's slower than reading from a mapped image, but it's OK for me for now...so I'm not planning on investing time into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants