Skip to content

Commit

Permalink
Fix AmbiguousMatchException in Get-ProcAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdea committed Jun 11, 2018
1 parent 44f6805 commit 6f1e90f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions letmein.ps1
@@ -1,5 +1,5 @@
#
# letmein.ps1 1.0 - PowerShell Stager for Metasploit Framework
# letmein.ps1 1.1 - PowerShell Stager for Metasploit Framework
# Copyright (c) 2017-2018 Marco Ivaldi <raptor@0xdeadbeef.info>
#
# "You know who I pray to? Joe Pesci. Two reasons: First of all,
Expand Down Expand Up @@ -158,7 +158,8 @@ function Local:Get-ProcAddress

# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle = $UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
# Specify parameters to avoid AmbiguousMatchException on recent Windows versions
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [Type[]] @([System.Runtime.InteropServices.HandleRef], [String]))

# Get a handle to the module specified
$Kern32Handle = $GetModuleHandle.Invoke($null, @($Module))
Expand Down

0 comments on commit 6f1e90f

Please sign in to comment.