You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Aug 5, 2022
64-bit PE is set by the optional header magic number,
not by the machine field.
Fixesgolang#54250
Change-Id: I4d01bc08553780d5470e63f0b17bbd968323e5d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/421394
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Looking at the code in https://github.com/golang/go/blob/master/src/debug/pe/file.go#L325 , the debug/pe package detects if the file is a PE or PE+ executable by looking at the machine type. However, this is not fully correct. According to the spec (https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-image-only), the type of executable should be determined by looking at the first two bytes of the optional header, which should contain 0x10b for PE or 0x20b for PE+. Probably if the machine is 64 bits that implies PE+, but maybe that's not true in 100% of the cases.
What did you expect to see?
NA
What did you see instead?
NA
The text was updated successfully, but these errors were encountered: