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

Include Image Base in ISegment.UpdateOffsets #236

Closed
Washi1337 opened this issue Dec 22, 2021 · 0 comments · Fixed by #346
Closed

Include Image Base in ISegment.UpdateOffsets #236

Washi1337 opened this issue Dec 22, 2021 · 0 comments · Fixed by #346
Milestone

Comments

@Washi1337
Copy link
Owner

Problem Description

Some structures in the PE file format (such as CodeSegment and TlsDirectory) rely on a virtual address (VA) rather than a relative virtual address (RVA). Currently, ISegment.UpdateOffsets only takes a file offset and an RVA. This means that implementations for these structures need an additional ImageBase property or similar for them to be able to implement their Write method. This is problematic, as this is not necessarily in sync with image base of the underlying PE image. Rebasing a PE image would therefore require manually setting all these image bases of these models.

Proposal

Add an ulong imageBase parameter to ISegment.UpdateOffsets. This ensures that all segments can be rebased automatically without any need for a separate property or similar that needs to stay in sync.

Alternatives

None yet.

Additional context

This would be a breaking change for all classes that implement ISegment. This might be a minor issue though, since not many users will actually implement their own version of ISegment.

@Washi1337 Washi1337 added this to the 5.0.0 milestone Mar 29, 2022
@Washi1337 Washi1337 linked a pull request Aug 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant