21 Sep
2023
21 Sep
'23
6:53 p.m.
On Thu Sep 21 18:00:55 2023 +0000, eric pouech wrote:
it could be interesting to explain where the 0x10000 value comes from and it doesn't look right: each inner loop can add up to sum at most 0x10000 \* 0xffff = 0xffff0000, but the value of sum from a previous loop can be \>= 0x1000 (because of the lo + hi computation) =\> you'll overflow the DWORD of sum reusing tested existing code looks saner to me that reimplementing it The existing implementation from `imagehlp` produced incorrect checksums when I tried it, so I made this hacked up version that calculates the checksum properly.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_46228