-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.go
49 lines (40 loc) · 1.24 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package pelican
type Arch string
const (
Arch386 = "386"
ArchAmd64 = "amd64"
)
// PeInfo contains the architecture of a binary file
//
// For command `PeInfo`
type PeInfo struct {
Arch Arch `json:"arch"`
VersionProperties map[string]string `json:"versionProperties"`
AssemblyInfo *AssemblyInfo `json:"assemblyInfo"`
DependentAssemblies []*AssemblyIdentity `json:"dependentAssemblies"`
Imports []string `json:"imports"`
}
func (pi *PeInfo) RequiresElevation() bool {
if pi.AssemblyInfo == nil {
return false
}
switch pi.AssemblyInfo.RequestedExecutionLevel {
case "requireAdministrator", "highestAvailable":
return true
default:
return false
}
}
type AssemblyInfo struct {
Identity *AssemblyIdentity `json:"identity"`
Description string `json:"description"`
RequestedExecutionLevel string `json:"requestedExecutionLevel,omitempty"`
}
type AssemblyIdentity struct {
Name string `json:"name"`
Version string `json:"version"`
Type string `json:"type"`
ProcessorArchitecture string `json:"processorArchitecture,omitempty"`
Language string `json:"language,omitempty"`
PublicKeyToken string `json:"publicKeyToken,omitempty"`
}