1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-09-23 19:08:23 +02:00

Version 1.08 with public source code release.

This commit is contained in:
icex2 2020-10-03 20:56:55 +02:00
parent 656148121d
commit 762bf140c0
555 changed files with 55502 additions and 3 deletions

45
.clang-format Normal file
View File

@ -0,0 +1,45 @@
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'false'
AlignTrailingComments: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'true'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Linux
BreakBeforeTernaryOperators: 'false'
BreakStringLiterals: 'true'
ColumnLimit: '80'
ContinuationIndentWidth: '4'
IncludeBlocks: Preserve
IndentCaseLabels: 'true'
IndentPPDirectives: None
IndentWidth: '2'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
Language: Cpp
MaxEmptyLinesToKeep: '1'
PointerAlignment: Right
ReflowComments: 'true'
SortIncludes: 'true'
SpaceAfterCStyleCast: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '1'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
TabWidth: '2'
UseTab: Never

10
.dockerignore Normal file
View File

@ -0,0 +1,10 @@
.idea
build
.vscode
*.iml
*.ipr
*.iws
.DS_Store
tmp
utils
cmake-build-debug

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.vscode
build/
cmake-build-debug/
.idea/
.DS_Store

56
CHANGELOG.md Normal file
View File

@ -0,0 +1,56 @@
# Release history
## 1.08
* Documentation updates
* Public release, working hooks: mk3, exc, x2, zero, nx, nx2, pro, pro2
## 1.07
* Bugfix nx2hook usb thumb drives not being detected on all kernel versions correctly
* Include piubtn library and api (piu pro button board) in distribution for SGL
* Various documentation improvements
* Various minor bugfixes and improvements
## 1.06
* nx2hook: Add hook library for NX2
* pumpnet: Support usbprofiles over network for NX2
* Various bugfixes
## 1.05
* Minor improvements
* Improve log/debug output
* piueb: Add `valgrind` run mode for debugging
* Improve documentation
* ptapi/piuio: Bugfix resolving path to configuration file. Config file local to piuio library.
* usbhooking: Bugfix to make PIUIO work without using ptapi-io-piuio-real.so on newer games, Exceed 2, Zero, NX
## 1.04
* nxhook: Add hook library for NX
* Minor bugfixes
## 1.03
* zerohook: Add hook library for Zero
* Bugfix linking error ptapi piuio real impl
* Bugfix piueb environment variable order with LD_LOAD_LIBRARY
* Readme/documentation cleanup, merged duplicate documentation for hooks
* Various other bugfixes
## 1.02
* x2hook: Add hook library for Exceed 2
* Various bugfixes
* Documentation and code cleanup
## 1.01
* exchook: Add hook library for Exceed
* mk3hook: Add support for piuio emulation -> configurable keyboard and joystick supported
* Add game documentation: Trivia, unlocks and pad codes about all games released so far (check game-doc.zip)
* Update API documentation
* Add stub example for implementing your own piuio module
* Add configurable joystick/gamepad support for piuio emulation (see readme files for instructions)
* Add configurable keyboard support for piuio emulation (see readme files for instructions)
* Refactor pumptools API (ptapi) piuio and piubtn modules
* Build releases using docker container with ubuntu 16.04 to enhance compatibility with older libc versions
* piueb: Add commands "debug" and "strace" to start game with a gdb server or strace attached for quick debugging
* Various bugfixes
## 1.00
* Release of mk3hook for Linux ports
* Initial public release of binary distribution of pumptools

3
CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 2.8)
add_subdirectory(cmake)

31
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,31 @@
# Contributing
Please have a look at the issue board about what's currently going on. If you see an issue that is not assigned yet and
that you can and want to work on, please leave a comment to reach out to one of our developers. You can also ask
questions and discuss the issue.
# Bug reports
Please check if the bug was already reported by searching the existing issues. If it does, feel free to leave a comment
that you also have this issue. Add additional information, screenshots, log files etc. The more information and details
we have, the easier it might get to solve the issue.
When creating new issues, use our template for reporting bugs. It tells you what kind of information we need.
# Pull requests: bugfixes, new features or other code contributions
Pull requests are welcome! May it be a PR to an already known issue or a new feature that you consider as a valuable
contribution, please open a PR. If you want to start working on a new feature that was proposed in an issue, yet, it
is recommended to reach out to the developers about this, first, to discuss if this contribution is valuable to the
project. Otherwise, you might waste your time on implementing something that won't make it into master.
Please read our [development guidelines](doc/development/development.md) as they contain valuable information that your
contribution meets our standards.
Fork the upstream repository and start developing on your personal fork. Make sure to test your changes with games that
are affected by them. Pay attention to the target platform/hardware you are testing on! This is valuable information
that should be included in the PR.
Once you completed your implementation, open a pull request on the upstream repository to propose your changes. We will
review your contribution and get back to you about any changes or when we merge them to our upstream repository. Your
changes, once approved, will be included in the next release.
# Roadmap
No concrete roadmap or timeline exists. When the time is right, we continue adding support for newer games as well.

42
Dockerfile Normal file
View File

