ocaml / flexdll

a dlopen-like API for Windows
Other
97 stars 30 forks source link

Correct the parsing of /n COFF lib headers #94

Closed dra27 closed 2 years ago

dra27 commented 2 years ago

COFF defines any archive header beginning with / as special. Before, we assumed that if the header was neither / nor // then it must be /n and parsed accordingly. That breaks with the new /<XFGHASH>/ header in the Windows 11 SDK.

The fact the new header begins with / means it should not just be interpreted as an object - the solution I've gone with here is to harden the parsing of /n to ignore headers where n is not a positive decimal integer.