-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add premake and prepare main executable
- Loading branch information
Showing
26 changed files
with
1,686 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: win-artifact-build | ||
|
||
on: | ||
push: | ||
branches: [ build ] | ||
|
||
jobs: | ||
build-win64: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: Install Cygwin | ||
# You may pin to the exact commit or the version. | ||
# uses: egor-tensin/setup-cygwin@4f96f9fecb8c952fa32ff791b0a77d93d5191bb4 | ||
uses: egor-tensin/setup-cygwin@v3 | ||
with: | ||
platform: x64 # optional, default is x64 | ||
install-dir: c:\tools\cygwin # optional, default is C:\tools\cygwin | ||
packages: gcc-core binutils make zip libssl-devel # optional | ||
|
||
- name: Checkout with submodules | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
|
||
- name: Compile | ||
run: make | ||
|
||
- name: Compile Windows-only tools and create a ZIP package | ||
run: make zip | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: win-build | ||
path: ./*.zip | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,68 @@ | ||
LIBPE_DIR = lib/libpe | ||
PEV_DIR = src | ||
VERSION = 0.82 | ||
ZIPDIR = pev-$(VERSION)-win | ||
ZIPFILE = $(ZIPDIR).zip | ||
|
||
all: | ||
%: | ||
cd $(LIBPE_DIR) && $(MAKE) $@ | ||
cd $(PEV_DIR) && $(MAKE) $@ | ||
|
||
# Cygwin only | ||
zip: | ||
cd $(PEV_DIR)/windows && $(MAKE) | ||
mkdir -p $(ZIPDIR)/plugins | ||
cp src/build/plugins/*.dll $(ZIPDIR)/plugins/ | ||
echo -ne "plugins_dir=plugins\r\n" > $(ZIPDIR)/pev.conf | ||
cp $(PEV_DIR)/userdb.txt $(ZIPDIR) | ||
cp lib/libpe/libpe.dll $(ZIPDIR)/ | ||
cp /usr/bin/cygwin1.dll $(ZIPDIR)/ | ||
cp /usr/bin/cygcrypto-1*.dll $(ZIPDIR)/ | ||
cp /usr/bin/cygz.dll $(ZIPDIR)/ | ||
cp README.md $(ZIPDIR)/ | ||
cp $(PEV_DIR)/build/*.exe $(ZIPDIR)/ | ||
cp $(PEV_DIR)/windows/run.bat $(ZIPDIR)/ | ||
zip -r $(ZIPFILE) $(ZIPDIR)/* | ||
rm -rf $(ZIPDIR) | ||
# Alternative GNU Make workspace makefile autogenerated by Premake | ||
|
||
ifndef config | ||
config=debug | ||
endif | ||
|
||
ifndef verbose | ||
SILENT = @ | ||
endif | ||
|
||
ifeq ($(config),debug) | ||
pe_config = debug | ||
udis86_config = debug | ||
readpe_config = debug | ||
|
||
else ifeq ($(config),release) | ||
pe_config = release | ||
udis86_config = release | ||
readpe_config = release | ||
|
||
else | ||
$(error "invalid configuration $(config)") | ||
endif | ||
|
||
PROJECTS := pe udis86 readpe | ||
|
||
.PHONY: all clean help $(PROJECTS) | ||
|
||
all: $(PROJECTS) | ||
|
||
pe: | ||
ifneq (,$(pe_config)) | ||
@echo "==== Building pe ($(pe_config)) ====" | ||
@${MAKE} --no-print-directory -C lib/libpe -f Makefile config=$(pe_config) | ||
endif | ||
|
||
udis86: | ||
ifneq (,$(udis86_config)) | ||
@echo "==== Building udis86 ($(udis86_config)) ====" | ||
@${MAKE} --no-print-directory -C lib/libudis86/libudis86 -f Makefile config=$(udis86_config) | ||
endif | ||
|
||
readpe: pe udis86 | ||
ifneq (,$(readpe_config)) | ||
@echo "==== Building readpe ($(readpe_config)) ====" | ||
@${MAKE} --no-print-directory -C src -f Makefile config=$(readpe_config) | ||
endif | ||
|
||
clean: | ||
@${MAKE} --no-print-directory -C lib/libpe -f Makefile clean | ||
@${MAKE} --no-print-directory -C lib/libudis86/libudis86 -f Makefile clean | ||
@${MAKE} --no-print-directory -C src -f Makefile clean | ||
|
||
help: | ||
@echo "Usage: make [config=name] [target]" | ||
@echo "" | ||
@echo "CONFIGURATIONS:" | ||
@echo " debug" | ||
@echo " release" | ||
@echo "" | ||
@echo "TARGETS:" | ||
@echo " all (default)" | ||
@echo " clean" | ||
@echo " pe" | ||
@echo " udis86" | ||
@echo " readpe" | ||
@echo "" | ||
@echo "For more information, see https://github.com/premake/premake-core/wiki" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* vim: set ts=4 sw=4 noet: */ | ||
/* | ||
readpe - the PE file analyzer toolkit | ||
Copyright (C) 2023 readpe authors | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
In addition, as a special exception, the copyright holders give | ||
permission to link the code of portions of this program with the | ||
OpenSSL library under certain conditions as described in each | ||
individual source file, and distribute linked combinations | ||
including the two. | ||
You must obey the GNU General Public License in all respects | ||
for all of the code used other than OpenSSL. If you modify | ||
file(s) with this exception, you may extend this exception to your | ||
version of the file(s), but you are not obligated to do so. If you | ||
do not wish to do so, delete this exception statement from your | ||
version. If you delete this exception statement from all source | ||
files in the program, then also delete it here. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <libpe/pe.h> | ||
|
||
void print_dependencies(pe_ctx_t *ctx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* vim: set ts=4 sw=4 noet: */ | ||
/* | ||
readpe - the PE file analyzer toolkit | ||
Copyright (C) 2023 readpe authors | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
In addition, as a special exception, the copyright holders give | ||
permission to link the code of portions of this program with the | ||
OpenSSL library under certain conditions as described in each | ||
individual source file, and distribute linked combinations | ||
including the two. | ||
You must obey the GNU General Public License in all respects | ||
for all of the code used other than OpenSSL. If you modify | ||
file(s) with this exception, you may extend this exception to your | ||
version of the file(s), but you are not obligated to do so. If you | ||
do not wish to do so, delete this exception statement from your | ||
version. If you delete this exception statement from all source | ||
files in the program, then also delete it here. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <libpe/context.h> | ||
#include <libpe/pe.h> | ||
#include <libpe/resources.h> | ||
#include <libpe/types_resources.h> | ||
#include <libpe/utlist.h> | ||
|
||
void peres_show_nodes(pe_ctx_t *ctx, const pe_resource_node_t *node); | ||
void peres_show_stats(const pe_resource_node_t *node); | ||
void peres_show_list(pe_ctx_t *ctx, const pe_resource_node_t *node); | ||
void peres_save_all_resources(pe_ctx_t *ctx, const pe_resource_node_t *node, bool namedExtract); | ||
void peres_show_version(pe_ctx_t *ctx, const pe_resource_node_t *node); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* vim: set ts=4 sw=4 noet: */ | ||
/* | ||
readpe - the PE file analyzer toolkit | ||
Copyright (C) 2023 readpe authors | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
In addition, as a special exception, the copyright holders give | ||
permission to link the code of portions of this program with the | ||
OpenSSL library under certain conditions as described in each | ||
individual source file, and distribute linked combinations | ||
including the two. | ||
You must obey the GNU General Public License in all respects | ||
for all of the code used other than OpenSSL. If you modify | ||
file(s) with this exception, you may extend this exception to your | ||
version of the file(s), but you are not obligated to do so. If you | ||
do not wish to do so, delete this exception statement from your | ||
version. If you delete this exception statement from all source | ||
files in the program, then also delete it here. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "common.h" | ||
#include <libpe/pe.h> | ||
#include <openssl/pem.h> | ||
|
||
typedef enum { | ||
CERT_FORMAT_TEXT = 1, | ||
CERT_FORMAT_PEM = 2, | ||
CERT_FORMAT_DER = 3 | ||
} cert_format_e; | ||
|
||
typedef struct { | ||
cert_format_e certoutform; | ||
BIO *certout; | ||
} certificate_settings; | ||
|
||
bool stack_cookies(pe_ctx_t *ctx); | ||
void print_securities(pe_ctx_t *ctx); | ||
void parse_certificates(const certificate_settings *options, pe_ctx_t *ctx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* vim: set ts=4 sw=4 noet: */ | ||
/* | ||
readpe - the PE file analyzer toolkit | ||
Copyright (C) 2023 readpe authors | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
In addition, as a special exception, the copyright holders give | ||
permission to link the code of portions of this program with the | ||
OpenSSL library under certain conditions as described in each | ||
individual source file, and distribute linked combinations | ||
including the two. | ||
You must obey the GNU General Public License in all respects | ||
for all of the code used other than OpenSSL. If you modify | ||
file(s) with this exception, you may extend this exception to your | ||
version of the file(s), but you are not obligated to do so. If you | ||
do not wish to do so, delete this exception statement from your | ||
version. If you delete this exception statement from all source | ||
files in the program, then also delete it here. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <libpe/pe.h> | ||
|
||
typedef struct { | ||
unsigned short strsize; | ||
bool offset; | ||
bool section; | ||
} string_settings; | ||
|
||
void print_strings( pe_ctx_t *ctx, const string_settings *options); | ||
|
Oops, something went wrong.