Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pe/pe.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type DataDirectoryEntry = dpe.DataDirectory

func resolveOptionalHeader(machine uint16, r peReader, offset uint32) (OptionalHeader, error) {
switch machine {
case dpe.IMAGE_FILE_MACHINE_I386:
case dpe.IMAGE_FILE_MACHINE_I386, dpe.IMAGE_FILE_MACHINE_ARM:
return readStruct[optionalHeader32](r, offset)
case dpe.IMAGE_FILE_MACHINE_AMD64, dpe.IMAGE_FILE_MACHINE_ARM64:
return readStruct[optionalHeader64](r, offset)
Expand All @@ -132,7 +132,7 @@ func resolveOptionalHeader(machine uint16, r peReader, offset uint32) (OptionalH
func checkMagic(oh OptionalHeader, machine uint16) bool {
var expectedMagic uint16
switch machine {
case dpe.IMAGE_FILE_MACHINE_I386:
case dpe.IMAGE_FILE_MACHINE_I386, dpe.IMAGE_FILE_MACHINE_ARM:
expectedMagic = 0x010B
case dpe.IMAGE_FILE_MACHINE_AMD64, dpe.IMAGE_FILE_MACHINE_ARM64:
expectedMagic = 0x020B
Expand Down
16 changes: 16 additions & 0 deletions pe/pe_arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause

//go:build windows

package pe

import (
dpe "debug/pe"
)

type optionalHeaderForGOARCH = optionalHeader32

const (
expectedMachineForGOARCH = dpe.IMAGE_FILE_MACHINE_ARM
)