thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
547 stars 40 forks source link
anime c-plus-plus dll-injection game-mod-tool game-modding game-patch i18n shmup thcrap touhou touhou-project

Touhou Community Reliant Automatic Patcher

Join the chat at http://discord.thpatch.net Backers on Open Collective Build status GitHub Release

Description

Basically, this is an almost-generic, easily expandable and customizable framework to patch Windows applications in memory, specifically tailored towards the translation of Japanese games.

It is mainly developed to facilitate self-updating, multilingual translation of the Touhou Project games on Touhou Patch Center, but can theoretically be used for just about any other patch for these games, without going through that site.

Main features of the base engine

Modules included

Building

A ready-made Visual Studio build configuration, covering all modules and their dependencies, is provided as part of this repository. To set up the build:

Then, open thcrap.sln, choose Debug or Release from the drop-down menu in the toolbar (or the Configuration Manager) and run Build → Build Solution from the main menu.

You can also build from the command line by running the Visual Studio tool environment batch file (vcvarsall.bat), then run

    msbuild /m /p:Configuration=Debug

or

    msbuild /m /p:Configuration=Release

in the thcrap directory. The binaries will end up in the bin/ subdirectory.

Signing a release archive for automatic updates

First, convert cert.pvk to a .pem file using OpenSSL, then use this file together with scripts/release_sign.py:

openssl rsa -inform pvk -in cert.pvk -outform pem -out cert.pem
python release_sign.py -k cert.pem thcrap.zip

Using different compilers

Visual Studio Community 2017 is recommended for building, and the build configuration references the Visual Studio 2017 platform toolset with Windows XP targeting support by default. However, the project should generally build under every version since Visual C++ 2010 Express after changing the <PlatformToolset> value in Base.props. For a list of all platform toolsets available on your system, open the Properties dialog for any included project and refer to the drop-down menu at Configuration Properties → General → Platform Toolset.

Compilation with MinGW is currently not supported. This is not likely to change in the foreseeable future as we don't see much value in it.

Dependencies

All required third-party libraries for the C/C++ code are included as Git submodules in the thcrap_external_dependencies submodule, which also contains pre-built DLLs, .lib files, export definitions and PDBs. These are:

The scripts in the scripts directory are written in Python 3. Some of them require further third-party libraries not included in this repository:

License

The Touhou Community Reliant Patcher and all accompanying modules are released to the Public Domain, unless stated otherwise. This means you can do whatever you want with this code without so much as crediting us.

That said, we do appreciate attribution. ☺

Backers

Love our work? Become a backer of Touhou Patch Center on Open Collective, and help us decide the priorities of thcrap's future development.

Thank you to all our backers!

The team