Skip to content

Instantly share code, notes, and snippets.

@carnal0wnage
Forked from sixdub/DllByteEncode.ps1
Last active September 18, 2017 16:17
Show Gist options
  • Save carnal0wnage/bd593a34fe39805eec29 to your computer and use it in GitHub Desktop.
Save carnal0wnage/bd593a34fe39805eec29 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