Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: cmake -B build

- name: Build and link objects
run: cmake --build build --config Release
run: cmake --build build

windows_latest_build_cmake_msvc:
runs-on: windows-latest
Expand All @@ -42,4 +42,4 @@ jobs:
run: cmake -B build

- name: Build and link objects
run: cmake --build build --config Release
run: cmake --build build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ venv
env
bin
build
docker-build

# Exclude Compiled Files
*.a
Expand Down
78 changes: 7 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,76 +1,12 @@
cmake_minimum_required( VERSION 3.22 )
cmake_minimum_required( VERSION 3.14 FATAL_ERROR )

project( omega-zero CXX )

set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_STANDARD 20 )
set( CMAKE_C_STANDARD_REQUIRED ON )
set( CMAKE_C_STANDARD 99 )

set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin )

set( INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include )
include_directories( ${PROJECT_NAME} ${INCLUDE_DIR} )

set( SOURCE_DIR ${CMAKE_SOURCE_DIR}/src )
set( SOURCES
# CXX Sources
${SOURCE_DIR}/elf.cpp
${SOURCE_DIR}/filetypes.cpp
${SOURCE_DIR}/main.cpp
${SOURCE_DIR}/parser.cpp
${SOURCE_DIR}/pe32.cpp
${SOURCE_DIR}/util.cpp
# CXX Headers
${INCLUDE_DIR}/elf.hpp
${INCLUDE_DIR}/filetypes.hpp
${INCLUDE_DIR}/parser.hpp
${INCLUDE_DIR}/pe32.hpp
${INCLUDE_DIR}/util.hpp
)

add_executable( ${PROJECT_NAME} ${SOURCES} )
set_target_properties(
${PROJECT_NAME}
PROPERTIES
PREFIX vpr-
)

target_compile_options(
${PROJECT_NAME}
PRIVATE $<$<C_COMPILER_ID:MSVC>:/W4>
$<$<C_COMPILER_ID:MSVC>:/O2>
$<$<C_COMPILER_ID:MSVC>:/DNDEBUG>
$<$<C_COMPILER_ID:GNU>:-Ofast>
$<$<C_COMPILER_ID:GNU>:-Wall>
$<$<C_COMPILER_ID:GNU>:-Wextra>
$<$<C_COMPILER_ID:GNU>:-Werror>
$<$<C_COMPILER_ID:GNU>:-Wshadow>
$<$<C_COMPILER_ID:GNU>:-Wpedantic>
$<$<C_COMPILER_ID:GNU>:-Wconversion>
$<$<C_COMPILER_ID:GNU>:-ffunction-sections>
$<$<C_COMPILER_ID:GNU>:-ffast-math>
$<$<C_COMPILER_ID:GNU>:-funroll-loops>
$<$<C_COMPILER_ID:GNU>:-fPIE>
$<$<C_COMPILER_ID:AppleClang>:-Ofast>
$<$<C_COMPILER_ID:AppleClang>:-Wall>
$<$<C_COMPILER_ID:AppleClang>:-Wextra>
$<$<C_COMPILER_ID:AppleClang>:-Werror>
$<$<C_COMPILER_ID:AppleClang>:-Wshadow>
$<$<C_COMPILER_ID:AppleClang>:-Wpedantic>
$<$<C_COMPILER_ID:AppleClang>:-Wconversion>
$<$<C_COMPILER_ID:AppleClang>:-ffunction-sections>
$<$<C_COMPILER_ID:AppleClang>:-ffast-math>
$<$<C_COMPILER_ID:AppleClang>:-funroll-loops>
$<$<C_COMPILER_ID:AppleClang>:-fPIE>
)

target_link_options(
${PROJECT_NAME}
PRIVATE $<$<C_COMPILER_ID:MSVC>:/MANIFEST:NO>
$<$<C_COMPILER_ID:GNU>:-s>
$<$<C_COMPILER_ID:AppleClang>:-s>
)
project( omega-zero
VERSION 1.1.0
LANGUAGES C )

install(
TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
add_subdirectory( omega-zero )
49 changes: 14 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,26 @@
# Creator: VPR
# Created: January 27th, 2022
# Updated: March 11th, 2022
# Updated: March 14th, 2025

FROM ubuntu:20.04
FROM ubuntu:22.04

# Set env to avoid user input interruption during installation
ENV TZ=America/Chicago
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install deps
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends sudo \
zsh \
zsh-autosuggestions \
git \
curl \
wget \
vim \
tree \
tmux \
zip \
unzip \
pkg-config \
m4 \
libtool \
automake \
gnutls-bin \
make \
build-essential \
gcc \
gcc-multilib \
g++-multilib \
mingw-w64 \
mingw-w64-common \
mingw-w64-i686-dev \
mingw-w64-x86-64-dev \
gdb \
cscope

# Change login shell to zsh
RUN chsh -s /bin/zsh $(whoami)
RUN apt-get install -y --no-install-recommends \
cmake \
build-essential \
gcc \
gcc-multilib \
g++-multilib \
mingw-w64 \
mingw-w64-common \
mingw-w64-i686-dev \
mingw-w64-x86-64-dev

# Create omega-zero user && working directory
RUN mkdir -p /home/oz
ENV HOME=/home/root
WORKDIR /home/oz/omega-zero
WORKDIR /opt/omega-zero
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
This project aims to provide a tool for the stripping of the
section-header information of 32/64 bit ELF and PE32 executables.

## Docker Environment
## Building with a Docker Environment
```
# Download repo
git clone https://github.com/0xvpr/vpr-omega-zero
cd vpr-omega-zero

# Create docker image
# Create docker image and build with cmake
chmod +x docker-build.sh && ./docker-build.sh
chmod +x docker-start.sh && ./docker-start.sh
```

## Build instructions
Expand All @@ -48,7 +47,7 @@ cmake.exe --build build
vpr-omega-zero path/to/executable [ path/to/other/executable ]
```

## Testing (Needs improvement)
## Testing TODO
```bash
# chmod +x compare.sh && ./compare.sh # deprecated
```
3 changes: 2 additions & 1 deletion compile_flags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-std=c++2a
--target=x86_64-pc-linux-gnu
-std=c99
-Iinclude
-Wall
-Wextra
Expand Down
18 changes: 12 additions & 6 deletions docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/bin/sh
#!/bin/bash

# Creator: VPR
# Created: March 11th, 2022
# Updated: March 11th, 2022
# Created by: VPR
# Created: March 11th, 2022

# Updated by: VPR
# Updated: March 15th, 2025

set -e pipefail
set -e errexit
set -e nounset
set -e xtrace

ROOT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

DOCKER_FILE="Dockerfile"
DOCKER_IMAGE="omega-zero-dev"
USER_MOD="$(id -u):$(id -g)"

# Builds docker image using root Dockerfile
docker build -f "${__docker_file}" -t "${DOCKER_IMAGE}" .
# Builds docker image using root Dockerfile and runs cmake for installation
[[ $(docker image ls -a | grep omega-zero-dev) ]] || docker build -f "${DOCKER_FILE}" -t "${DOCKER_IMAGE}" .
docker run -u ${USER_MOD} -itv ${ROOT_DIR}:/opt/omega-zero "${DOCKER_IMAGE}" /bin/bash -c "cmake -B docker-build && cmake --build docker-build"
9 changes: 0 additions & 9 deletions docker-start.sh

This file was deleted.

68 changes: 0 additions & 68 deletions include/elf.hpp

This file was deleted.

27 changes: 0 additions & 27 deletions include/filetypes.hpp

This file was deleted.

29 changes: 0 additions & 29 deletions include/parser.hpp

This file was deleted.

Loading