Skip to content

Commit

Permalink
[windows] Use windows.NewLazySystemDLL to (possibly) prevent DLL hija…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomanic committed Aug 18, 2018
1 parent 68ff0e2 commit ef54649
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/common/common_windows.go
Expand Up @@ -47,10 +47,10 @@ const (
)

var (
Modkernel32 = windows.NewLazyDLL("kernel32.dll")
ModNt = windows.NewLazyDLL("ntdll.dll")
ModPdh = windows.NewLazyDLL("pdh.dll")
ModPsapi = windows.NewLazyDLL("psapi.dll")
Modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
ModNt = windows.NewLazySystemDLL("ntdll.dll")
ModPdh = windows.NewLazySystemDLL("pdh.dll")
ModPsapi = windows.NewLazySystemDLL("psapi.dll")

ProcGetSystemTimes = Modkernel32.NewProc("GetSystemTimes")
ProcNtQuerySystemInformation = ModNt.NewProc("NtQuerySystemInformation")
Expand Down
2 changes: 1 addition & 1 deletion net/net_windows.go
Expand Up @@ -13,7 +13,7 @@ import (
)

var (
modiphlpapi = windows.NewLazyDLL("iphlpapi.dll")
modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
procGetExtendedTCPTable = modiphlpapi.NewProc("GetExtendedTcpTable")
procGetExtendedUDPTable = modiphlpapi.NewProc("GetExtendedUdpTable")
)
Expand Down
2 changes: 1 addition & 1 deletion process/process_windows.go
Expand Up @@ -25,7 +25,7 @@ const (
)

var (
modpsapi = windows.NewLazyDLL("psapi.dll")
modpsapi = windows.NewLazySystemDLL("psapi.dll")
procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo")
)

Expand Down

0 comments on commit ef54649

Please sign in to comment.