Skip to content

Instantly share code, notes, and snippets.

@sixdub
Last active August 29, 2015 14:14
Show Gist options
  • Save sixdub/fc8ad412d845ca2b340b to your computer and use it in GitHub Desktop.
Save sixdub/fc8ad412d845ca2b340b to your computer and use it in GitHub Desktop.
function Invoke-DllByteEncode
{
#Encoder used to take a dll and turn it into a base64 encoded byte array for Powersploit's
#Invoke-ReflectivePEInjection
Param(
[Parameter(Position = 0)]
[String]
$InputPath,
[Parameter(Position = 1)]
[String]
$OutputPath=$InputPath+".bin"
)
$Content = Get-Content -Path $InputPath -Encoding Byte
$Base64 = [System.Convert]::ToBase64String($Content)
$Base64 | Out-File $OutputPath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment