Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
d41d7cf
Partial commit
sc2ad Jun 14, 2022
4239b7d
Add .clang-tidy, update build process, add gtest and gsl
sc2ad May 16, 2023
e7059fb
Move from trampoline-allocator to trampoline, improve utils
sc2ad May 16, 2023
18c0812
Add tests and TODOs, should be run on linux
sc2ad May 16, 2023
1431fa5
Fix tbnz fixup using wrong immediate, ldr emit
sc2ad May 17, 2023
4ac096a
Restructure WriteFixups to allow for deferred writes
sc2ad May 17, 2023
504438e
Shrink line limit a bit
sc2ad May 17, 2023
8dbfaff
Install callback to correct place, fmt/format.h include
sc2ad May 18, 2023
e3bb62d
Add far tests, fix allocator error reporting, prepare for hook API
sc2ad May 23, 2023
3529070
Syle fixes and improvements to flow
sc2ad Oct 15, 2023
060cdea
Swap to fmt logs, ensure compilation of trampoline
sc2ad Oct 15, 2023
0d1b752
Update action for building, ensure creation works
sc2ad Oct 15, 2023
dcb7bdd
Add fmt dependency
sc2ad Oct 15, 2023
d9cb24e
Improve build flow to build qmod
sc2ad Oct 15, 2023
fbb8992
Add publish script, ensure building of qmod works
sc2ad Oct 15, 2023
26570ec
Update publish to avoid rename of debug so
sc2ad Oct 15, 2023
0d33e4a
Move trampoline files to new folder
sc2ad Oct 15, 2023
b411c25
trampoline: Improve protection guarantees, use instruction counts
sc2ad Nov 3, 2023
6ece580
trampoline: Fix poor assertion logic
sc2ad Nov 11, 2023
bf97363
TMP: Update format/tidy, add HookData type
sc2ad Mar 2, 2024
5da5fcd
Modify format rules and remove using check
sc2ad May 20, 2024
65c4bae
Add fixups file and trampoline fixups
sc2ad May 25, 2024
e69a34d
Add workflow to test in CI
sc2ad Jul 21, 2024
2be348b
Add test-wrapper.hpp and add self-checking validation to fixups and h…
sc2ad Jul 22, 2024
5572a13
Add TODO for ensuring alignment of data section for different sizes o…
sc2ad Jul 22, 2024
15fa78b
Add support for ensuring alignment of data
sc2ad Jul 23, 2024
b0614e1
Add guaranteed near and far hooks via consistent allocation
sc2ad Jul 23, 2024
68b9acf
Initial work on adding actual hook installation API
sc2ad Aug 9, 2024
13d0487
Add callback writing for hook installs, reinstall logic
sc2ad Aug 20, 2024
fed16f0
Add simple uninstall, reinstall logic
sc2ad Aug 20, 2024
9c3b10f
Add more correct installation logic and simple error support, missing…
sc2ad Aug 20, 2024
4f22dd6
Fix tests to use ShimTarget
sc2ad Aug 21, 2024
112236f
Add simple shim API and simple test that does not yet compile
sc2ad Mar 10, 2025
4eb36f0
Add cmake strategy for fixup-test
sc2ad Apr 29, 2025
f891a71
Add simple installation logic, get full bundle compiling
sc2ad Apr 29, 2025
1794828
Add CopyOriginalInsts method to Fixups type
sc2ad Apr 30, 2025
2a7076c
Refactor HookInfo constructors, fixup some issues for void types, add…
sc2ad Apr 30, 2025
90d8262
Flesh out installer API, copy insts correctly
sc2ad Apr 30, 2025
64450de
Add api.cpp simple hook test, adjust testing harness to match
sc2ad Apr 30, 2025
1fd6843
Add api.cpp simple test to CMake and CI
sc2ad Apr 30, 2025
cee0718
Add orig hook test
sc2ad May 1, 2025
8070f03
Add ctest logic, add multi-hook test
sc2ad May 1, 2025
791ec26
Add test for partial uninstall in the multi-hook test
sc2ad May 1, 2025
5ae3cb9
Add negative adrp test case
sc2ad May 2, 2025
733f2c8
Cleanup old files, format new ones
sc2ad May 3, 2025
31d6fc8
Add validation logic to installs
sc2ad May 3, 2025
d8306d7
Add shim capi file, ensure we build with visibility=hidden
sc2ad May 3, 2025
368208e
Add android install, fixup cmakelists a bit
sc2ad May 3, 2025
7fe1eed
Remove PR run events, only do them for push events
sc2ad May 3, 2025
1115579
Add android test code if dropped into mods
sc2ad May 3, 2025
277ea3b
Ensure correct partial mod passes tests and builds
sc2ad May 8, 2025
a2ce927
Add custom formatters for various hook info
sc2ad May 8, 2025
04597e3
Add CAPI header, implementation to follow
sc2ad May 8, 2025
69357fa
Add CAPI header, implementation to follow
sc2ad May 8, 2025
9a0a163
Update .clang-tidy a bit
sc2ad May 12, 2025
9a86013
Add CAPI implementation, adjust comments to match
sc2ad Jul 23, 2025
e47d8da
Update flamingo test to handle b cases
sc2ad Jul 23, 2025
e397f70
Add final priority level for flamingo hooks
sc2ad Aug 26, 2025
2175926
Remove autogenerated git_info.h file
sc2ad Aug 26, 2025
6ba514d
Add build for android test to CI and add script for it
sc2ad Aug 26, 2025
94f1cfb
Remove mod.json, fix qpm*.json
sc2ad Sep 1, 2025
a37bfd4
Fix some docs in capi
sc2ad Sep 1, 2025
1ff3f51
Version bump in util
sc2ad Sep 1, 2025
ac330b7
Merge pull request #3 from sc2ad/dev/sc2ad/v1.0.0-milestone
sc2ad Sep 1, 2025
3da53aa
Update CI to support proper builds
sc2ad Sep 1, 2025
05988d8
Remove old publish script, use single source of truth
sc2ad Sep 1, 2025
c83d4ff
Merge pull request #5 from sc2ad/dev/sc2ad/v1.0.0-milestone
sc2ad Sep 1, 2025
d8a6b42
Fixup publish CI
sc2ad Sep 1, 2025
4cdde79
Remove implicit capstone dependency
sc2ad Sep 1, 2025
5fdb6fa
Merge pull request #6 from sc2ad/dev/sc2ad/new
sc2ad Sep 1, 2025
fe6b658
Fix usage of GIT_COMMIT
sc2ad Sep 3, 2025
90d4a2a
Merge pull request #7 from sc2ad/dev/sc2ad/gitinfo-fix
sc2ad Nov 27, 2025
61bfa18
fix: add pragma once
iLillie Nov 30, 2025
5c25f28
Merge pull request #8 from iLillie/patch-1
sc2ad Nov 30, 2025
284f901
HookInfo: Add converting constructor for name and priorities only
sc2ad Nov 30, 2025
d0cb4d7
Properly qualify fmt:: usage for format_to calls
sc2ad Nov 30, 2025
4cee52d
Workaround fmt bug on 11.0.2 for FMT_COMPILE nesting, test fmt logic …
sc2ad Nov 30, 2025
a60d8e6
util: Ensure header only flamingo builds do not attempt to export fla…
sc2ad Nov 30, 2025
906cc8a
Merge pull request #9 from sc2ad/dev/fixes
sc2ad Nov 30, 2025
c066de0
util: Fix FLAMINGO_HEADER_ONLY symbol exposal
sc2ad Dec 1, 2025
461993f
Merge pull request #10 from sc2ad/dev/fixes
sc2ad Dec 1, 2025
c1631e9
metadata: Add namespaze field and matching function to HookNameMetadata
Fernthedev Dec 26, 2025
d19e3da
Basic sorting, time to rewrite to topological graph
Fernthedev Dec 26, 2025
4c82139
Implement proper topological sort (untested)
Fernthedev Dec 26, 2025
00c2544
Add topological sort tests
Fernthedev Dec 26, 2025
3cf8d68
Redo topological sort based on before ordering
Fernthedev Dec 26, 2025
39c2e86
More hook tests
Fernthedev Dec 28, 2025
8939736
More work done for proper hook installations
Fernthedev Dec 28, 2025
c598226
Enhance topological sorting for hook installation by adding priority …
Fernthedev Dec 29, 2025
8dde653
Fix namespace hook matching
Fernthedev Dec 29, 2025
acec361
Fix topo sort too
Fernthedev Dec 29, 2025
3cf33b2
Try to make sense out of this and keep the previous behaviour
Fernthedev Dec 29, 2025
2e76ab3
Implement hook recompilation and fix tests
Fernthedev Dec 29, 2025
38887ac
Throw error if cycles
Fernthedev Dec 29, 2025
97e0197
Fix segfault
Fernthedev Dec 29, 2025
8e69adc
Fix priority cycle handling in hook installation tests
Fernthedev Dec 29, 2025
e6803fe
Add more tests
Fernthedev Dec 29, 2025
7d5011d
One more test and format
Fernthedev Dec 29, 2025
0001bbb
Refactor hook installation logic to improve priority handling and sim…
Fernthedev Dec 29, 2025
6e40091
Add hook management functions and memory management for hook info
Fernthedev Dec 29, 2025
7ebeff3
Flush instruction cache after writing jump in ShimTarget
Fernthedev Dec 29, 2025
51d7d05
Add comment
Fernthedev Dec 29, 2025
39f9315
Refactor flamingo_get_hooks to accept hooks array and capacity, impro…
Fernthedev Dec 29, 2025
f6d0d09
Enhance Reinstall function to topologically sort hooks by priority an…
Fernthedev Dec 29, 2025
3305b7f
Fix double free in Reinstall
Fernthedev Dec 29, 2025
e958f3a
Add tests for reinstall and uninstall functionality in hook management
Fernthedev Dec 29, 2025
5f9e405
Optimize Reinstall function by adjusting hook processing and adding T…
Fernthedev Dec 29, 2025
8f5f1e7
Update build configuration for test environment by adding build_test …
Fernthedev Dec 29, 2025
e6ab254
Preserve original hook order when detecting priority cycles in find_s…
Fernthedev Dec 29, 2025
de7a3c0
Do not use moved data
Fernthedev Dec 30, 2025
378f340
Revert dsocstring change
Fernthedev Dec 31, 2025
c6c14b7
Update docstrings accordingly
Fernthedev Mar 27, 2026
0cc5b08
Update filter logic and CAPI for consistency
Fernthedev Mar 27, 2026
72ccc11
move clear cache to dtor
Fernthedev Mar 27, 2026
65eec0a
Fix error macro
Fernthedev Mar 27, 2026
0b7239d
Make constructor implicit
Fernthedev Mar 27, 2026
ca90de0
Fix remaining broken filters in tests
Fernthedev Mar 27, 2026
010f977
Use `namespace`
Fernthedev Mar 27, 2026
7cdd42d
Run test script in CI
Fernthedev Mar 27, 2026
2cc22e3
Make test script executable
Fernthedev Mar 27, 2026
f7407fe
Remove commented
Fernthedev Apr 1, 2026
c719ed8
namespace
Fernthedev Apr 1, 2026
e948f80
clear cache before protection is lost
Fernthedev Apr 1, 2026
282dc5e
Empty space
Fernthedev Apr 1, 2026
5ddb006
Empty space
Fernthedev Apr 1, 2026
3325d01
Add debugging symbols and launcher
Fernthedev Apr 1, 2026
5b59de8
Refactor topological_sort_hooks_by_priority to return Result type and…
Fernthedev Apr 1, 2026
3b6c88d
log warnings
Fernthedev Apr 6, 2026
3c90a7f
Log hooks
Fernthedev Apr 6, 2026
8c15b8e
Simplify recompiling hooks
Fernthedev Apr 6, 2026
4c2c3c1
Use emplace_back
Fernthedev Apr 6, 2026
1e9b837
Add tests for hook order stability and mixed-priority stability
Fernthedev Apr 8, 2026
d62d781
Update comments to include hook order
Fernthedev Apr 8, 2026
88c7a7a
Refactor hook priority validation logic and remove redundant self-ref…
Fernthedev Apr 8, 2026
cf33ac5
Add formatted output for HookInfo and simplify hook sorting logic
Fernthedev Apr 8, 2026
4dbf909
Fix accident
Fernthedev Apr 8, 2026
1036a36
Change check to self priority.
Fernthedev Apr 8, 2026
79b6303
Add filtered hook retrieval functions and corresponding memory manage…
Fernthedev Apr 9, 2026
c9ca51c
use void* for target
Fernthedev Apr 9, 2026
0600c9a
Change logs to debug
Fernthedev Apr 30, 2026
d71a731
Seperate graph building and topo sorting as per scad's instructions (…
Fernthedev May 6, 2026
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
10 changes: 6 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 200
ColumnLimit: 120
CommentPragmas: NOLINT:.*
DerivePointerAlignment: false
IncludeBlocks: Preserve
IndentWidth: 4
IndentWidth: 2
PointerAlignment: Left
TabWidth: 4
TabWidth: 2
UseTab: Never
Cpp11BracedListStyle: false
Cpp11BracedListStyle: false
QualifierAlignment: Right
BracedInitializerIndentWidth: 2
23 changes: 23 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Checks: "clang-diagnostic-*,
clang-analyzer-*,
fuchsia-statically-constructed-objects,
*,
-readability-identifier-length,
-llvmlibc-*,
-llvm-namespace-comment,
-llvm-include-order,
-altera-*,
-fuchsia-*,
-modernize-use-trailing-return-type,
-cppcoreguidelines-avoid-non-const-global-variables,
-llvm-header-guard,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-avoid-do-while,
-hicpp-vararg,
-concurrency-mt-unsafe,
-modernize-use-using,
-abseil-*"
WarningsAsErrors: true
HeaderFilterRegex: ""
FormatStyle: file
66 changes: 66 additions & 0 deletions .github/workflows/build-android-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
workflow_dispatch:
push:
branches-ignore:
- "version-*"

