Skip to content

Commit

Permalink
ci: install UPX (#11)
Browse files Browse the repository at this point in the history
* ci: install UPX

Signed-off-by: William Woodruff <william@trailofbits.com>

* CMake: check for UPX

Signed-off-by: William Woodruff <william@trailofbits.com>

* CMakeLists: add upx goat exe

Signed-off-by: William Woodruff <william@trailofbits.com>

* pegoat-upx-packed-authenticode

Signed-off-by: William Woodruff <william@trailofbits.com>

---------

Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw authored Aug 2, 2023
1 parent 4d35302 commit 5a91508
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: install deps
run: |
choco install upx
- name: build32
run: |
mkdir build32
Expand Down
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if(NOT MSVC)
message(FATAL_ERROR "pegoat can only be built on Windows")
endif()

find_program(PEGOAT_UPX "upx")
if(NOT PEGOAT_UPX)
message(FATAL_ERROR "pegoat needs UPX")
endif()

add_executable(pegoat goat.cpp)

# An executable with no stack guards.
Expand Down Expand Up @@ -84,3 +89,25 @@ add_custom_command(
COMMAND
powershell -ExecutionPolicy Bypass -File sign-nested.ps1 $<TARGET_FILE:pegoat-authenticode-nested>
)

add_executable(pegoat-upx-packed goat.cpp)
add_custom_command(
TARGET
POST_BUILD
pegoat-upx-packed
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
COMMAND
upx $<TARGET_FILE:pegoat-upx-packed>
)

add_executable(pegoat-upx-packed-authenticode goat.cpp)
add_custom_command(
TARGET
POST_BUILD
pegoat-upx-packed-authenticode
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
COMMAND
upx $<TARGET_FILE:pegoat-upx-packed-authenticode>
COMMAND
powershell -ExecutionPolicy Bypass -File sign.ps1 $<TARGET_FILE:pegoat-upx-packed-authenticode>
)

0 comments on commit 5a91508

Please sign in to comment.