Skip to content

Commit

Permalink
no need for C++
Browse files Browse the repository at this point in the history
fix crash bug on arm64e
  • Loading branch information
ChiChou committed Jan 4, 2024
1 parent e93cb7b commit 73e9c75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
include $(THEOS)/makefiles/common.mk

TWEAK_NAME = webinspect
webinspect_FILES = Tweak.xm

webinspect_CFLAGS = -std=c++11 -stdlib=libc++
webinspect_LDFLAGS = -stdlib=libc++
webinspect_FILES = Tweak.x

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "launchctl stop com.apple.webinspectord"
install.exec "launchctl kickstart -k -p system/com.apple.webinspectord"
echo you need to kill the target App and restart Safari to make it work
3 changes: 2 additions & 1 deletion Tweak.xm → Tweak.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <substrate.h>
#import <Foundation/Foundation.h>
#include <dlfcn.h>

#define LOG(fmt, ...) NSLog(@"[WebInspect] " fmt "\n", ##__VA_ARGS__)

Expand Down Expand Up @@ -38,7 +39,7 @@ CFTypeRef hooked_SecTaskCopyValueForEntitlement(void *task, CFStringRef entitlem
LOG("Security framework not found, it is impossible");
return;
}
SecTaskCopySigningIdentifier = (sec_task_copy_id_t *)MSFindSymbol(image, "_SecTaskCopySigningIdentifier");
SecTaskCopySigningIdentifier = (sec_task_copy_id_t *)dlsym(RTLD_DEFAULT, "SecTaskCopySigningIdentifier");
MSHookFunction(
MSFindSymbol(image, "_SecTaskCopyValueForEntitlement"),
(void *)hooked_SecTaskCopyValueForEntitlement,
Expand Down

0 comments on commit 73e9c75

Please sign in to comment.