A dylib for iOS that hooks file-access functions so games like Bully or GTA San Andreas transparently load modded files from Documents/disk/ instead of the app bundle.
On non-jailbroken iOS the .app bundle is read-only. This dylib doesn't try to write into it. Instead it:
- Hooks C functions:
fopen,open,stat,access - Swizzles ObjC methods:
NSBundle -pathForResource:ofType:,NSFileManager -contentsAtPath: - When the game requests a file from its
.appbundle, the hook checks if a replacement exists atDocuments/disk/<same relative path> - If yes → returns the modded file. If no → falls through to the original.
FileRedirectDylib/
├── .github/
│ └── workflows/
│ └── build.yml ← GitHub Actions CI (builds on free macOS runner)
├── tweak.m ← Main hook/swizzle logic
├── fishhook.h ← Facebook fishhook header
├── fishhook.c ← Facebook fishhook implementation
├── Makefile ← Build script
└── README.md ← This file
You do NOT need a Mac. GitHub gives you a free macOS build machine.
- Create a GitHub account if you don't have one: https://github.com
- Create a new repository (e.g.
FileRedirectDylib) - Upload all files from this folder to the repo, keeping the folder structure
(make sure
.github/workflows/build.ymlis included) - Push / commit — the build runs automatically
- Go to the Actions tab in your repo
- Click the latest workflow run → click FileRedirect-dylib under "Artifacts"
- Download the zip — it contains
FileRedirect.dylibready to inject
You can also trigger a build manually: Actions tab → "Build FileRedirect.dylib" → "Run workflow".
If you do have access to a Mac:
cd FileRedirectDylib
makeThis produces FileRedirect.dylib targeting iOS arm64 (min iOS 12.0).
Requirements:
- macOS with Xcode or Xcode Command Line Tools
- iOS SDK (included with Xcode)
# 1. Unzip the IPA
mkdir payload && cd payload
unzip ../GameName.ipa
# 2. Copy dylib into the .app
cp FileRedirect.dylib Payload/GameName.app/
# 3. Inject the load command
insert_dylib --strip-codesig --inplace \
@executable_path/FileRedirect.dylib \
Payload/GameName.app/GameName
# 4. Re-zip as IPA
zip -r ../GameName-modded.ipa Payload/optool install -c load -p @executable_path/FileRedirect.dylib \
-t Payload/GameName.app/GameNameAfter injection, the IPA needs to be re-signed:
- iOS App Signer (macOS GUI) — easiest option
- ldid —
ldid -S Payload/GameName.app/GameName - codesign —
codesign -f -s "Apple Development: you@email.com" Payload/GameName.app
Then sideload with:
- AltStore / Sideloadly / TrollStore (if available)
- Install the modded IPA on your device
- Open a file manager (e.g. Files app, or via iTunes File Sharing)
- Navigate to the app's
Documents/folder - Create a
disk/subfolder if it doesn't exist (the dylib also auto-creates it) - Place your modded files inside
disk/, mirroring the.appbundle structure
If the original file is at:
GameName.app/texdb/gta3.txd
Place your modded version at:
Documents/disk/texdb/gta3.txd
The dylib will intercept the read and serve your file instead.
The dylib logs all redirected file accesses to the device console. View them with:
# Via Xcode → Window → Devices and Simulators → Open Console
# Or via idevicesyslog:
idevicesyslog | grep "FileRedirect"Look for lines like:
[FileRedirect] fopen: /var/containers/.../MyApp.app/data/file.dat -> /var/containers/.../Documents/disk/data/file.dat
To disable logging in production, set REDIRECT_LOG_ENABLED to 0 in tweak.m.
- This works on non-jailbroken iOS via sideloading
- The
.appbundle is never modified at runtime — all redirection is in-memory - If a file is NOT in
Documents/disk/, the original bundle file is used (no breakage) - Compatible with Bully, GTA San Andreas, GTA III, GTA Vice City, Max Payne, and other Rockstar iOS ports