11 Star 41 Fork 22

liuzy88/Hider

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Build-DLLs.ps1 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
liuzy 提交于 2019-07-09 15:27 . add upx tool
function Get-HexString
{
param([string] $fileName)
$fileBytes=[System.IO.File]::ReadAllBytes($PSScriptRoot.ToString()+$fileName)
return [System.BitConverter]::ToString($fileBytes)
}
function Get-ByteString
{
param([string] $fileName)
$fileBytes=[System.IO.File]::ReadAllBytes($PSScriptRoot.ToString()+$fileName)
return ($fileBytes)
}
$x86PayloadHex=Get-ByteString '\BuildOutput\x86Payload.dll'
$x86PayloadLen=$x86PayloadHex.Length
$x86PayloadHex=$x86PayloadHex -join ","
$x64PayloadHex=Get-ByteString '\BuildOutput\x64Payload.dll'
$x64PayloadLen=$x64PayloadHex.Length
$x64PayloadHex=$x64PayloadHex -join ","
$output86CFile=$PSScriptRoot.ToString()+"\x86Hider\DLLs_hex.cpp"
$output64CFile=$PSScriptRoot.ToString()+"\x64Hider\DLLs_hex.cpp"
"--------- Started Building x86DLLs script ---------"
New-Item $output86CFile -ItemType file -Force | Out-Null
'#include "stdafx.h"'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'#include "..\Hide\DLLs_hex.h"'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'BYTE tmpx86PayloadByteArr[]={'+($x86PayloadHex.Split("-") -join "")+'};'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'BYTE *x86PayloadByteArr=tmpx86PayloadByteArr;'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'int x86PayloadSize='+$x86PayloadLen+';'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'BYTE *x64PayloadByteArr=tmpx86PayloadByteArr;'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
'int x64PayloadSize=x86PayloadSize;'|Out-File -Encoding utf8 -FilePath $output86CFile -Append
"--------- Started Building x64DLLs script ---------"
New-Item $output64CFile -ItemType file -Force | Out-Null
'#include "stdafx.h"'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'#include "..\Hide\DLLs_hex.h"'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'BYTE tmpx86PayloadByteArr[]={'+($x86PayloadHex.Split("-") -join "")+'};'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'BYTE *x86PayloadByteArr=tmpx86PayloadByteArr;'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'int x86PayloadSize='+$x86PayloadLen+';'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'BYTE tmpx64PayloadByteArr[]={'+($x64PayloadHex.Split("-") -join "")+'};'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'BYTE *x64PayloadByteArr=tmpx64PayloadByteArr;'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
'int x64PayloadSize='+$x64PayloadLen+';'|Out-File -Encoding utf8 -FilePath $output64CFile -Append
"--------- Finished Building-DLLs script ---------"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/liuzy1988/Hider.git
git@gitee.com:liuzy1988/Hider.git
liuzy1988
Hider
Hider
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385