Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
KionX committed Mar 26, 2022
0 parents commit afacc3a
Show file tree
Hide file tree
Showing 6 changed files with 430 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release Version'
required: true

jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32

- name: Install MinGW
run: |
pacman --noconfirm -S mingw-w64-i686-gcc
- uses: actions/checkout@v2

- name: Build Patcher
run: ./make.sh

- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: v${{ github.event.inputs.version }}
draft: true
prerelease: true

- name: Upload Patcher exe
id: upload-exe
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: FaP.exe
asset_name: FaP.exe
asset_content_type: application/vnd.microsoft.portable-executable
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
!*/
!.gitignore
!make.sh
!section.ld
!README.md
!*.cpp
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# What is this project?
A tool for patching binary files(.exe)

FAF's patches are contained at: https://github.com/FAForever/FA-Binary-Patches

# How To Build

- To build patcher:
- Cd into patcher directory and `target make` or `mingw32-make`

- To build patch:
- Run `FaP.exe` to be create default `config.txt`.
- If necessary, correct the config file.
- Put patch files into patcher dir(hooks, section)
- Put base file(the copy will be patched) into patcher dir.
- Run `FaP.exe`

- Config file options:
- `oldfile` specifies the file to be patched(base file)
- `newfile` specifies the file to be make.
- `newsect` the name of the section to be created(begins with `.`, max 8 chars)
- `sectsize` the size(hex) of `newsect`(to disable it, set 0)

# How make patches
- Make `hooks` & `section` dirs.
- `hooks` for patches putting into existing sections.
- `section` for putting into new section.
- Put .cpp files.
- For `section` no special rules.
- Hooks rules:
- In each hook file may be several hooks.
- For each hook need header: `asm(".section h*; .set h*,**;")`
- `*` is hook name(max 7 chars), `**` virtual address to be placed.
- For using symbols of `section` from asm need use macro `QU`.
- Example: `"JMP "QU(BuildUnit)";"`
Loading

0 comments on commit afacc3a

Please sign in to comment.