diff --git a/.gitignore b/.gitignore index d4b1937..a162171 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,7 @@ Reveal* Reveal.framework RevealTMP/ *.db -/*.db \ No newline at end of file +/*.db +./ExtraFWs/*.* +ExtraFWs/*.* +DEBS/*.* \ No newline at end of file diff --git a/BuildConfig.py b/BuildConfig.py index 3ad6818..31e0144 100644 --- a/BuildConfig.py +++ b/BuildConfig.py @@ -1,8 +1,7 @@ #Put Your Lists Here ManualList=["GlobalInit","getBoolFromPreferences","RandomString"] -ExtraFramework=["Cycript","Reveal","UIKit","CoreGraphics","CoreFoundation","QuartzCore","CFNetwork"] +ExtraFramework=["UIKit","CoreGraphics","CoreFoundation","QuartzCore","CFNetwork"] ExtraLibrary=[] -LDFLAGS=["-lz","-L.","-v","-force_load","libcapstone.a","-force_load","libkeystone.a"] -#LDFLAGS=[] -ObjFiles=[] +LDFLAGS=["-lz","-L.","-v","-force_load","./ExtraFWs/libcapstone.a","-force_load","./ExtraFWs/libkeystone.a","-F./ExtraFWs/"] ExtraCFlags=[] +ExtraOBJFiles=["./ExtraFWs/Reveal.framework/Reveal","./ExtraFWs/Cycript.framework/Cycript"] diff --git a/Hooks/Misc/Cycript.xm b/Hooks/Misc/Cycript.xm index b6e716c..ddd62c2 100644 --- a/Hooks/Misc/Cycript.xm +++ b/Hooks/Misc/Cycript.xm @@ -1,10 +1,10 @@ #import "../SharedDefine.pch" //extern void CYListenServer(short port); -typedef void (*CYListenServer)(short port); -static CYListenServer CYListenServerFuncPointer; +//typedef void (*CYListenServer)(short port); +//static CYListenServer CYListenServerFuncPointer; extern void init_Cycript_hook() { - void* Handle=dlopen(NULL,RTLD_GLOBAL | RTLD_NOW); + /*void* Handle=dlopen(NULL,RTLD_GLOBAL | RTLD_NOW); CYListenServerFuncPointer=(CYListenServer)dlsym(Handle,"_CYListenServer"); dlclose(Handle); //Fuck Theos @@ -14,7 +14,7 @@ extern void init_Cycript_hook() { } else{ NSLog(@"Cycript Failed To Start"); - } - + }*/ + CYListenServer(CyPort); //Shall We Inform DeviceIP and Port Through GUI? } diff --git a/Hooks/SharedDefine.pch b/Hooks/SharedDefine.pch index 70adadc..5393d61 100644 --- a/Hooks/SharedDefine.pch +++ b/Hooks/SharedDefine.pch @@ -17,6 +17,7 @@ #import "./Misc/fishhook.h" #import "./Obfuscation.h" #import "./capstone/capstone.h" +#import "Cycript.h" #import "keystone/keystone.h" #define objectTypeNotSupported @"objectTypeNotSupported" diff --git a/Makefile b/Makefile index a678452..012841e 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -export CFLAGS=-Wp,"-DWTFJHTWEAKNAME=@\"KZBCMTTQ59YLMQN\","-DWTFJHHostName=@\"Naville-Zhang-Retina-MacBook-Pro-2\" +export CFLAGS=-Wp,"-DWTFJHTWEAKNAME=@\"5FM6FKAPNPR3PSM\","-DWTFJHHostName=@\"Naville-Zhang-Retina-MacBook-Pro-2\" include $(THEOS)/makefiles/common.mk -TWEAK_NAME = KZBCMTTQ59YLMQN +TWEAK_NAME = 5FM6FKAPNPR3PSM SUBSTRATE ?= yes -KZBCMTTQ59YLMQN_FILES = Tweak.xm CompileDefines.xm Hooks/API/AppleAccount.xm Hooks/API/CommonCryptor.xm Hooks/API/CommonDigest.xm Hooks/API/CommonHMAC.xm Hooks/API/CommonKeyDerivation.xm Hooks/API/CoreTelephony.xm Hooks/API/dlfcn.xm Hooks/API/Keychain.xm Hooks/API/libC.xm Hooks/API/libMobileGestalt.xm Hooks/API/LSApplication.xm Hooks/API/MachO.xm Hooks/API/Notification.xm Hooks/API/NSData.xm Hooks/API/NSFileHandle.xm Hooks/API/NSFileManager.xm Hooks/API/NSHTTPCookie.xm Hooks/API/NSInputStream.xm Hooks/API/NSKeyedArchiver.xm Hooks/API/NSKeyedUnarchiver.xm Hooks/API/NSOutputStream.xm Hooks/API/NSProcessInfo.xm Hooks/API/NSURLConnection.xm Hooks/API/NSURLCredential.xm Hooks/API/NSURLSession.xm Hooks/API/NSUserDefaults.xm Hooks/API/NSXMLParser.xm Hooks/API/ObjCRuntime.xm Hooks/API/Security.xm Hooks/API/Socket.xm Hooks/API/SSLKillSwitch.xm Hooks/API/sysctl.xm Hooks/API/UIPasteboard.xm Hooks/SDK/FclBlowfish.xm Hooks/SDK/JSPatch.xm Hooks/SDK/OpenSSLAES.xm Hooks/SDK/OpenSSLBlowFish.xm Hooks/SDK/OpenSSLMD5.xm Hooks/SDK/OpenSSLSHA1.xm Hooks/SDK/OpenSSLSHA512.xm Hooks/SDK/Reveal.xm Hooks/SDK/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/RemoteLogSender.m Hooks/Utils/RuntimeUtils.m Hooks/Utils/SQLiteStorage.m Hooks/Utils/Utils.m Hooks/ThirdPartyTools/classdumpdyld.xm Hooks/ThirdPartyTools/dumpdecrypted.xm Hooks/ThirdPartyTools/InspectiveC.xm Hooks/Misc/Cycript.xm Hooks/Misc/fishhook.c Hooks/Misc/RemoveASLR.xm Hooks/Misc/SplitMachO.mm Hooks/Misc/WTSubstrate.mm +5FM6FKAPNPR3PSM_FILES = Tweak.xm CompileDefines.xm Hooks/API/AppleAccount.xm Hooks/API/CommonCryptor.xm Hooks/API/CommonDigest.xm Hooks/API/CommonHMAC.xm Hooks/API/CommonKeyDerivation.xm Hooks/API/CoreTelephony.xm Hooks/API/dlfcn.xm Hooks/API/Keychain.xm Hooks/API/libC.xm Hooks/API/libMobileGestalt.xm Hooks/API/LSApplication.xm Hooks/API/MachO.xm Hooks/API/Notification.xm Hooks/API/NSData.xm Hooks/API/NSFileHandle.xm Hooks/API/NSFileManager.xm Hooks/API/NSHTTPCookie.xm Hooks/API/NSInputStream.xm Hooks/API/NSKeyedArchiver.xm Hooks/API/NSKeyedUnarchiver.xm Hooks/API/NSOutputStream.xm Hooks/API/NSProcessInfo.xm Hooks/API/NSURLConnection.xm Hooks/API/NSURLCredential.xm Hooks/API/NSURLSession.xm Hooks/API/NSUserDefaults.xm Hooks/API/NSXMLParser.xm Hooks/API/ObjCRuntime.xm Hooks/API/Security.xm Hooks/API/Socket.xm Hooks/API/SSLKillSwitch.xm Hooks/API/sysctl.xm Hooks/API/UIPasteboard.xm Hooks/SDK/FclBlowfish.xm Hooks/SDK/JSPatch.xm Hooks/SDK/OpenSSLAES.xm Hooks/SDK/OpenSSLBlowFish.xm Hooks/SDK/OpenSSLMD5.xm Hooks/SDK/OpenSSLSHA1.xm Hooks/SDK/OpenSSLSHA512.xm Hooks/SDK/Reveal.xm Hooks/SDK/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/RemoteLogSender.m Hooks/Utils/RuntimeUtils.m Hooks/Utils/SQLiteStorage.m Hooks/Utils/Utils.m Hooks/ThirdPartyTools/classdumpdyld.xm Hooks/ThirdPartyTools/dumpdecrypted.xm Hooks/ThirdPartyTools/InspectiveC.xm Hooks/Misc/Cycript.xm Hooks/Misc/fishhook.c Hooks/Misc/RemoveASLR.xm Hooks/Misc/SplitMachO.mm Hooks/Misc/WTSubstrate.mm ADDITIONAL_CCFLAGS = -Qunused-arguments -ADDITIONAL_LDFLAGS = -F./ -Wl,-segalign,4000,-sectcreate,WTFJH,SIGDB,./SignatureDatabase.plist,-sectcreate,WTFJH,classdumpdyld,./classdumpdyld.dylib,-sectcreate,WTFJH,dumpdecrypted,./dumpdecrypted.dylib,-sectcreate,WTFJH,InspectiveC,./InspectiveC.dylib -lz -L. -v -force_load libcapstone.a -force_load libkeystone.a +ADDITIONAL_LDFLAGS = -F./ExtraFWs/,-Wl,-segalign,4000,-sectcreate,WTFJH,SIGDB,./SignatureDatabase.plist,-sectcreate,WTFJH,classdumpdyld,./classdumpdyld.dylib,-sectcreate,WTFJH,dumpdecrypted,./dumpdecrypted.dylib,-sectcreate,WTFJH,InspectiveC,./InspectiveC.dylib -lz -L. -v -force_load ./ExtraFWs/libcapstone.a -force_load ./ExtraFWs/libkeystone.a -KZBCMTTQ59YLMQN_LIBRARIES = sqlite3 substrate stdc++ c++ -KZBCMTTQ59YLMQN_FRAMEWORKS = Foundation UIKit Security JavaScriptCore Cycript Reveal UIKit CoreGraphics CoreFoundation QuartzCore CFNetwork +5FM6FKAPNPR3PSM_LIBRARIES = sqlite3 substrate stdc++ c++ +5FM6FKAPNPR3PSM_FRAMEWORKS = Foundation UIKit Security JavaScriptCore UIKit CoreGraphics CoreFoundation QuartzCore CFNetwork +5FM6FKAPNPR3PSM_OBJ_FILES =./ExtraFWs/Reveal.framework/Reveal ./ExtraFWs/Cycript.framework/Cycript include $(THEOS_MAKE_PATH)/tweak.mk after-install:: install.exec "killall -9 SpringBoard" \ No newline at end of file diff --git a/Setup.sh b/Setup.sh index c6a9293..be2baac 100755 --- a/Setup.sh +++ b/Setup.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +OrigDIR="$(pwd)" +echo "DIR Set to:""${OrigDIR}" + echo "Installing Latest Dependencies" brew install dpkg brew install ldid @@ -6,44 +10,52 @@ brew install wget brew install cmake brew install homebrew/dupes/unzip echo "Clean-up" -rm -rf ./Hooks/keystone/ >>/dev/null -rm -rf ./Hooks/capstone/ >>/dev/null -rm ./libcapstone.a >>/dev/null -rm ./libkeystone.a >>/dev/null -rm ./Reveal.framework >>/dev/null -rm ./Reveal.app.zip -rm -rf ./RevealTMP -rm -rf ./CYTMP +rm -rf ./Hooks/keystone/ >> /dev/null 2>&1 +rm -rf ./Hooks/capstone/ >> /dev/null 2>&1 +rm ./ExtraFWs/libcapstone.a >> /dev/null 2>&1 +rm ./ExtraFWs/libkeystone.a >> /dev/null 2>&1 +rm ./ExtraFWs/Reveal.framework >> /dev/null 2>&1 +rm ./Reveal.app.zip >> /dev/null 2>&1 +rm -rf ./RevealTMP >> /dev/null 2>&1 +rm -rf ./CYTMP >> /dev/null 2>&1 +mkdir ExtraFWs >> /dev/null 2>&1 +mkdir DEBS >> /dev/null 2>&1 echo "Pulling Latest Trunk" git submodule update --init --recursive echo "Installing colorama from python-pip" sudo pip install colorama echo "Building capstone" -cd capstone && git pull origin master&& ./make.sh ios && cd ../ >>/dev/null +cd capstone && git pull origin master&& ./make.sh ios +cd "${OrigDIR}" echo "Moving capstone" -mv ./capstone/libcapstone.a ./ >>/dev/null +mv ./capstone/libcapstone.a ./ExtraFWs/ >>/dev/null cp -r ./capstone/include ./Hooks/capstone >>/dev/null echo "Building keystone" -cd keystone && git pull origin master&&mkdir build &&cd build &&../make-lib.sh &&cd ../../>>/dev/null +cd keystone && git pull origin master&&rm -rf build &&mkdir build &&cd build &&../make-lib.sh +cd "${OrigDIR}" echo "Moving keystone" -mv ./keystone/build/llvm/lib/libkeystone.a ./ >>/dev/null -cp -r ./keystone/include/keystone ./Hooks/keystone >>/dev/null +mv ./keystone/build/llvm/lib/libkeystone.a ./ExtraFWs/ >> /dev/null 2>&1 +cp -r ./keystone/include/keystone ./Hooks/keystone >> /dev/null 2>&1 +cd "${OrigDIR}" echo "Downloading Cycript" wget https://cydia.saurik.com/api/latest/3 -O Cycript.zip echo "Cleaning old framework" -rm -rf ./Cycript.framework >>/dev/null +rm -rf ./Cycript.framework>> /dev/null 2>&1 +rm -rf ./ExtraFWs/Cycript.framework >> /dev/null 2>&1 +rm -rf ./Reveal.framework >> /dev/null 2>&1 +rm -rf ./ExtraFWs/Reveal.framework>> /dev/null 2>&1 echo "Extracting Cycript" mkdir CYTMP -unzip Cycript.zip -d ./CYTMP >>/dev/null -cp -avR ./CYTMP/Cycript.ios/*.framework ./ >>/dev/null +unzip Cycript.zip -d ./CYTMP >> /dev/null 2>&1 +cp -avR ./CYTMP/Cycript.ios/*.framework ./ExtraFWs/ >> /dev/null 2>&1 rm -rf ./CYTMP rm -rf ./Cycript.zip echo "Downloading Reveal" wget http://download.revealapp.com/Reveal.app.zip -unzip Reveal.app.zip -d ./RevealTMP >>/dev/null -cp -rf ./RevealTMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/Reveal.framework ./ >>/dev/null -rm -rf ./RevealTMP >>/dev/null -rm -rf ./Reveal.app.zip >>/dev/null +unzip Reveal.app.zip -d ./RevealTMP >> /dev/null 2>&1 +cp -rf ./RevealTMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/Reveal.framework ./ExtraFWs/ >> /dev/null 2>&1 +rm -rf ./RevealTMP >> /dev/null 2>&1 +rm -rf ./Reveal.app.zip >> /dev/null 2>&1 diff --git a/VERSION b/VERSION index d2d0776..bbb3d18 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -388 \ No newline at end of file +389 \ No newline at end of file diff --git a/build.py b/build.py index cd945d0..571b735 100755 --- a/build.py +++ b/build.py @@ -136,7 +136,7 @@ def BuildMakeFile(): makeFileString += randomTweakName + MakeFileListString + "\n" makeFileString += "ADDITIONAL_CCFLAGS = -Qunused-arguments\n" global LinkerString - makeFileString += "ADDITIONAL_LDFLAGS = -F./ -Wl,-segalign,4000,-sectcreate,WTFJH,SIGDB,./SignatureDatabase.plist"+LinkerString+" " + makeFileString += "ADDITIONAL_LDFLAGS = -Wl,-segalign,4000,-sectcreate,WTFJH,SIGDB,./SignatureDatabase.plist"+LinkerString+" " for LDF in BuildConfig.LDFLAGS: makeFileString +=" "+LDF makeFileString +=" \n" @@ -153,6 +153,11 @@ def BuildMakeFile(): for FWName in BuildConfig.ExtraFramework: makeFileString +=FWName+" " makeFileString +=" \n" + if len(BuildConfig.ExtraOBJFiles)>0: + makeFileString += randomTweakName + "_OBJ_FILES =" + for OBName in BuildConfig.ExtraOBJFiles: + makeFileString +=OBName+" " + makeFileString +=" \n" makeFileString += "include $(THEOS_MAKE_PATH)/tweak.mk\n" makeFileString += "after-install::\n" makeFileString += " install.exec \"killall -9 SpringBoard\"" @@ -458,7 +463,7 @@ def main(): os.system("cp ./WTFJH.plist" + " ./layout/Library/MobileSubstrate/DynamicLibraries/" + randomTweakName + ".plist") # Cleaning finder caches, thanks to http://stackoverflow.com/questions/2016844/bash-recursively-remove-files os.system("find . -type f -name .DS_Store -delete && xattr -cr *") - os.system("dpkg-deb -Zgzip -b ./layout ./Build-"+str(currentVersion)+".deb") + os.system("dpkg-deb -Zgzip -b ./layout ./DEBS/Build-"+str(currentVersion)+".deb") cleanUp() if buildSuccess==True: print (Fore.YELLOW +"Built with components: \n") diff --git a/capstone b/capstone index d99cbc3..1b585c1 160000 --- a/capstone +++ b/capstone @@ -1 +1 @@ -Subproject commit d99cbc319192b97e12e6c87d65b036d2922f9f46 +Subproject commit 1b585c161e5d9bddd54d195e3fdd791b8c4a21ed diff --git a/keystone b/keystone index 53e3609..cac140b 160000 --- a/keystone +++ b/keystone @@ -1 +1 @@ -Subproject commit 53e3609a83895fbc70398c02121178f6895639a6 +Subproject commit cac140ba395160f0baca50e3c8c5549904647b12