Skip to content

Commit

Permalink
Switch litehook to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Nov 16, 2024
1 parent 65d0558 commit 847ca91
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 240 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "BaseBin/opainject"]
path = BaseBin/opainject
url = https://github.com/opa334/opainject
[submodule "BaseBin/_external/modules/litehook"]
path = BaseBin/_external/modules/litehook
url = https://github.com/opa334/litehook
1 change: 1 addition & 0 deletions BaseBin/_external/modules/litehook
Submodule litehook added at f4d083
4 changes: 2 additions & 2 deletions BaseBin/systemhook/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
TARGET = systemhook.dylib
CC = clang

CFLAGS = -I../.include -I./src -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -arch arm64 -arch arm64e -miphoneos-version-min=15.0 -Wno-deprecated-declarations -Os -moutline
CFLAGS = -I../.include -I./src -I../_external/modules/litehook/src -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -arch arm64 -arch arm64e -miphoneos-version-min=15.0 -Wno-deprecated-declarations -Os -moutline
LDFLAGS = -dynamiclib

sign: $(TARGET)
@ldid -S $^

$(TARGET): $(wildcard src/*.c src/*.m ../libjailbreak/src/jbclient_xpc.c)
$(TARGET): $(wildcard src/*.c src/*.m ../libjailbreak/src/jbclient_xpc.c ../_external/modules/litehook/src/*.c)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^

clean:
Expand Down
4 changes: 2 additions & 2 deletions BaseBin/systemhook/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static kSpawnConfig spawn_config_for_executable(const char* path, char *const ar
if (argv[0]) {
if (argv[1]) {
if (string_has_prefix(argv[1], "com.apple.WebKit.WebContent")) {
// The most sandboxed process on the system, we can't support it on iOS 16+ for now
// The most sandboxed process on the system, we can't support injection into it on iOS 16+ for now
if (__builtin_available(iOS 16.0, *)) {
return 0;
}
Expand Down Expand Up @@ -309,7 +309,7 @@ int posix_spawn_hook_shared(pid_t *restrict pid,
{
int (*posix_spawn_orig)(pid_t *restrict, const char *restrict, struct _posix_spawn_args_desc *, char *const[restrict], char *const[restrict]) = orig;

int r = spawn_exec_hook_common(path, argv, envp, desc, trust_binary, jetsamMultiplier, ^int(char *const envp_patched[restrict]){
int r = spawn_exec_hook_common(path, argv, envp, desc, trust_binary, jetsamMultiplier, ^int(char *const envp_patched[restrict]) {
return posix_spawn_orig(pid, path, desc, argv, envp_patched);
});

Expand Down
230 changes: 0 additions & 230 deletions BaseBin/systemhook/src/litehook.c

This file was deleted.

6 changes: 0 additions & 6 deletions BaseBin/systemhook/src/litehook.h

This file was deleted.

0 comments on commit 847ca91

Please sign in to comment.