Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3da8f21
add ctest patch, add per patch toggle, made overlay more organised
ITotalJustice May 26, 2023
d5fbbd4
fix detecting if nifm ctest patch is already applied
ITotalJustice May 27, 2023
e813595
fix options "logging" key missmatch between sysmod and overlay
ITotalJustice May 28, 2023
982843a
update noncasigchk for fw 17.
ITotalJustice Oct 24, 2023
2610c25
FW 18 Update
impeeza Mar 28, 2024
01e2fbf
Update README.md
impeeza Mar 28, 2024
e3ad7ec
feature: change workflow
pgalonza Jun 5, 2024
0eb731b
feature: add parallel jobs for make
pgalonza Jun 6, 2024
d951a6f
feature: change libtesla repo
pgalonza Jun 8, 2024
327c27e
Merge pull request #1 from pgalonza/master
impeeza Jun 8, 2024
4a12f5e
Update build-jobs.yaml
impeeza Jun 8, 2024
2562919
Update .gitmodules
impeeza Jun 8, 2024
1b9327c
Add New patterns for latest Atmosphère Changes
impeeza Jun 9, 2024
5b6447e
Merge pull request #2 from impeeza/impeeza-ATMPost05fde7b
impeeza Jun 9, 2024
88297f8
Bump version
impeeza Jun 11, 2024
c7aee42
1.5.3
impeeza Oct 20, 2024
aff2498
Consolidate Patches
impeeza Oct 24, 2024
c8e5936
Typo Correction
impeeza Oct 24, 2024
b2bb089
Add nim crashfix for blanker/incognito
borntohonk Oct 26, 2024
54441b6
Merge pull request #5 from borntohonk/master
impeeza Oct 26, 2024
3de2853
Update build-jobs.yaml
impeeza Oct 27, 2024
9293335
:)
borntohonk Oct 27, 2024
589e3ab
Fix when pattern can be in between 2 READ_BUFFER_SIZE boundries
shadow2560 Dec 3, 2024
5842b3c
mov_cond3 function renamed to mov3_cond
shadow2560 Dec 3, 2024
e86f471
Set version 1.5.5
borntohonk Dec 4, 2024
32c7757
Merge pull request #9 from borntohonk/master
impeeza Dec 4, 2024
9236d1f
Add changes propposed by HeikesFootSlave
impeeza May 4, 2025
90dc2a9
Merge pull request #13 from impeeza/HeikesFootSlave-SeveralImprovements
impeeza May 4, 2025
71895fd
Revert "Add changes propposed by HeikesFootSlave"
impeeza May 4, 2025
dfa2228
Merge pull request #14 from impeeza/revert-13-HeikesFootSlave-Several…
impeeza May 4, 2025
d0f5451
Fix nifm for 20.0.0+
borntohonk May 4, 2025
2ca9ba8
Merge pull request #12 from borntohonk/master
impeeza May 5, 2025
1b33fdd
replace loader patch with different one
borntohonk Jul 26, 2025
0de0f4a
fix fs and nim for 21.0.0
borntohonk Nov 11, 2025
1118d12
Merge pull request #15 from borntohonk/loader
impeeza Nov 11, 2025
01ead82
Revert "fix fs, nim for 21.0.0, replace loader patch"
impeeza Nov 11, 2025
c10024c
Merge pull request #16 from impeeza/revert-15-loader
impeeza Nov 11, 2025
45312d8
add 21.0.0 support
borntohonk Nov 11, 2025
aad0f1e
Merge pull request #18 from borntohonk/master
impeeza Nov 11, 2025
4f8ccf6
fix new loader patch for atmosphere 1.10.0
borntohonk Nov 16, 2025
4b70509
Merge pull request #19 from borntohonk/master
borntohonk Nov 16, 2025
212a604
force acquire latest packages from pacman
borntohonk Nov 16, 2025
3f3c075
Merge pull request #20 from borntohonk/master
borntohonk Nov 16, 2025
b3a3294
Revert "force acquire latest packages from pacman"
borntohonk Nov 16, 2025
4161f45
actually verify ctest for newer firmware
borntohonk Nov 16, 2025
ce3c04c
Merge pull request #21 from borntohonk/master
borntohonk Nov 16, 2025
2b8ec7c
Correct Typos on Makefiles
impeeza Nov 16, 2025
91b0387
Merge pull request #22 from impeeza/impeeza-makefiles
impeeza Nov 16, 2025
c37c503
fix es for 21.0.0
borntohonk Nov 17, 2025
568efe9
Merge pull request #23 from borntohonk/master
borntohonk Nov 17, 2025
fc0f394
accidental remnant bracket
borntohonk Nov 17, 2025
f92f775
Merge pull request #24 from borntohonk/master
borntohonk Nov 17, 2025
b774496
fix typo
borntohonk Nov 17, 2025
2f0ca2a
Merge pull request #25 from borntohonk/master
borntohonk Nov 17, 2025
62e15f4
Add libnx dependency installation step
impeeza Nov 17, 2025
64a918f
Fix indentation in build-jobs.yaml
impeeza Nov 17, 2025
a516a22
Revert libnx build as devkkitpro/devkita64 docker image was updated w…
borntohonk Nov 18, 2025
1abdcfa
Merge pull request #26 from borntohonk/master
borntohonk Nov 18, 2025
3d4ce3e
add optional no_erpt patches
borntohonk Nov 18, 2025
7020bf9
add optional no_erpt patches
borntohonk Nov 18, 2025
c826f32
Remove duplicate list item for 'no_erpt'
impeeza Nov 18, 2025
ff5edbc
fix optional erpt-cond
borntohonk Nov 19, 2025
8d4d183
fix optional erpt-cond
borntohonk Nov 19, 2025
203c1c0
refactor conds, patterns, and remove ssl patches, add new olsc patch
borntohonk Nov 25, 2025
b47cd64
Merge pull request #29 from borntohonk/master
impeeza Dec 27, 2025
4ddb89e
overlap buffer
borntohonk Dec 27, 2025
f407d0d
overlap buffer change - 1.5.9
borntohonk Dec 27, 2025
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
52 changes: 52 additions & 0 deletions .github/workflows/build-jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build jobs