@ -0,0 +1,42 @@
# Use a rather old version of ubuntu to ensure compatibility regarding libc
FROM ubuntu:16.04
LABEL description="Build environment for pumptools"
# Install build dependencies, multilib to get 32-bit versions
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install -y \
g++-multilib \
gcc-multilib \
zip \
cmake \
make \
git \
libc6-dev-i386 \
libusb-1.0-0-dev:i386 \
libusb-dev:i386 \
libasound2-dev:i386 \
libconfig++-dev:i386 \
libx11-dev:i386 \
libcurl4-gnutls-dev:i386
# Copy files for building to container
RUN mkdir /pumptools
WORKDIR /pumptools
COPY CHANGELOG.md CHANGELOG.md
COPY CMakeLists.txt CMakeLists.txt
COPY CONTRIBUTING.md CONTRIBUTING.md
COPY LICENSE LICENSE
COPY Makefile Makefile
COPY Package.mk Package.mk
COPY README.md README.md
COPY dist dist
COPY doc doc
COPY cmake cmake
COPY src src
# .git folder required or building fails when version is generated
COPY .git .git
# Building
RUN make build package

24
LICENSE Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

67
Makefile Normal file
View File

@ -0,0 +1,67 @@
V ?= @
BUILDDIR ?= build
gitrev := $(shell git rev-parse HEAD)
libcver := $(shell ldd --version | head -n 1)
all: \
usage
.PHONY: \
build \
clean \
test \
build-docker \
git-version \
libc-version \
clang-format \
package
usage:
$(V)echo "Pumptools project build makefile"
$(V)echo " build: Build the pumptools project"
$(V)echo " clean: Clean up all build output"
$(V)echo " test: Run pumptools's unit tests"
$(V)echo " build-docker: Build the pumptools project in a docker container"
$(V)echo " git-version: Generate a text file with the current git revision"
$(V)echo " libc-version: Generate a text file with the libc version available"
$(V)echo " clang-format: Apply code style defined in .clang-format style to all code in src/"
$(V)echo " package: Package the build output into distribution zip files"
# Standard build target to build pumptools
build: git-version libc-version
$(V)mkdir -p $(BUILDDIR)
$(V)cd $(BUILDDIR) && cmake .. && make -j $(grep -c ^processor /proc/cpuinfo)
clean:
$(V)rm -rf $(BUILDDIR)
test: build
$(V)scripts/run-tests.sh $(BUILDDIR)
# Build pumptools in a docker image and extract the build output
build-docker:
$(V)rm -rf $(BUILDDIR)/docker
$(V)mkdir -p $(BUILDDIR)/docker
$(V)docker build -t pumptools:build .
$(V)docker create --name pumptools-build pumptools:build
$(V)docker cp pumptools-build:/pumptools/build $(BUILDDIR)/docker
$(V)mv $(BUILDDIR)/docker/build/* $(BUILDDIR)/docker
$(V)rm -r $(BUILDDIR)/docker/build
$(V)docker rm -f pumptools-build
$(V)echo "Build output of docker build can be found in build/docker subfolder."
# Generate a version file to identify the build
git-version:
$(V)mkdir -p $(BUILDDIR)
$(V)echo "$(gitrev)" > $(BUILDDIR)/git-version
# Generate a version file to identify the libc runtime used to build
libc-version:
$(V)mkdir -p $(BUILDDIR)
$(V)echo "$(libcver)" > $(BUILDDIR)/libc-version
clang-format:
$(V)find src/ -iname *.h -o -iname *.c | xargs clang-format -i -style=file
include Package.mk

269
Package.mk Normal file
View File

@ -0,0 +1,269 @@
#
# Distribution build rules
#
builddir := $(BUILDDIR)
zipdir := $(BUILDDIR)/zip
$(zipdir)/:
$(V)mkdir -p $@
################################################
# Hooks: Lexical sorting
$(zipdir)/exchook.zip: \
$(builddir)/bin/exchook.so \
dist/conf/exchook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/f2hook.zip: \
$(builddir)/bin/f2hook.so \
dist/conf/f2hook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/fexhook.zip: \
$(builddir)/bin/fexhook.so \
dist/conf/fexhook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/fsthook.zip: \
$(builddir)/bin/fsthook.so \
dist/conf/fsthook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/mk3hook.zip: \
$(builddir)/bin/mk3hook.so \
dist/piueb \
dist/conf/mk3hook.conf \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/nx2hook.zip: \
$(builddir)/bin/nx2hook.so \
dist/conf/nx2hook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/nxahook.zip: \
$(builddir)/bin/nxahook.so \
dist/conf/nxahook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/nxhook.zip: \
$(builddir)/bin/nxhook.so \
dist/conf/nxhook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/prihook.zip: \
$(builddir)/bin/prihook.so \
dist/conf/prihook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/prohook.zip: \
$(builddir)/bin/prohook.so \
dist/conf/prohook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/pro2hook.zip: \
$(builddir)/bin/pro2hook.so \
dist/conf/pro2hook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/x2hook.zip: \
$(builddir)/bin/x2hook.so \
dist/conf/x2hook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/zerohook.zip: \
$(builddir)/bin/zerohook.so \
dist/conf/zerohook.conf \
dist/piueb \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
################################################
# API: Lexical sorting
# Very messed up and hacky way to preserve the sub-directories as zip does not support this.
# Feel free to improve if you got a more sophisticated solution.
$(zipdir)/api.zip: \
src/api/ptapi \
| $(zipdir)/
$(V)echo ... $@
$(V)cp -r src/api/ptapi $(builddir)
$(V)cd $(builddir) && pwd && zip -r api.zip ptapi && cp api.zip zip/api.zip
$(zipdir)/piubtn.zip: \
$(builddir)/bin/ptapi-io-piubtn-joystick.so \
$(builddir)/bin/ptapi-io-piubtn-joystick-conf \
$(builddir)/bin/ptapi-io-piubtn-keyboard.so \
$(builddir)/bin/ptapi-io-piubtn-keyboard-conf \
$(builddir)/bin/ptapi-io-piubtn-null.so \
$(builddir)/bin/ptapi-io-piubtn-real.so \
$(builddir)/bin/ptapi-io-piubtn-test \
dist/api/ptapi-io-piubtn-stub.c \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
$(zipdir)/piuio.zip: \
$(builddir)/bin/ptapi-io-piuio-joystick.so \
$(builddir)/bin/ptapi-io-piuio-joystick-conf \
$(builddir)/bin/ptapi-io-piuio-keyboard.so \
$(builddir)/bin/ptapi-io-piuio-keyboard-conf \
$(builddir)/bin/ptapi-io-piuio-null.so \
$(builddir)/bin/ptapi-io-piuio-real.so \
$(builddir)/bin/ptapi-io-piuio-test \
dist/api/ptapi-io-piuio-stub.c \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
################################################
# (USB) profile: Lexical sorting
# $(builddir)/bin/fex-profile-tool \
$(zipdir)/profile-tools.zip: \
$(builddir)/bin/nx2-profile-tool \
$(builddir)/bin/nxa-profile-tool \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
################################################
# pumpnet: Lexical sorting
$(zipdir)/pumpnet.zip: \
$(builddir)/bin/pumpnet-client \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
################################################
# Documentation
$(zipdir)/doc.zip: \
doc/api/io/piuio.md \
doc/api/io/x11-input-hook.md \
doc/game/image \
doc/game/01-1st.md \
doc/game/02-2nd.md \
doc/game/03-3rd.md \
doc/game/04-3se.md \
doc/game/05-tc.md \
doc/game/06-pc.md \
doc/game/07-extra.md \
doc/game/08-prem1.md \
doc/game/09-prex1.md \
doc/game/10-reb.md \
doc/game/11-prem2.md \
doc/game/12-prex2.md \
doc/game/13-prem3.md \
doc/game/14-prex3.md \
doc/game/15-exc.md \
doc/game/16-exc2.md \
doc/game/17-zero.md \
doc/game/18-nx.md \
doc/game/20-nx2.md \
doc/game/game.md \
doc/hook/exchook.md \
doc/hook/hook.md \
doc/hook/mk3hook.md \
doc/hook/nxhook.md \
doc/hook/nx2hook.md \
doc/hook/os.md \
doc/hook/x2hook.md \
doc/hook/zerohook.md \
doc/README.md \
| $(zipdir)/
$(V)echo ... $@
$(V)zip $@ $^
################################################
$(builddir)/pumptools.zip: \
$(zipdir)/api.zip \
$(zipdir)/doc.zip \
$(zipdir)/exchook.zip \
$(zipdir)/f2hook.zip \
$(zipdir)/fexhook.zip \
$(zipdir)/fsthook.zip \
$(zipdir)/mk3hook.zip \
$(zipdir)/nx2hook.zip \
$(zipdir)/nxahook.zip \
$(zipdir)/nxhook.zip \
$(zipdir)/piubtn.zip \
$(zipdir)/piuio.zip \
$(zipdir)/profile-tools.zip \
$(zipdir)/prihook.zip \
$(zipdir)/pro2hook.zip \
$(zipdir)/prohook.zip \
$(zipdir)/pumpnet.zip \
$(zipdir)/x2hook.zip \
$(zipdir)/zerohook.zip \
CHANGELOG.md \
CONTRIBUTING.md \
LICENSE \
README.md \
$(builddir)/git-version \
$(builddir)/libc-version
$(V)echo ... $@
$(V)zip -j $@ $^
$(builddir)/pumptools-public.zip: \
$(zipdir)/api.zip \
$(zipdir)/doc.zip \
$(zipdir)/exchook.zip \
$(zipdir)/mk3hook.zip \
$(zipdir)/nxhook.zip \
$(zipdir)/nx2hook.zip \
$(zipdir)/piubtn.zip \
$(zipdir)/piuio.zip \
$(zipdir)/x2hook.zip \
$(zipdir)/zerohook.zip \
CHANGELOG.md \
LICENSE \
README.md \
$(builddir)/git-version \
$(builddir)/libc-version
$(V)echo ... $@
$(V)zip -j $@ $^
################################################
package: $(builddir)/pumptools.zip $(builddir)/pumptools-public.zip

119
README.md
View File

@ -1,4 +1,117 @@
This is currently a placeholder repository for the source release of pumptools.
# Pumptools: The ultimate toolset to run all Linux based PIU games on any* kernel and distribution
Version: 1.08</br>
[Release history](CHANGELOG.md)
In the meantime, use the issue tracker to report any bugs you encounter with
the binary releases.
This tool-set provides hook libraries that can be pre-loaded to run vanilla dumps of all Pump It Up games running on
Linux. This also includes the only exclusive MK5 hardware based game Exceed and the MK3 Linux ports.
## Public release note
Currently, the public release contains all source code required to run all games listed
[here](#games-and-latest-versions-supported). The following games however are currently not working due to missing
dongle key tables and raw hdd areas (dummy files exist to allow full compilation of the project):
* NXA
* Fiesta
* FiestaEX
* Fiesta 2
* Prime
The required assets to run these games will follow with future releases.
## Documentation
Additional documentation on different topics related to pumptools are located in the `doc` subfolder
[here](doc/README.md).
For release distribution packages, you can find a `doc.zip` file inside the `pumptools.zip` package that contains all
documentation also referenced from here:
* [pumptools api](doc/api/api.md)
* [pumptools development](doc/development/development.md)
* [pumptools's architecture](doc/development/architecture.md)
* [general game related stuff like pad codes, unlocks etc](doc/game/game.md)
* [game hook libraries](doc/hook/hook.md)
## Hook libraries
### Features
* Run all supported games on recent hardware, Linux distributions and kernel versions
* Environment sandboxing to increase compatibility and portability
* API for hardware abstraction: Write your own drivers for IO devices
* Full dongle emulation in software
* Works with **vanilla** data, no hex edits
* Various (bug)fixes and quality of live improvements for many games
### Games and latest versions supported
All hooks share a major set of features provided by pumptools. Therefore, common topics are covered in the
[main hook readme](doc/hook/hook.md). Start there when you are setting up a game with pumptools. Additionally, refer to
each dedicated hook readme for further important and required information to successfully setup and run the games.
The following games are supported and tested with the latest versions available. Earlier version might also be support
and work because of the nature the hooks are implemented.
* [MK3 Linux Ports: 1st to Prem 3/Prex 3](doc/hook/mk3hook.md): MK3 Linux ports (there is only one version officially
available per game version)
* [Exceed](doc/hook/exchook.md): 20040408
* [Exceed 2](doc/hook/x2hook.md): 102
* [Zero](doc/hook/zerohook.md): 103
* [NX](doc/hook/nxhook.md): 108
* [NX2](doc/hook/nx2hook.md): 154
Not available, yet:
* [Pro](doc/hook/prohook.md): R5 nodongle
* [NXA](doc/hook/nxahook.md): 110
* [Pro2](doc/hook/pro2hook.md): R5 nodongle
* [Fiesta](doc/hook/fsthook.md): 120
* [FiestaEX](doc/hook/fexhook.md): 151
* [Fiesta 2](doc/hook/f2hook.md): 161
* [Prime](doc/hook/prihook.md): 122
### Prepare your operating system
Before you start installing and configuring anything of pumptools, read [this readme](doc/hook/os.md) on how to prepare
your operating system and environment.
### Get and prepare game data
You need **vanilla**, i.e. non-tempered and non-decrypted, game assets as well as non-tempered executable binaries
which can be pulled from legit and clean physical disks or images of them.
For setting up the games, have a look at the dedicated readme files for
[each hook and game](#games-and-latest-versions-supported).
### Setup hook libraries
**READ THE WHOLE README OF THE HOOK BUILD YOU WANT TO USE FIRST BEFORE DOING ANYTHING!!!**
The readme files go into great detail how to setup things with various potential relevant aspects spread across the
document. Being aware of them will save you a lot of puzzling and time. Furthermore, read the FAQ/troubleshooting
section before as well to be aware of any known issues when you encounter them.
## Building
Make sure you have the [required tools](doc/development.md) installed. Once that's done, simply run
```shell script
make build
```
to build it on your current host from the root directory of this project.
The build output is located in the `build` subdirectory. The built binaries can be found in `build/bin` and a
distribution package called `pumptools.zip` can be found in the `build` subfolder.
You can also build in a docker container. The container provides the necessary build environment and also ensures
[compatibility regarding glibc versions](doc/development/development.md#compatibility-issues-with-newer-glibc-versions).
```shell script
make build-docker
```
The build output from the docker image is located in `build/docker`.
## Development
## API
Please refer to the [API documentation](doc/api/api.md).
## Architecture
A dedicate [architecture document](doc/architecture.md) outlines the architecture of pumptools and points out the most
important aspects you should know before you get started with development.
## Pumptools development
Please refer to the [development readme](doc/development.md) regarding what you have to know when you want to develop
something for pumptools.
## License
Source code license is the Unlicense; you are permitted to do with this as thou wilt. For details, please refer to the
[LICENSE file](LICENSE) included with the source code.

66
cmake/CMakeLists.txt Normal file
View File

@ -0,0 +1,66 @@
cmake_minimum_required(VERSION 2.8)
option(PT_PUBLIC_RELEASE "PT_PUBLIC_RELEASE" "0")
if (PT_PUBLIC_RELEASE STREQUAL "1")
message(WARNING "!!! Compiling public release !!!\n!!! Compiling public release !!!\n!!! Compiling public release !!!")
endif ()
# set git revision
execute_process(COMMAND git log -1 --format=%h --date=short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GITREV ERROR_QUIET)
string(STRIP "${GITREV}" GITREV)
if (GITREV STREQUAL "")
set(GITREV "not available")
endif ()
include(modules/AddResources.cmake)
set(PT_ROOT_SRC "${CMAKE_CURRENT_LIST_DIR}/../src")
set(PT_ROOT_IMPORTS "${PT_ROOT_SRC}/imports")
set(PT_ROOT_PTAPI "${PT_ROOT_SRC}/api")
set(PT_ROOT_MAIN "${PT_ROOT_SRC}/main")
set(PT_ROOT_TEST "${PT_ROOT_SRC}/test")
# force out of source build
message(STATUS "Force out of source build check...")
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
if (insource)
message(FATAL_ERROR "Do not build in your source dir. Use a dedicated build folder. Now go cleanup the cache in the CMakeCache.txt and CMakeFiles folder which don't belong there!")
endif ()
# binary output dir
set(PT_BIN_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE STRING "Output path for compiled binaries")
# For generic no-config case
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PT_BIN_OUTPUT_PATH})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PT_BIN_OUTPUT_PATH})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PT_BIN_OUTPUT_PATH})
# Common C/C++ save
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 14)
# TODO cleanup flags and add them to each module separately
# Important note: Don't use -O3 because that will break the dongle emulation code for microdog40 (wtf)
# Also, -O3 seems to optimize too much stuff and kills the amixer-block module entirely (the system() preload
# can't be called anymore)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGITREV=${GITREV} -pipe -Wall -Werror -std=gnu99 -D_GNU_SOURCE -Wno-attributes -m32")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined -m32")
# Enable debug flags on non public builds
if (PT_PUBLIC_RELEASE STREQUAL "0")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -g -rdynamic")
endif ()
# Disable asserts and strip binary
if (PT_PUBLIC_RELEASE STREQUAL "1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG -DPT_PUBLIC_RELEASE")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -s")
endif ()
add_subdirectory(src)
# Add a text file containing the git commit rev
file(WRITE ${CMAKE_BINARY_DIR}/version ${GITREV})

View File

@ -0,0 +1,12 @@
# Compilation step for static resources
FUNCTION(ADD_RESOURCES out_var path file)
SET(result)
SET(result "${PROJECT_BINARY_DIR}/${file}.o")
ADD_CUSTOM_COMMAND(OUTPUT ${result}
COMMAND ld -m elf_i386 -L"${path}" -r -b binary -o ${result} ${file}
DEPENDS ${path}/${file}
WORKING_DIRECTORY ${path}
COMMENT "Building binary data object ${result}"
VERBATIM)
SET(${out_var} "${result}" PARENT_SCOPE)
ENDFUNCTION()

3
cmake/src/CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
add_subdirectory(imports)
add_subdirectory(main)
add_subdirectory(test)

View File

@ -0,0 +1 @@
add_subdirectory(cmocka)

View File

@ -0,0 +1,13 @@
project(cmocka)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_SRC}/imports/cmocka)
include_directories(${SRC})
MESSAGE(STATUS, "${PT_IMPORTS_SRC}")
set(SOURCE_FILES
${SRC}/cmocka.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1,13 @@
include_directories(${PT_ROOT_IMPORTS})
include_directories(${PT_ROOT_PTAPI})
include_directories(${PT_ROOT_MAIN})
add_subdirectory(asset)
add_subdirectory(capnhook)
add_subdirectory(crypt)
add_subdirectory(hook)
add_subdirectory(io)
add_subdirectory(ptapi)
add_subdirectory(pumpnet)
add_subdirectory(sec)
add_subdirectory(util)

View File

@ -0,0 +1,7 @@
add_subdirectory(f2)
add_subdirectory(fex)
add_subdirectory(nx)
add_subdirectory(nx2)
add_subdirectory(nxa)
add_subdirectory(x2)
add_subdirectory(zero)

View File

@ -0,0 +1,2 @@
#add_subdirectory(lib)
#add_subdirectory(tool)

View File

@ -0,0 +1,11 @@
project(asset-f2)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/f2/lib)
set(SOURCE_FILES
${SRC}/usb-rank.c
${SRC}/usb-save.c
${SRC}/util.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1,2 @@
add_subdirectory(lib)
add_subdirectory(tool)

View File

@ -0,0 +1,11 @@
project(asset-fex)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/fex/lib)
set(SOURCE_FILES
${SRC}/usb-rank.c
${SRC}/usb-save.c
${SRC}/util.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1 @@
add_subdirectory(usb-profile)

View File

@ -0,0 +1,11 @@
project(fex-usb-profile-tool)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/fex/tool)
set(SOURCE_FILES
${SRC}/usb-profile.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} asset-fex util)

View File

@ -0,0 +1,2 @@
add_subdirectory(lib)
add_subdirectory(tool)

View File

@ -0,0 +1,10 @@
project(asset-nx)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nx/lib)
set(SOURCE_FILES
${SRC}/settings.c
${SRC}/util.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1 @@
add_subdirectory(settings)

View File

@ -0,0 +1,11 @@
project(nx-settings-tool)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nx/tool)
set(SOURCE_FILES
${SRC}/settings.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} asset-nx util)

View File

@ -0,0 +1,2 @@
add_subdirectory(lib)
add_subdirectory(tool)

View File

@ -0,0 +1,13 @@
project(asset-nx2)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nx2/lib)
set(SOURCE_FILES
${SRC}/usb-rank.c
${SRC}/usb-save.c
${SRC}/util.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} util)

View File

@ -0,0 +1 @@
add_subdirectory(usb-profile)

View File

@ -0,0 +1,11 @@
project(nx2-profile-tool)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nx2/tool)
set(SOURCE_FILES
${SRC}/usb-profile.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} asset-nx2 util)

View File

@ -0,0 +1,2 @@
add_subdirectory(lib)
add_subdirectory(tool)

View File

@ -0,0 +1,13 @@
project(asset-nxa)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nxa/lib)
set(SOURCE_FILES
${SRC}/usb-rank.c
${SRC}/usb-save.c
${SRC}/util.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} util)

View File

@ -0,0 +1 @@
add_subdirectory(usb-profile)

View File

@ -0,0 +1,11 @@
project(nxa-profile-tool)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/nxa/tool)
set(SOURCE_FILES
${SRC}/usb-profile.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} asset-nxa util)

View File

@ -0,0 +1 @@
add_subdirectory(lib)

View File

@ -0,0 +1,9 @@
project(asset-x2)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/x2/lib)
set(SOURCE_FILES
${SRC}/settings.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1 @@
add_subdirectory(lib)

View File

@ -0,0 +1,9 @@
project(asset-zero)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/asset/zero/lib)
set(SOURCE_FILES
${SRC}/settings.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1,2 @@
add_subdirectory(hook)
add_subdirectory(hooklib)

View File

@ -0,0 +1,20 @@
project(capnhook-hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/capnhook/hook)
set(SOURCE_FILES
${PT_ROOT_MAIN}/capnhook/hook/fshook.c
${PT_ROOT_MAIN}/capnhook/hook/filehook.c
${PT_ROOT_MAIN}/capnhook/hook/iobuf.c
${PT_ROOT_MAIN}/capnhook/hook/iohook.c
${PT_ROOT_MAIN}/capnhook/hook/lib.c
${PT_ROOT_MAIN}/capnhook/hook/result.c
${PT_ROOT_MAIN}/capnhook/hook/sig.c
${PT_ROOT_MAIN}/capnhook/hook/usbhook.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} dl util)

View File

@ -0,0 +1,20 @@
project(capnhook-hooklib)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/capnhook/hooklib)
set(SOURCE_FILES
${PT_ROOT_MAIN}/capnhook/hooklib/filehook-mon.c
${PT_ROOT_MAIN}/capnhook/hooklib/fileopen-mon.c
${PT_ROOT_MAIN}/capnhook/hooklib/fshook-mon.c
${PT_ROOT_MAIN}/capnhook/hooklib/iohook-mon.c
${PT_ROOT_MAIN}/capnhook/hooklib/redir.c
${PT_ROOT_MAIN}/capnhook/hooklib/usb-emu.c
${PT_ROOT_MAIN}/capnhook/hooklib/usb-init-fix.c
${PT_ROOT_MAIN}/capnhook/hooklib/usbhook-mon.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} capnhook-hook util)

View File

@ -0,0 +1,12 @@
project(crypt)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/crypt)
set(SOURCE_FILES
${SRC}/lib/md5.c
${SRC}/lib/rijndael.c
${SRC}/aes.c
${SRC}/md5.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1,16 @@
add_subdirectory(core)
add_subdirectory(exc)
add_subdirectory(f2)
add_subdirectory(fex)
add_subdirectory(fst)
add_subdirectory(mk3)
add_subdirectory(nx2)
add_subdirectory(nxa)
add_subdirectory(nx)
add_subdirectory(patch)
add_subdirectory(pri)
add_subdirectory(pro2)
add_subdirectory(propatch)
add_subdirectory(pro)
add_subdirectory(x2)
add_subdirectory(zero)

View File

@ -0,0 +1,14 @@
project(hook-core)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/core)
set(SOURCE_FILES
${SRC}/options.c
${SRC}/piu-utils.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} util)

View File

@ -0,0 +1,19 @@
project(exchook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/exc)
set(SOURCE_FILES
${SRC}/eeprom.c
${SRC}/io.c
${SRC}/lockchip.c
${SRC}/main.c
${SRC}/mempatch.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} hook-core lockchip ptapi-io-piuio-util patch util dl pthread)

View File

@ -0,0 +1,19 @@
project(f2hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/f2)
add_resources(HDD_RAW ${SRC} f2hook.hdd.raw)
add_resources(DOG_KEY ${SRC} f2hook.hasp.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-shared")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} crypt hook-core microdog34 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,18 @@
project(fexhook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/fex)
add_resources(HDD_RAW ${SRC} fexhook.hdd.raw)
add_resources(DOG_KEY ${SRC} fexhook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} crypt hook-core microdog40 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,18 @@
project(fsthook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/fst)
add_resources(HDD_RAW ${SRC} fsthook.hdd.raw)
add_resources(DOG_KEY ${SRC} fsthook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} crypt hook-core microdog40 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,19 @@
project(mk3hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/mk3)
set(SOURCE_FILES
${SRC}/1st-2nd-fs-fix.c
${SRC}/config.c
${SRC}/fmodex.c
${SRC}/main.c
${SRC}/ogl-fix.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} hook-core patch util dl ptapi-io-piuio-util)

View File

@ -0,0 +1,19 @@
project(nxhook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/nx)
add_resources(HDD_RAW ${SRC} nxhook.hdd.raw)
add_resources(DOG_KEY ${SRC} nxhook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c
${SRC}/unlock.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} asset-nx hook-core microdog34 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,19 @@
project(nx2hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/nx2)
add_resources(HDD_RAW ${SRC} nx2hook.hdd.raw)
add_resources(DOG_KEY ${SRC} nx2hook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c
${SRC}/profile-gen.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} capnhook-hook capnhook-hooklib crypt hook-core microdog40 asset-nx2 patch ptapi-io-piuio-util pumpnet-lib util dl pthread curl)

View File

@ -0,0 +1,19 @@
project(nxahook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/nxa)
add_resources(HDD_RAW ${SRC} nxahook.hdd.raw)
add_resources(DOG_KEY ${SRC} nxahook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c
${SRC}/profile-gen.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} asset-nxa crypt hook-core microdog40 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,39 @@
project(patch)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/patch)
set(SOURCE_FILES
${SRC}/asound-fix.c
${SRC}/amixer-block.c
${SRC}/blacklist-url.c
${SRC}/block-keyboard-grab.c
${SRC}/gfx.c
${SRC}/hasp.c
${SRC}/hdd-check.c
${SRC}/hook-mon.c
${SRC}/main-loop.c
${SRC}/microdog34.c
${SRC}/microdog40.c
${SRC}/mounts.c
${SRC}/net-profile.c
${SRC}/network.c
${SRC}/piubtn.c
${SRC}/piuio.c
${SRC}/piuio-exit.c
${SRC}/ram-wipe.c
${SRC}/redir.c
${SRC}/sigsegv.c
${SRC}/sound.c
${SRC}/usb-emu.c
${SRC}/usb-init-fix.c
${SRC}/usb-mnt.c
${SRC}/usb-unlock.c
${SRC}/usbfs.c
${SRC}/x11-event-loop.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} capnhook-hook capnhook-hooklib hasp-old microdog34 microdog40)

View File

@ -0,0 +1,19 @@
project(prihook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/pri)
add_resources(HDD_RAW ${SRC} prihook.hdd.raw)
add_resources(DOG_KEY ${SRC} prihook.hasp.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c
${SRC}/usb-updates.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HDD_RAW} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} crypt hasp-old hook-core patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,15 @@
project(prohook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/pro)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} hook-core patch propatch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,15 @@
project(pro2hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/pro2)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} hook-core patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,13 @@
project(propatch)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/propatch)
set(SOURCE_FILES
${SRC}/usb-fix.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} capnhook-hook capnhook-hooklib)

View File

@ -0,0 +1,19 @@
project(x2hook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/x2)
add_resources(DOG_KEY ${SRC} x2hook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/ogl-fix.c
${SRC}/options.c
${SRC}/unlock.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${DOG_KEY})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} asset-x2 hook-core microdog34 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,19 @@
project(zerohook)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/hook/zero)
add_resources(HDD_RAW ${SRC} zerohook.hdd.raw)
add_resources(DOG_KEY ${SRC} zerohook.dog.key)
set(SOURCE_FILES
${SRC}/main.c
${SRC}/options.c
${SRC}/unlock.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${DOG_KEY} ${HDD_RAW})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} asset-zero hook-core microdog34 patch ptapi-io-piuio-util util dl pthread)

View File

@ -0,0 +1,3 @@
add_subdirectory(piubtn)
add_subdirectory(piuio)
add_subdirectory(util)

View File

@ -0,0 +1,14 @@
project(io-piubtn)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/io/piubtn)
set(SOURCE_FILES
${SRC}/device.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
add_library(piubtn SHARED ${SOURCE_FILES})
set_target_properties(piubtn PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-util util usb-1.0)

View File

@ -0,0 +1,14 @@
project(io-piuio)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/io/piuio)
set(SOURCE_FILES
${SRC}/device.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
add_library(piuio SHARED ${SOURCE_FILES})
set_target_properties(piuio PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-util util usb-1.0)

View File

@ -0,0 +1,11 @@
project(io-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/io/util)
set(SOURCE_FILES
${SRC}/joystick.c
${SRC}/joystick-util.c
${SRC}/usb.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

View File

@ -0,0 +1,2 @@
add_subdirectory(piubtn)
add_subdirectory(piuio)

View File

@ -0,0 +1,10 @@
add_subdirectory(joystick-conf)
add_subdirectory(joystick)
add_subdirectory(joystick-util)
add_subdirectory(keyboard)
add_subdirectory(keyboard-conf)
add_subdirectory(keyboard-util)
add_subdirectory(null)
add_subdirectory(real)
add_subdirectory(test)
add_subdirectory(util)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piubtn-joystick-conf)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/joystick-conf)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-joystick-util io-util util)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piubtn-joystick-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/joystick-util)
set(SOURCE_FILES
${SRC}/joystick-conf.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piubtn-joystick)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/joystick)
set(SOURCE_FILES
${SRC}/joystick.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-joystick-util io-util util)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piubtn-keyboard-conf)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/keyboard-conf)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-keyboard-util io-util util X11)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piubtn-keyboard-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/keyboard-util)
set(SOURCE_FILES
${SRC}/keyboard-conf.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piubtn-keyboard)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/keyboard)
set(SOURCE_FILES
${SRC}/keyboard.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-keyboard-util io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piubtn-null)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/null)
set(SOURCE_FILES
${SRC}/null.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piubtn-real)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/real)
set(SOURCE_FILES
${SRC}/piubtn.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-util util usb-1.0)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piubtn-test)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/test)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} capnhook-hook ptapi-io-piubtn-util util)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piubtn-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piubtn/util)
set(SOURCE_FILES
${SRC}/lib.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} capnhook-hook dl util)

View File

@ -0,0 +1,10 @@
add_subdirectory(joystick-conf)
add_subdirectory(joystick)
add_subdirectory(joystick-util)
add_subdirectory(keyboard-conf)
add_subdirectory(keyboard)
add_subdirectory(keyboard-util)
add_subdirectory(null)
add_subdirectory(real)
add_subdirectory(test)
add_subdirectory(util)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piuio-joystick-conf)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/joystick-conf)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-joystick-util io-util util)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piuio-joystick-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/joystick-util)
set(SOURCE_FILES
${SRC}/joystick-conf.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piuio-joystick)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/joystick)
set(SOURCE_FILES
${SRC}/joystick.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-joystick-util io-util util)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piuio-keyboard-conf)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/keyboard-conf)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-keyboard-util io-util util X11)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piuio-keyboard-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/keyboard-util)
set(SOURCE_FILES
${SRC}/keyboard-conf.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piuio-keyboard)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/keyboard)
set(SOURCE_FILES
${SRC}/keyboard.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-keyboard-util io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piuio-null)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/null)
set(SOURCE_FILES
${SRC}/null.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-util util)

View File

@ -0,0 +1,15 @@
project(ptapi-io-piuio-real)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/real)
set(SOURCE_FILES
${SRC}/piuio.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
# Remove library name "lib" prefix
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} io-piuio io-util util usb-1.0)

View File

@ -0,0 +1,11 @@
project(ptapi-io-piuio-test)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/test)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} capnhook-hook ptapi-io-piuio-util util)

View File

@ -0,0 +1,13 @@
project(ptapi-io-piuio-util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/ptapi/io/piuio/util)
set(SOURCE_FILES
${SRC}/lib.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} capnhook-hook dl util)

View File

@ -0,0 +1,2 @@
add_subdirectory(client)
add_subdirectory(lib)

View File

@ -0,0 +1,11 @@
project(pumpnet-client)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/pumpnet/client)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} pumpnet-lib -lcurl)

View File

@ -0,0 +1,15 @@
project(pumpnet-lib)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/pumpnet/lib)
set(SOURCE_FILES
${SRC}/http.c
${SRC}/profile-token.c
${SRC}/pumpnet.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} asset-nx2 util)

View File

@ -0,0 +1,4 @@
add_subdirectory(hasp)
add_subdirectory(lockchip)
add_subdirectory(microdog34)
add_subdirectory(microdog40)

View File

@ -0,0 +1,3 @@
add_subdirectory(lib)
add_subdirectory(old)
add_subdirectory(server)

View File

@ -0,0 +1,17 @@
project(hasp)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/hasp/lib)
set(SOURCE_FILES
${SRC}/object/client-id-req.c
${SRC}/object/client-id-resp.c
${SRC}/asn1.c
${SRC}/handler.c
${SRC}/server.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} crypt)

View File

@ -0,0 +1,13 @@
project(hasp-old)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/hasp/old)
set(SOURCE_FILES
${SRC}/hasp.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} crypt)

View File

@ -0,0 +1,11 @@
project(hasp-server)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/hasp/server)
set(SOURCE_FILES
${SRC}/main.c)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} hasp util)

View File

@ -0,0 +1,13 @@
project(lockchip)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/lockchip)
set(SOURCE_FILES
${SRC}/lockchip.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} crypt)

View File

@ -0,0 +1,13 @@
project(microdog34)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/microdog34)
set(SOURCE_FILES
${SRC}/microdog34.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} crypt)

View File

@ -0,0 +1,14 @@
project(microdog40)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/sec/microdog40)
set(SOURCE_FILES
${SRC}/microdog40.c
${SRC}/microdog40d.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
target_link_libraries(${PROJECT_NAME} crypt)

View File

@ -0,0 +1,28 @@
project(util)
message(STATUS "Project " ${PROJECT_NAME})
set(SRC ${PT_ROOT_MAIN}/util)
set(SOURCE_FILES
${SRC}/adler32.c
${SRC}/array.c
${SRC}/base64.c
${SRC}/fs.c
${SRC}/glibc.c
${SRC}/hex.c
${SRC}/iobuf.c
${SRC}/list.c
${SRC}/log.c
${SRC}/mem.c
${SRC}/net.c
${SRC}/options.c
${SRC}/patch.c
${SRC}/proc.c
${SRC}/rand.c
${SRC}/sock-tcp.c
${SRC}/str.c
${SRC}/sys-info.c
${SRC}/test.c
${SRC}/time.c)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

Some files were not shown because too many files have changed in this diff Show More