Skip to content

Conversation

@cherepanov74
Copy link
Contributor

Since there is a code that parses debug directory, I thought it's a good idea to add some value that can be used for checking if the PE binary build as "reproducible build". If this value is set, it means that timestamps in the PE can be replaced with some other values to achieve reproducibility.

Here is more information about reproducible builds:
https://devblogs.microsoft.com/oldnewthing/20180103-00/?p=97705
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format?redirectedfrom=MSDN#debug-type

Copy link

@ITAYC0HEN ITAYC0HEN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are looking good. Thank you! :)
very useful

size_t pdb_path_len;
char* pdb_path = NULL;

set_integer(0, pe->object, "is_reproducible_build");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to set this to zero here? What happens if the debug directory entry (or something else we check later on) is corrupt. In this case a user can get an incorrect value (pe.is_reproducible_build would be zero) when it should be UNDEFINED at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion. Now the value is set to 0 only when debug directory is empty or when code successfully iterated through all entries

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

Successfully merging this pull request may close these issues.

3 participants