env:
module_id: flamingo
qmodName: flamingo

jobs:
build-android-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
lfs: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt

- name: Setup qpm
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: false

- name: QPM Collapse
run: qpm-rust collapse

- name: Build
run: |
cd ${GITHUB_WORKSPACE}
qpm-rust s build-android-test

- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"

- name: Upload non-debug artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error

- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: debug_${{ steps.libname.outputs.NAME }}
path: ./build/debug/${{ steps.libname.outputs.NAME }}
if-no-files-found: error
248 changes: 148 additions & 100 deletions .github/workflows/build-ndk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,110 +4,158 @@ on:
workflow_dispatch:
push:
branches-ignore:
- 'version-*'
pull_request:
branches-ignore:
- 'version-*'
- "version-*"
tags:
- "v*"

env:
module_id: flamingo
module_id: flamingo
qmodName: flamingo

jobs:
test-local:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64

# Get QPM so we can bring in dependencies
- name: Setup qpm
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: false

- name: QPM Collapse
run: qpm collapse

- name: Run test script
run: |
cd ${GITHUB_WORKSPACE}
./test.sh

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
lfs: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt

- name: Get QPM
if: steps.cache-qpm.outputs.cache-hit != 'true'
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: cargo-build.yml
name: linux-qpm-rust
path: QPM
repo: RedBrumbler/QuestPackageManager-Rust

