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

Writing PE header #47

Closed
mazegen opened this issue Oct 19, 2015 · 4 comments
Closed

Writing PE header #47

mazegen opened this issue Oct 19, 2015 · 4 comments

Comments

@mazegen
Copy link

mazegen commented Oct 19, 2015

It seems it is not possible to write, for example, the NumberOfSymbols in ImageFileHeader. I could write it in the OnWriterEvent listener using DestinationStream.Write() but that feels clumsy.

Are there plans to add more setters to the ImageFileHeader class?

And thank you for dnlib, awesome work!

@0xd4d
Copy link
Collaborator

0xd4d commented Oct 19, 2015

Since the code doesn't write to PointerToSymbolTable, there's no option to write anything other than 0 to NumberOfSymbols. Do you just want to write to NumberOfSymbols without writing to PointerToSymbolTable?

@mazegen
Copy link
Author

mazegen commented Oct 19, 2015

Yes, I want to store an information there that has nothing to do with symbols.

And I also wonder what is your position on this. Perhaps you think that high-level writes to PE header with garbage values is not right because dnlib should verify the values before they are written, therefore it shall not be allowed, and if one wants to rewrite the header bad enough, he can use the listener.

@0xd4d 0xd4d closed this as completed in 40f146a Oct 19, 2015
@0xd4d
Copy link
Collaborator

0xd4d commented Oct 19, 2015

I think you should be able to write garbage if that's what you want. dnlib shouldn't stop you from doing that.

@mazegen
Copy link
Author

mazegen commented Oct 20, 2015

Many thanks for the fix and the explanation!

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

1 participant