fix(lib): windows PE format detection offset being a u32

This commit is contained in:
Erica Marigold 2025-01-16 08:48:48 +00:00
parent f4f05b8264
commit 14860284da
Signed by: DevComp
GPG key ID: 429EF1C337871656

View file

@ -21,7 +21,7 @@ return function(binaryContents: buffer): ExecutableDetectionResult?
if buffer.readstring(binaryContents, 0, 2) == DOS_HEADER then
-- File was a DOS executable, jump to PE header to get the magic offset
local signatureOffset = buffer.readu8(binaryContents, PE_HEADER_OFFSET)
local signatureOffset = buffer.readu32(binaryContents, PE_HEADER_OFFSET)
-- Check if the value at the magic offset was the PE magic signature
if buffer.readstring(binaryContents, signatureOffset, 4) == PE_MAGIC_SIGNATURE then