Skip to content

Commit

Permalink
Fix windows pe format
Browse files Browse the repository at this point in the history
Signed-off-by: Joeky <[email protected]>
  • Loading branch information
joeky888 committed Jul 1, 2024
1 parent 89a953e commit e56cd9f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,16 @@ func regularFile(filename string) {
}
}

print(" x86")
if peekLe(contentByte[magic+4:], 2) != 0x14c {
print("-64")
// Ref: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
switch peekLe(contentByte[magic+4:], 2) {
case 0x1c0:
print(" arm")
case 0xaa64:
print(" aarch64")
case 0x14c:
print(" Intel 80386")
case 0x8664:
print(" amd64")
}
case lenb > 50 && HasPrefix(contentByte, "BM") &&
Equal(contentByte[6:10], "\x00\x00\x00\x00"):
Expand Down

0 comments on commit e56cd9f

Please sign in to comment.