on:
workflow_call:
workflow_dispatch:
push:

jobs:
build:
runs-on: ubuntu-latest
container: devkitpro/devkita64

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
path: sys-patch
submodules: recursive

- name: Build sys-patch
run: |
make -C sys-patch -j$(nproc) dist && \
VERSION=$(grep 'export VERSION := ' sys-patch/Makefile | cut -c 19-)
TAGVERSION=$(curl -s https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | grep "tag_name" | head -1 | cut -d '"' -f 4)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "TAGVERSION=${TAGVERSION}" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
overwrite: true
name: sys-patch-${{ env.VERSION }}
path: sys-patch/out/

- name: Fetch git cli and upload release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ${{ env.TAGVERSION }} = v${{ env.VERSION }} ];
then echo "Tag version and makefile version are same, don't publish release, only artifact uploaded."
else
wget -q $(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep "browser_download_url" | grep "linux_amd64.tar.gz" | head -1 | cut -d '"' -f 4) && \
tar -xzf gh*.tar.gz && \
chmod +x gh*/bin/gh && \
chmod +x gh*/bin/gh && \
cp gh*/bin/gh /bin/gh && \
rm gh*.tar.gz && \
rm -rf gh*
gh release create v${{ env.VERSION }} sys-patch/sys-patch.zip --title "Sys-patch version ${{ env.VERSION }}" --repo github.com/$GITHUB_REPOSITORY
fi
21 changes: 0 additions & 21 deletions .github/workflows/build_depoly.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "overlay/libtesla"]
path = overlay/libtesla
url = https://github.com/ITotalJustice/libtesla.git
branch = tj
url = https://github.com/WerWolv/libtesla
branch = master
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ MAKEFILES := sysmod overlay
TARGETS := $(foreach dir,$(MAKEFILES),$(CURDIR)/$(dir))

# the below was taken from atmosphere + switch-examples makefile
export VERSION := 1.3.0
export VERSION := 1.5.9

