Preserve the original order of the sections#203
Preserve the original order of the sections#203batuzovk wants to merge 1 commit intotrailofbits:masterfrom
Conversation
COFF symbol table references sections by their index. We need to present them to the users in the original order, or they won't be able to use symbols from the COFF table correctly.
|
ntdll.dll.gz is an example of where the initial implementation fails. This .dll comes from wine32 distribution. It uses COFF symbols (and those can be encountered in PE files despite what MS documentation suggests), and the ordering of sections is different from the original file. For example, in I looked through the source, and the sort seem to be redundant here. |
|
Hmm, good catch -- I added this back in #128 to make an implementation of Authenticode easier, but I can see why this would cause problems. This would be a major behavioral change, so we'd probably need to do it with a 3.x release. But that's OK IMO. I'll give this a more in-depth review later today 🙂 |
COFF symbol table references sections by their index. We need to present them to the users in the original order, or they won't be able to use symbols from the COFF table correctly.