Re: [PATCH v46 0/2] MR10295: Fix ImageGetDigestStream
hi retested again a range of images and I still get discrepancies from native imagehlp behavior as you didn't add any FIXME for non supported DigestLeve, I assumed you meant all values of DigestLevel are supported some examples of missed callbacks: * DigestLevel = 0,4, callback with chunks inside IMPORT data directory * DigestLevel = 2,6, callback with section containing DEBUG directory also what's suspicious in the code is that there are actions taken when data directory points at the very start of a section (when checking respective VirtualAddress: fields), but a data directory could point to anywhere within a section (for the record, it looks a bit ackward to save ntheader+section headers, modify the memory of mapping, then restore the saved bits in the mapping; it would be more straightforward to keep mapping as is, and allocate a buffer for tempering ntheader + section headers and pass pointer into this buffer in the callback; this is how native behaves BTW); this would save one copy and avoids dirty:ing the mapping again, I strongly suggest to start with a unique value of DigestLevel (the one you need to support), get it right (and testing native / bultin behavior on all .exe/.dll you can find) (by testing I mean writing a small program that does print, for each callback invocation, size and CRC of passed chunk; using native and builtin imagehlp should produce the very same output) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10295#note_137580
participants (1)
-
eric pouech (@epo)