ifneq ($(strip $(shell git symbolic-ref --short HEAD 2>/dev/null)),)
export GIT_BRANCH := $(shell git symbolic-ref --short HEAD)
else
export GIT_BRANCH := notbranch
endif

ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
export GIT_REVISION := $(GIT_BRANCH)-$(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -41,6 +46,7 @@ $(TARGETS):

clean:
@rm -rf out
@rm -f sys-patch.zip
@for i in $(TARGETS); do $(MAKE) -C $$i clean || exit 1; done;

dist: all
Expand Down
78 changes: 36 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# sys-patch

A script-like system module that patches fs, es and ldr on boot.
A script-like system module that patches **fs**, **es**, **ldr**, **nifm** and **nim** on boot.

---

## Config

sys-patch features a simple config. This can be manually editied or updated using the overlay.
**sys-patch** features a simple config. This can be manually edited or updated using the overlay.

the config file can be found in `/config/sys-patch/config.ini`, if the file does not exist, the file will be created when sys-patch is run.
The configuration file can be found in `/config/sys-patch/config.ini`. The file is generated once the module is ran for the first time.

```ini
[options]
patch_sysmmc=1 ; 1=(default) patch sysmmc, 0=don't patch sysmmc
patch_emummc=1 ; 1=(default) patch emummc, 0=don't patch emummc
logging=1 ; 1=(default) output /config/sys-patch/log.ini 0=no log
version_skip=1 ; 1=(default) skips out of date patterns, 0=search all patterns
patch_sysmmc=1 ; 1=(default) patch sysmmc, 0=don't patch sysmmc
patch_emummc=1 ; 1=(default) patch emummc, 0=don't patch emummc
enable_logging=1 ; 1=(default) output /config/sys-patch/log.ini 0=no log
version_skip=1 ; 1=(default) skips out of date patterns, 0=search all patterns
```

---

## Overlay

the overlay can be used to change the config options and to see what patches are applied (if any).
The overlay can be used to change the config options and to see what patches are applied.

- Unpatched means the patch wasn't applied (likely not found).
- Patched (green) means it was patched by sys-patch.
- Patched (yellow) means it was already patched, likely by sigpatches or a custom atmosphere build.
- Patched (yellow) means it was already patched, likely by sigpatches or a custom Atmosphere build.

<p float="left">
<img src="https://i.imgur.com/yDhTdI6.jpg" width="400" />
Expand All @@ -40,63 +40,55 @@ the overlay can be used to change the config options and to see what patches are
## Building

### prerequisites
- install devkitpro
- Install [devkitpro](https://devkitpro.org/wiki/Getting_Started)
- Run the following:
```sh
git clone --recurse-submodules https://github.com/ITotalJustice/sys-patch.git
cd ./sys-patch
make
```

```sh
git clone --recurse-submodules https://github.com/ITotalJustice/sys-patch.git
cd sys-patch
make
```

the output of `out/` can be copied to your sd card. for the sysmodule to take effect, rebot your switch, or, use [sysmodules overlay](https://github.com/WerWolv/ovl-sysmodules/tree/master/source) to start it.
The output of `out/` can be copied to your SD card.
To activate the sys-module, reboot your switch, or, use [sysmodules overlay](https://github.com/WerWolv/ovl-sysmodules/releases/latest) with the accompanying overlay to activate it.

---

## What is being patched?

Here's a quick run down of what's being patched

- fs
- es
- ldr
Here's a quick run down of what's being patched:

fs and es need new patches after every new fw version.
- **fs** and **es** need new patches after every new firmware version.
- **ldr** needs new patches after every new [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere/) release.
- **nifm** ctest patch allows the device to connect to a network without needing to make a connection to a server
- **nim** patches to the ssl function call within nim that queries "https://api.hac.%.ctest.srv.nintendo.net/v1/time", and crashes the console if console ssl certificate is not intact. This patch instead makes the console not crash.

ldr on the other hand needs new patches after every new atmosphere release. this is due to ldr service being reimplemented by atmosphere. in fw 10.0.0, a new check was added to ofw which we needed to patch out. As atmosphere closely follows what ofw does, it also added this check. This is why a new patch is needed per atmosphere update.
The patches are applied on boot. Once done, the sys-module stops running.
The memory footprint *(16kib)* and the binary size *(~50kib)* are both very small.

---

## How does it work?
## FAQ:

it uses a collection of patterns to find the piece of code to patch. alternatively, it could just use offsets, however this would mean this tool would have to be updated after every new fw update, that's not ideal.
### If I am using sigpatches already, is there any point in using this?

the patches are applied at boot, then, the sysmod stops running. the memory footpint of the sysmod is very very small, only using 16kib in total. the size of the binary itself is only ~50kib! this doesnt really mean much, but im pretty proud of it :)

---

## Does this mean i should stop downloading / using sigpatches?

No, i would personally recommend continuing to use sigpatches. Reason being is that should this tool ever break, i likely wont be quick to fix it.

---
Yes, in 3 situations.

## If i am using sigpatches already, is there any point in using this as well?
1. A new **ldr** patch needs to be created after every Atmosphere update. Sometimes, a new silent Atmosphere update is released. This tool will always patch **ldr** without having to update patches.

Yes, in 2 niche cases.
2. Building Atmosphere from src will require you to generate a new **ldr** patch for that custom built Atmosphere. This is easy enough due to the public scripts / tools that exist out there, however this will always be able to patch **ldr**.

1. A new ldr patch needs to be created after every atmosphere update. Sometimes, a new silent atmosphere update is released. This tool will always patch ldr without having to update patches.
3. If you forget to update your patches when you update your firmware / Atmosphere, this sys-module should be able to patch everything. So it can be used as a fall back.

2. Building atmosphere from src will require you to generate a new ldr patch for that custom built atmosphere. This is easy enough due to the public scripts / tools that exist out there, however this will always be able to
### Does this mean that I should stop downloading / using sigpatches?

Also, if you forget to update your patches when you update fw / atmosphere, this sysmod should be able to patch everything just fine! so it's nice to have as a fallback.
No, I would personally recommend continuing to use sigpatches. Reason being is that should this tool ever break, i likely wont be quick to fix it.

---

## Credits / Thanks

software is built on the shoulders of giants. this tool wouldn't be possible wthout these people:
Software is built on the shoulders of giants. This tool wouldn't be possible without these people:

- DarkMatterCore
- MrDude
- BornToHonk (farni)
- TeJay
Expand All @@ -105,3 +97,5 @@ software is built on the shoulders of giants. this tool wouldn't be possible wth
- DevkitPro (toolchain)
- [minIni](https://github.com/compuphase/minIni)
- [libtesla](https://github.com/WerWolv/libtesla)
- [Shoutout to the best switch cfw setup guide](https://rentry.org/SwitchHackingIsEasy)
- N
69 changes: 69 additions & 0 deletions configs/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing whitespace from the templates
trim = true

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security" },
{ body = ".*", group = "Other (unconventional)" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# regex for matching git tags
tag_pattern = "[0-9]+.[0-9]+.[0-9]+"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
Loading