diff --git a/HackingGuide.md b/HackingGuide.md new file mode 100644 index 0000000..e663367 --- /dev/null +++ b/HackingGuide.md @@ -0,0 +1,69 @@ +#Hacking Guide +##This is the guide for you to start adding modules/tools to the repo + + +###Modules +Modules can be generated by running ./Template.py Type Name + +Current Types: + +1. SDK +2. API +3. ThirdPartyTools +4. Utils + +For now, it only divides modules into seperate folders to make the modules look tidy. + +In the future we'll group settings based on those types. + +**Please Make Sure The Types Are Correct** + +Also.There is a init_XXX_hook function inside each module,which XXX in your module name. + +The main tweak will call that to init your hook.Check below for details + +###Names +####For Modules. +All these must be the same. + +1. Module File Name +2. init function name component (see Modules Part) + +*Please make sure the names are short and descriptive. We generate settings button text base on module name* + +####For Third Party Components +**Read ThirdPartyTools/README.md for detailed info ** + + +####Custom Preferences +Add Your Own Preferences in **Preferences/** With Filename **MODULENAME.plist** + +They will be injected into the *items* of the final Preferences Loader PLIST file + +####Marcos +Six Marcos Has Been Created For Logging Purposes. +Please Call Exactly In The Following Sequence + +1. WTInit(ClassName,methodName) **(For C Functions. Change ClassName to Library Name. For Example dlopen corresponds to dlfcn because it's in dlfcn.h)** +2. WTAdd(Argument,Name) **The First is the argument itself. The second is the argument name** +3. WTReturn(Return) **Return is the return value to add** +4. WTSave **No Arguments. It save the log to database.** +5. WTRelease **Release The Memory Of The Logger** +6. WTShouldLog **if(WTShouldLog){} to check if it's called by the app itself** + +Please Note: + +1. WTAdd can be called for many times. That's for adding Arguments +2. WTInit,WTSave,WTRelease Must Be Called Under any circumstances +3. Add Semicolons Yourself + +####Misc +Some functions don't come with the binary and you'll have to wait the related library to be loaded + +**Example: libMobileGestalt** + +I personally use a dyldCallBack for that. + +You might want to dlopen() that library itself + + diff --git a/Hooks/APIHooks/LSApplication.xm.empty b/Hooks/APIHooks/LSApplication.xm similarity index 91% rename from Hooks/APIHooks/LSApplication.xm.empty rename to Hooks/APIHooks/LSApplication.xm index ab79636..60947f2 100644 --- a/Hooks/APIHooks/LSApplication.xm.empty +++ b/Hooks/APIHooks/LSApplication.xm @@ -3,15 +3,28 @@ %hook LSApplicationProxy + (id)applicationProxyForBundleURL:(id)arg1{ id ret=%orig; - if ([CallStackInspector wasDirectlyCalledByApp]) { - CallTracer *tracer = [[CallTracer alloc] initWithClass:@"LSApplication" andMethod:@"applicationProxyForBundleURL"]; - [tracer addArgFromPlistObject:arg1 withKey:@"URL"]; - [traceStorage saveTracedCall: tracer]; - [tracer release]; + if (WTShouldLog) { + WTInit(@"LSApplicationProxy",@"applicationProxyForBundleURL:"); + WTAdd(arg1,@"BundleURL"); + WTReturn(ret); + WTSave; + WTRelease; } return ret; } -+ (id)applicationProxyForIdentifier:(id)arg1; ++ (id)applicationProxyForIdentifier:(id)arg1{ + id ret=%orig; + if(WTShouldLog){ + WTInit(@"LSApplicationProxy",@"applicationProxyForIdentifier:"); + WTAdd(arg1,@"Identifier"); + WTReturn(ret); + WTSave; + WTRelease; + } + return ret; + +} +/* + (id)applicationProxyForItemID:(id)arg1; + (id)applicationProxyWithBundleUnitID:(unsigned long)arg1; - (id)VPNPlugins; @@ -108,7 +121,6 @@ - (void)removeInstallProgressForBundleID:(id)arg1; - (void)removeObserver:(id)arg1; - (BOOL)uninstallApplication:(id)arg1 withOptions:(id)arg2; -- (BOOL)uninstallApplication:(id)arg1 withOptions:(id)arg2 usingBlock:(id /* block */)arg3; - (BOOL)unregisterApplication:(id)arg1; - (BOOL)unregisterPlugin:(id)arg1; - (id)unrestrictedApplications; @@ -136,7 +148,7 @@ - (id)machOUUIDs; - (unsigned int)sequenceNumber; - (void)setLocalizedShortName:(NSString *)arg1; -- (id)signerIdentity; +- (id)signerIdentity;*/ %end diff --git a/Hooks/SharedDefine.pch b/Hooks/SharedDefine.pch index 5454be7..4ee3f74 100644 --- a/Hooks/SharedDefine.pch +++ b/Hooks/SharedDefine.pch @@ -17,4 +17,10 @@ static NSString *preferenceFilePath = @"/private/var/mobile/Library/Preferences/naville.wtfjh.plist"; #define Meh1(x) #x -#define Meh(x) Meh1(x) \ No newline at end of file +#define Meh(x) Meh1(x) +#define WTInit(CLASSNAME,ARGUMENTNAME) CallTracer *tracer = [[CallTracer alloc] initWithClass:CLASSNAME andMethod:ARGUMENTNAME] +#define WTAdd(Argument,Name) [tracer addArgFromPlistObject:Argument withKey:Name] +#define WTReturn(Return) [tracer addReturnValueFromPlistObject:Return] +#define WTSave [traceStorage saveTracedCall: tracer] +#define WTRelease [tracer release]; +#define WTShouldLog [CallStackInspector wasDirectlyCalledByApp] \ No newline at end of file diff --git a/Makefile b/Makefile index 36512af..23fb973 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ -export CFLAGS=-Wp,"-DWTFJHTWEAKNAME=@\"XCBE5GAFU7GR103\"" +export CFLAGS=-Wp,"-DWTFJHTWEAKNAME=@\"VI2C2SU2XWI4XM7\"" include theos/makefiles/common.mk export ARCHS = armv7 armv7s arm64 export TARGET = iphone:clang:7.0:7.0 -TWEAK_NAME = XCBE5GAFU7GR103 -XCBE5GAFU7GR103_FILES = Tweak.xm CompileDefines.xm Hooks/APIHooks/AntiAntiDebugging.xm Hooks/APIHooks/CommonCryptor.xm Hooks/APIHooks/CommonDigest.xm Hooks/APIHooks/CommonHMAC.xm Hooks/APIHooks/CommonKeyDerivation.xm Hooks/APIHooks/CoreTelephony.xm Hooks/APIHooks/dlfcn.xm Hooks/APIHooks/Keychain.xm Hooks/APIHooks/libC.xm Hooks/APIHooks/libMobileGestalt.xm Hooks/APIHooks/NSData.xm Hooks/APIHooks/NSFileHandle.xm Hooks/APIHooks/NSFileManager.xm Hooks/APIHooks/NSHTTPCookie.xm Hooks/APIHooks/NSInputStream.xm Hooks/APIHooks/NSKeyedArchiver.xm Hooks/APIHooks/NSKeyedUnarchiver.xm Hooks/APIHooks/NSOutputStream.xm Hooks/APIHooks/NSProcessInfo.xm Hooks/APIHooks/NSURLConnection.xm Hooks/APIHooks/NSURLCredential.xm Hooks/APIHooks/NSURLSession.xm Hooks/APIHooks/NSUserDefaults.xm Hooks/APIHooks/NSXMLParser.xm Hooks/APIHooks/Security.xm Hooks/APIHooks/SSLKillSwitch.xm Hooks/APIHooks/sysctl.xm Hooks/APIHooks/UIPasteboard.xm Hooks/SDKHooks/FclBlowfish.xm Hooks/SDKHooks/JSPatch.xm Hooks/SDKHooks/OpenSSLAES.xm Hooks/SDKHooks/OpenSSLBlowFish.xm Hooks/SDKHooks/OpenSSLMD5.xm Hooks/SDKHooks/OpenSSLSHA1.xm Hooks/SDKHooks/OpenSSLSHA512.xm Hooks/SDKHooks/Wax.xm Hooks/Utils/CallStackInspector.m Hooks/Utils/CallTracer.m Hooks/Utils/DelegateProxies.m Hooks/Utils/NSURLConnectionDelegateProx.m Hooks/Utils/NSURLSessionDelegateProxy.m Hooks/Utils/PlistObjectConverter.m Hooks/Utils/RuntimeUtils.m Hooks/Utils/SQLiteStorage.m Hooks/Utils/Utils.m Hooks/ThirdPartyTools/DeviceIDFake.xm Hooks/ThirdPartyTools/InspectiveC.xm +TWEAK_NAME = VI2C2SU2XWI4XM7 +VI2C2SU2XWI4XM7_FILES = Tweak.xm CompileDefines.xm Hooks/APIHooks/AntiAntiDebugging.xm Hooks/APIHooks/CommonCryptor.xm Hooks/APIHooks/CommonDigest.xm Hooks/APIHooks/CommonHMAC.xm Hooks/APIHooks/CommonKeyDerivation.xm Hooks/APIHooks/CoreTelephony.xm Hooks/APIHooks/dlfcn.xm Hooks/APIHooks/Keychain.xm Hooks/APIHooks/libC.xm Hooks/APIHooks/libMobileGestalt.xm Hooks/APIHooks/LSApplication.xm Hooks/APIHooks/NSData.xm Hooks/APIHooks/NSFileHandle.xm Hooks/APIHooks/NSFileManager.xm Hooks/APIHooks/NSHTTPCookie.xm Hooks/APIHooks/NSInputStream.xm Hooks/APIHooks/NSKeyedArchiver.xm Hooks/APIHooks/NSKeyedUnarchiver.xm Hooks/APIHooks/NSOutputStream.xm Hooks/APIHooks/NSProcessInfo.xm Hooks/APIHooks/NSURLConnection.xm Hooks/APIHooks/NSURLCredential.xm Hooks/APIHooks/NSURLSession.xm Hooks/APIHooks/NSUserDefaults.xm Hooks/APIHooks/NSXMLParser.xm Hooks/APIHooks/Security.xm Hooks/APIHooks/SSLKillSwitch.xm Hooks/APIHooks/sysctl.xm Hooks/APIHooks/UIPasteboard.xm Hooks/SDKHooks/FclBlowfish.xm Hooks/SDKHooks/JSPatch.xm Hooks/SDKHooks/OpenSSLAES.xm Hooks/SDKHooks/OpenSSLBlowFish.xm Hooks/SDKHooks/OpenSSLMD5.xm Hooks/SDKHooks/OpenSSLSHA1.xm Hooks/SDKHooks/OpenSSLSHA512.xm Hooks/SDKHooks/Wax.xm Hooks/Utils/CallStackInspector.m Hooks/Utils/CallTracer.m Hooks/Utils/DelegateProxies.m Hooks/Utils/NSURLConnectionDelegateProx.m Hooks/Utils/NSURLSessionDelegateProxy.m Hooks/Utils/PlistObjectConverter.m Hooks/Utils/RuntimeUtils.m Hooks/Utils/SQLiteStorage.m Hooks/Utils/Utils.m Hooks/ThirdPartyTools/DeviceIDFake.xm Hooks/ThirdPartyTools/InspectiveC.xm ADDITIONAL_CCFLAGS = -Qunused-arguments ADDITIONAL_LDFLAGS = -Wl,-segalign,4000,-sectcreate,WTFJH,SIGDB,./SignatureDatabase.plist,-sectcreate,WTFJH,DeviceIDFake,./DeviceIDFake.dylib,-sectcreate,WTFJH,InspectiveC,./InspectiveC.dylib -XCBE5GAFU7GR103_LIBRARIES = sqlite3 substrate -XCBE5GAFU7GR103_FRAMEWORKS = Foundation UIKit Security +VI2C2SU2XWI4XM7_LIBRARIES = sqlite3 substrate +VI2C2SU2XWI4XM7_FRAMEWORKS = Foundation UIKit Security include $(THEOS_MAKE_PATH)/tweak.mk after-install:: install.exec "killall -9 SpringBoard" \ No newline at end of file diff --git a/VERSION b/VERSION index 059361f..ab760c9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -317 \ No newline at end of file +319 \ No newline at end of file