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
3881352b
Commit
3881352b
authored
Mar 03, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash when use replace hook
parent
43ada919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
sandhook.cpp
hooklib/src/main/cpp/sandhook.cpp
+1
-6
trampoline_manager.cpp
hooklib/src/main/cpp/trampoline/trampoline_manager.cpp
+1
-1
No files found.
hooklib/src/main/cpp/sandhook.cpp
View file @
3881352b
...
@@ -113,9 +113,6 @@ bool doHookWithReplacement(JNIEnv* env,
...
@@ -113,9 +113,6 @@ bool doHookWithReplacement(JNIEnv* env,
hookMethod
->
compile
(
env
);
hookMethod
->
compile
(
env
);
if
(
backupMethod
!=
nullptr
)
{
if
(
backupMethod
!=
nullptr
)
{
if
(
!
backupMethod
->
isCompiled
())
{
backupMethod
->
compile
(
env
);
}
originMethod
->
backup
(
backupMethod
);
originMethod
->
backup
(
backupMethod
);
if
(
SDK_INT
>=
ANDROID_N
)
{
if
(
SDK_INT
>=
ANDROID_N
)
{
backupMethod
->
disableCompilable
();
backupMethod
->
disableCompilable
();
...
@@ -165,9 +162,7 @@ bool doHookWithInline(JNIEnv* env,
...
@@ -165,9 +162,7 @@ bool doHookWithInline(JNIEnv* env,
art
::
mirror
::
ArtMethod
*
backupMethod
)
{
art
::
mirror
::
ArtMethod
*
backupMethod
)
{
//fix >= 8.1
//fix >= 8.1
if
(
!
hookMethod
->
isCompiled
())
{
hookMethod
->
compile
(
env
);
hookMethod
->
compile
(
env
);
}
if
(
SDK_INT
>=
ANDROID_N
)
{
if
(
SDK_INT
>=
ANDROID_N
)
{
originMethod
->
disableCompilable
();
originMethod
->
disableCompilable
();
...
...
hooklib/src/main/cpp/trampoline/trampoline_manager.cpp
View file @
3881352b
...
@@ -145,7 +145,7 @@ namespace SandHook {
...
@@ -145,7 +145,7 @@ namespace SandHook {
hookTrampoline
->
replacement
=
replacementHookTrampoline
;
hookTrampoline
->
replacement
=
replacementHookTrampoline
;
hookTrampoline
->
originCode
=
static_cast
<
Code
>
(
originMethod
->
getQuickCodeEntry
());
hookTrampoline
->
originCode
=
static_cast
<
Code
>
(
originMethod
->
getQuickCodeEntry
());
if
(
SWITCH_SETX0
&&
SDK_INT
>=
ANDROID_
O
&&
backupMethod
!=
nullptr
)
{
if
(
SWITCH_SETX0
&&
SDK_INT
>=
ANDROID_
N
&&
backupMethod
!=
nullptr
)
{
callOriginTrampoline
=
new
CallOriginTrampoline
();
callOriginTrampoline
=
new
CallOriginTrampoline
();
checkThumbCode
(
callOriginTrampoline
,
getEntryCode
(
originMethod
));
checkThumbCode
(
callOriginTrampoline
,
getEntryCode
(
originMethod
));
callOriginTrampoline
->
init
();
callOriginTrampoline
->
init
();
...
...
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