Merge pull request #5 from funoverip/master

Surrounding paths with double-quote into PostBuildEvent / Out-Shellcode.ps1 compatible with PowerShell v2
This commit is contained in:
Nick Landers
2017-10-06 11:21:43 -06:00
committed by GitHub
4 changed files with 19 additions and 14 deletions
+5 -5
View File
@@ -96,7 +96,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)bin\NativeLoader_x86.exe</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)bin\NativeLoader_x86.exe"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -113,7 +113,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)bin\NativeLoader_x64.exe</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)bin\NativeLoader_x64.exe"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -133,7 +133,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)bin\NativeLoader_x86.exe</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)bin\NativeLoader_x86.exe"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -153,7 +153,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)bin\NativeLoader_x64.exe</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)bin\NativeLoader_x64.exe"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
@@ -170,4 +170,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+4 -4
View File
@@ -218,7 +218,7 @@
</Message>
</PreBuildEvent>
<PostBuildEvent>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File $(SolutionDir)lib\PowerShell\Out-Shellcode.ps1 $(OutDir)$(TargetName)$(TargetExt) $(OutDir)$(TargetName).map $(SolutionDir)bin\$(TargetName)_x86.bin</Command>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$(SolutionDir)lib\PowerShell\Out-Shellcode.ps1" "$(OutDir)$(TargetName)$(TargetExt)" "$(OutDir)$(TargetName).map" "$(SolutionDir)bin\$(TargetName)_x86.bin"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Extract position independent shellcode</Message>
@@ -382,7 +382,7 @@
</Message>
</PreBuildEvent>
<PostBuildEvent>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File $(SolutionDir)lib\PowerShell\Out-Shellcode.ps1 $(OutDir)$(TargetName)$(TargetExt) $(OutDir)$(TargetName).map $(SolutionDir)bin\$(TargetName)_x86.bin</Command>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$(SolutionDir)lib\PowerShell\Out-Shellcode.ps1" "$(OutDir)$(TargetName)$(TargetExt)" "$(OutDir)$(TargetName).map" "$(SolutionDir)bin\$(TargetName)_x86.bin"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Extract position independent shellcode</Message>
@@ -737,7 +737,7 @@
<Message>Build AdjustStack.asm</Message>
</PreBuildEvent>
<PostBuildEvent>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File $(SolutionDir)lib\PowerShell\Out-Shellcode.ps1 $(OutDir)$(TargetName)$(TargetExt) $(OutDir)$(TargetName).map $(SolutionDir)bin\$(TargetName)_x64.bin</Command>
<Command>powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$(SolutionDir)lib\PowerShell\Out-Shellcode.ps1" "$(OutDir)$(TargetName)$(TargetExt)" "$(OutDir)$(TargetName).map" "$(SolutionDir)bin\$(TargetName)_x64.bin"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Extract position independent shellcode</Message>
@@ -915,4 +915,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+5 -5
View File
@@ -95,7 +95,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)Bin\TestDLL_x86.dll</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)Bin\TestDLL_x86.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -112,7 +112,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)Bin\TestDLL_x64.dll</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)Bin\TestDLL_x64.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -133,7 +133,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)Bin\TestDLL_x86.dll</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)Bin\TestDLL_x86.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -154,7 +154,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>copy /y $(TargetPath) $(SolutionDir)Bin\TestDLL_x64.dll</Command>
<Command>copy /y "$(TargetPath)" "$(SolutionDir)Bin\TestDLL_x64.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
@@ -185,4 +185,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+5
View File
@@ -13,6 +13,11 @@
$OutputFile
)
# PowerShell v2
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
. "$PSScriptRoot\Get-PEHeader.ps1"
$PE = Get-PEHeader $InputExe -GetSectionData