- name: QPM Collapse
run: |
chmod +x ./QPM/qpm-rust
./QPM/qpm-rust collapse

- name: QPM Dependencies Cache
id: cache-qpm-deps
uses: actions/cache@v2
env:
cache-name: cache-qpm-deps
with:
path: /home/runner/.local/share/QPM-Rust/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('qpm.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-


- name: QPM Restore
run: |
./QPM/qpm-rust restore

- name: List Post Restore
run: |
echo includes:
ls -la ${GITHUB_WORKSPACE}/extern/includes
echo libs:
ls -la ${GITHUB_WORKSPACE}/extern/libs
echo cache:
ls -la $HOME/.local/share/QPM-Rust/cache

- name: Prepare Clang Tidy Suggestions
if: ${{ github.event_name == 'pull_request' }}
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DTEST_BUILD=1 -B build

- name: Clang Tidy Suggestions
if: ${{ github.event_name == 'pull_request' }}
uses: ZedThree/clang-tidy-review@v0.7.0
id: review
# If there are any comments, don't build
- name: Clang Tidy Exit
if: ${{ github.event_name == 'pull_request' }} && steps.review.outputs.total_comments > 0
run: exit 1

- name: Build
run: |
cd ${GITHUB_WORKSPACE}
pwsh -Command ./build.ps1

- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo ::set-output name=NAME::"${files[0]}"

- name: Upload non-debug artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error

- name: Upload debug artifact
uses: actions/upload-artifact@v2
with:
name: debug_${{ steps.libname.outputs.NAME }}
path: ./build/debug_${{ steps.libname.outputs.NAME }}
if-no-files-found: error
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
lfs: true

- uses: seanmiddleditch/gha-setup-ninja@v3

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt

# get version from pushed tag
- name: Extract version
if: startsWith(github.ref, 'refs/tags/v')
id: version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}

