Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SandHook
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
SandHook
Commits
6637f8ed
Commit
6637f8ed
authored
Feb 21, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stub 64bit
parent
60fd35cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
8 deletions
+146
-8
CallOriginCallBack.java
...ft/sandhook/xposedcompat/hookstub/CallOriginCallBack.java
+1
-1
HookStubManager.java
...swift/sandhook/xposedcompat/hookstub/HookStubManager.java
+1
-1
MethodHookerStubs32.java
...t/sandhook/xposedcompat/hookstub/MethodHookerStubs32.java
+22
-6
MethodHookerStubs64.java
...t/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java
+122
-0
No files found.
xposedcompat/src/main/java/com/swift/sandhook/xposedcompat/hookstub/CallOriginCallBack.java
View file @
6637f8ed
package
com
.
swift
.
sandhook
.
xposedcompat
.
hookstub
;
public
interface
CallOriginCallBack
{
int
call
(
long
...
args
)
throws
Throwable
;
long
call
(
long
...
args
)
throws
Throwable
;
}
xposedcompat/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java
View file @
6637f8ed
...
...
@@ -21,7 +21,7 @@ public class HookStubManager {
public
final
static
int
MAX_STUB_ARGS
=
5
;
public
final
static
int
[]
stubSizes
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
10
0
,
0
,
0
,
0
,
0
,
6
};
public
final
static
AtomicInteger
[]
curUseStubIndexes
=
new
AtomicInteger
[
MAX_STUB_ARGS
+
1
];
...
...
xposedcompat/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs32.java
View file @
6637f8ed
...
...
@@ -10,7 +10,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_0
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_0
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -27,7 +27,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_1
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_1
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -43,7 +43,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_2
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_2
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -61,7 +61,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_3
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_3
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -79,7 +79,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_4
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_4
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -96,7 +96,7 @@ public class MethodHookerStubs32 {
static
class
call_origin_5_5
implements
CallOriginCallBack
{
@Override
public
int
call
(
long
...
args
)
throws
Throwable
{
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_5
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
...
...
@@ -110,4 +110,20 @@ public class MethodHookerStubs32 {
return
0
;
}
static
class
call_origin_5_6
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_6
((
int
)
args
[
0
],
(
int
)
args
[
1
],(
int
)
args
[
2
],
(
int
)
args
[
3
],
(
int
)
args
[
4
]);
}
}
public
static
int
stub_hook_6
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
)
throws
Throwable
{
return
(
int
)
hookBridge
(
getMethodId
(
5
,
6
),
new
call_origin_5_5
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
int
stub_backup_6
(
int
a
,
int
b
,
int
c
,
int
d
,
int
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
6
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
}
xposedcompat/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java
View file @
6637f8ed
package
com
.
swift
.
sandhook
.
xposedcompat
.
hookstub
;
import
static
com
.
swift
.
sandhook
.
xposedcompat
.
hookstub
.
HookStubManager
.
hookBridge
;
import
static
com
.
swift
.
sandhook
.
xposedcompat
.
hookstub
.
HookStubManager
.
getMethodId
;
import
static
com
.
swift
.
sandhook
.
xposedcompat
.
hookstub
.
HookStubManager
.
originMethods
;
import
static
com
.
swift
.
sandhook
.
xposedcompat
.
utils
.
DexLog
.
printCallOriginError
;
public
class
MethodHookerStubs64
{
static
class
call_origin_5_0
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_0
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_0
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
0
),
new
call_origin_5_0
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_0
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
0
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_1
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_1
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_1
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
1
),
new
call_origin_5_1
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_1
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
1
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_2
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_2
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_2
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
2
),
new
call_origin_5_2
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_2
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
2
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_3
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_3
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_3
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
3
),
new
call_origin_5_3
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_3
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
3
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_4
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_4
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_4
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
4
),
new
call_origin_5_4
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_4
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
4
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_5
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_5
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_5
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
5
),
new
call_origin_5_5
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_5
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
5
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
static
class
call_origin_5_6
implements
CallOriginCallBack
{
@Override
public
long
call
(
long
...
args
)
throws
Throwable
{
return
stub_backup_6
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
]);
}
}
public
static
long
stub_hook_6
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
return
hookBridge
(
getMethodId
(
5
,
6
),
new
call_origin_5_5
(),
a
,
b
,
c
,
d
,
e
);
}
public
static
long
stub_backup_6
(
long
a
,
long
b
,
long
c
,
long
d
,
long
e
)
throws
Throwable
{
try
{
printCallOriginError
(
originMethods
[
getMethodId
(
5
,
6
)]);
}
catch
(
Throwable
throwable
)
{}
return
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment