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
79e2b1bb
Commit
79e2b1bb
authored
Jan 22, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use replacement hook in arm32 tmp
parent
86681ef3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
arch.h
app/src/main/cpp/includes/arch.h
+0
-4
native-lib.cpp
app/src/main/cpp/native-lib.cpp
+5
-0
SandHookMethodResolver.java
.../main/java/com/swift/sandhook/SandHookMethodResolver.java
+1
-1
No files found.
app/src/main/cpp/includes/arch.h
View file @
79e2b1bb
...
...
@@ -11,13 +11,9 @@ namespace SandHook {
//32bit
#if defined(__i386__) || defined(__arm__)
#define ADDR(addr) *((uint32_t *) addr)
#define ALIGN_ADDR(x) ((v+4-1) - ((v+4-1)&3))
#define Size uint32_t
//64bit
#elif defined(__aarch64__) || defined(__x86_64__)
#define ADDR(addr) *((uint64_t *) addr)
#define ALIGN_ADDR(x) ((v+8-1) - ((v+8-1)&7))
#define Size uint64_t
#else
#endif
...
...
app/src/main/cpp/native-lib.cpp
View file @
79e2b1bb
...
...
@@ -125,6 +125,11 @@ Java_com_swift_sandhook_SandHook_hookMethod(JNIEnv *env, jclass type, jobject or
bool
isInterpreter
=
SandHook
::
CastArtMethod
::
entryPointQuickCompiled
->
get
(
origin
)
==
SandHook
::
CastArtMethod
::
quickToInterpreterBridge
;
#if defined(__arm__)
doHookWithReplacement
(
origin
,
hook
,
backup
);
return
JNI_TRUE
;
#endif
if
(
isInterpreter
)
{
if
(
SDK_INT
>=
ANDROID_N
)
{
Size
threadId
=
getAddressFromJavaByCallMethod
(
env
,
"com/swift/sandhook/SandHook"
,
"getThreadId"
);
...
...
app/src/main/java/com/swift/sandhook/SandHookMethodResolver.java
View file @
79e2b1bb
...
...
@@ -76,7 +76,7 @@ public class SandHookMethodResolver {
canResolvedInJava
=
true
;
}
else
if
(
resolvedMethods
instanceof
int
[])
{
//32bit
canResolvedInJava
=
fals
e
;
canResolvedInJava
=
tru
e
;
}
}
...
...
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