- name: Setup qpm
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: false

# if we have a tag, we are making a qpm release
- name: Setup qpm for release
if: startsWith(github.ref, 'refs/tags/v')
uses: Fernthedev/qpm-action@v1
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: late
publish_token: ${{ secrets.QPM_TOKEN }}
version: ${{ steps.version.outputs.VERSION }}
tag: ${{ steps.version.outputs.TAG }}
qpm_release_bin: true
qpm_debug_bin: true
qpm_qmod: ${{ env.qmodName }}.qmod

- name: QPM Collapse
run: qpm collapse

- name: Build
run: |
cd ${GITHUB_WORKSPACE}
qpm s build

- name: Make mod.json
run: |
qpm qmod manifest

- name: Build & Create Qmod
run: |
cd ${GITHUB_WORKSPACE}
qpm qmod zip

- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo "NAME=${files[0]}" >> ${GITHUB_OUTPUT}

- name: Rename debug artifact
run: mv "./build/debug/${{ steps.libname.outputs.NAME }}" "./build/debug_${{steps.libname.outputs.NAME }}"

- name: Upload non-debug artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error

- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: debug_${{ steps.libname.outputs.NAME }}
path: ./build/debug_${{ steps.libname.outputs.NAME }}
if-no-files-found: error

- name: Upload qmod artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.qmodName}}.qmod
path: ./${{ env.qmodName }}.qmod
if-no-files-found: error

# if we had a tag, we should make a release
- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/v')
id: upload_file_release
uses: softprops/action-gh-release@v0.1.15
with:
tag_name: ${{ github.event.inputs.version }}
files: |
./build/${{ steps.libname.outputs.NAME }}
./build/debug_${{ steps.libname.outputs.NAME }}
./${{ env.qmodName }}.qmod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/clang-check.yml

This file was deleted.

Loading
Loading