You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: DOCS/HackingGuide.md
+17-16Lines changed: 17 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
#Hacking Guide
2
-
##This is the guide for you to start adding modules/tools to the repo
1
+
#Hacking Guide
2
+
##This is the guide for you to start adding modules/tools to the repo
3
3
4
4
5
-
###Modules
5
+
###Modules
6
6
Modules can be generated by running ./Template.py Type Name
7
7
8
8
Current Types:
@@ -20,44 +20,45 @@ Also.There is a init_XXX_hook function inside each module,which XXX in your modu
20
20
21
21
The main tweak will call that to init your hook.Check below for details
22
22
23
-
####Names
24
-
#####For Modules.
23
+
####Names
24
+
#####For Modules.
25
25
All these must be the same.
26
26
27
27
1. Module File Name
28
28
2. init function name component (see Modules Part)
29
29
30
30
*Please make sure the names are short and descriptive. We generate settings button text base on module name*
31
31
32
-
####For Third Party Components
33
-
**Read ThirdPartyTools/README.md for detailed info **
32
+
#### For Third Party Components
34
33
34
+
**Read ThirdPartyTools/README.md for detailed info**
35
35
36
-
####Prototype Codes
36
+
37
+
#### Prototype Codes
37
38
Some codes, you might not want to expose them directly. Either because they have bugs, or, they are incomplete.
38
39
39
40
Put These Codes Inside **#ifdef PROTOTYPE** and **#endif**
40
41
41
42
These codes will be enabled only when PROTOTYPE Flag for build.py is *Implicitly* turned on.(See Below)
42
43
43
44
44
-
####Custom Preferences
45
+
####Custom Preferences
45
46
Add Your Own Preferences in **Preferences/** With Filename **MODULENAME.plist**
46
47
47
48
They will be injected into the *items* of the final Preferences Loader PLIST file
48
49
49
-
####Marcos
50
+
####Marcos
50
51
Two Groups Of Marcos Has Been Created For Logging Purposes.
51
52
Please Call Exactly In The Following Sequence
52
-
#####Common Logging
53
+
#####Common Logging
53
54
1. WTInit(ClassName,methodName) **(For C Functions. Change ClassName to Library Name. For Example dlopen corresponds to dlfcn because it's in dlfcn.h)**
54
55
2. WTAdd(Argument,Name) **The First is the argument itself. The second is the argument name**
55
56
3. WTReturn(Return) **Return is the return value to add**
56
57
4. WTSave **No Arguments. It saves the log to database.**
57
58
5. WTRelease **Release The Memory Of The Logger**
58
59
6. WTShouldLog **if(WTShouldLog){} to check if it's called by the app itself**
59
60
60
-
#####Hooking
61
+
#####Hooking
61
62
Wrappers of MS API Are in Hooks/Misc/WTSubstrate.h
62
63
63
64
Currently
@@ -70,7 +71,7 @@ Are available with the exact same usage with their MS* Equivalent
70
71
Use them instead of MS** Ones as they take care of jailed situation
71
72
72
73
73
-
#####dyld CallBack
74
+
#####dyld CallBack
74
75
1. WTCallBack(LibraryName,FunctionToCall) **Generate A Function That Call FunctionToCall() when an image which path containing LibraryName is loaded. You Can Init Hooks inside FunctionToCall**
75
76
2. WTAddCallBack(Loader) **Register the callback with dyld and execute Loader().Please Note That Loader Should Be The Function That Actually Init The Hooks,Not The CallBack**
76
77
@@ -82,7 +83,7 @@ Please Note:
82
83
4. Don't add semicolon to WTCallBack
83
84
5. Only One Set Of **dyld CallBack** Marcos Can Be Called In A Module
84
85
85
-
####Building
86
+
####Building
86
87
You Probably Need The Latest Substrate Header. Check [Issues#1](https://github.com/Naville/WTFJH/issues/1) In Case Something Went Wrong.
87
88
88
89
Usually. Simple run **./build.py** is enough
@@ -96,7 +97,7 @@ Other Arguments(Upper/Lower Case Doesn't Matter):
96
97
97
98
98
99
99
-
####Misc
100
+
####Misc
100
101
Some functions don't come with the binary and you'll have to wait the related library to be loaded
101
102
102
103
**Example: libMobileGestalt**
@@ -117,7 +118,7 @@ Make sure it's correctly signed
117
118
Everything in BuildConfig should be pretty self-explainary. Except *CreateExtraSegs* , which is a dict, used to inject file-on-disk into the tweak. Key is SegmentName and Value is path to the file
118
119
119
120
120
-
####Limitations
121
+
####Limitations
121
122
122
123
syscall and its variations are no longer hooked as it's unstable and they are only barely a wrapper for corresponding assembly instruction, which is impossible to hook
0 commit comments