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
ae558836
Commit
ae558836
authored
Feb 12, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix check logic on android p 32bit
parent
60422367
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
sandhook.cpp
hooklib/src/main/cpp/sandhook.cpp
+1
-3
trampoline_manager.cpp
hooklib/src/main/cpp/trampoline/trampoline_manager.cpp
+6
-5
No files found.
hooklib/src/main/cpp/sandhook.cpp
View file @
ae558836
...
...
@@ -165,9 +165,7 @@ Java_com_swift_sandhook_SandHook_hookMethod(JNIEnv *env, jclass type, jobject or
}
if
(
SDK_INT
>=
ANDROID_P
&&
BYTE_POINT
==
4
)
{
isInlineHook
=
false
;
}
else
if
(
origin
->
isAbstract
())
{
if
(
origin
->
isAbstract
())
{
isInlineHook
=
false
;
}
else
if
(
!
origin
->
isCompiled
())
{
if
(
SDK_INT
>=
ANDROID_N
)
{
...
...
hooklib/src/main/cpp/trampoline/trampoline_manager.cpp
View file @
ae558836
...
...
@@ -6,6 +6,7 @@
#include "../includes/inst.h"
extern
int
SDK_INT
;
#define SWITCH_SETX0 false
namespace
SandHook
{
...
...
@@ -25,7 +26,7 @@ namespace SandHook {
public
:
bool
pcRelated
=
false
;
bool
instWillBeDestroy
=
fals
e
;
bool
canSafeBackup
=
tru
e
;
int
instSize
=
0
;
...
...
@@ -39,7 +40,7 @@ namespace SandHook {
}
if
(
instSize
>
SIZE_DIRECT_JUMP_TRAMPOLINE
)
{
instWillBeDestroy
=
tru
e
;
canSafeBackup
=
fals
e
;
}
return
true
;
...
...
@@ -55,12 +56,12 @@ namespace SandHook {
}
}
//check pc relate inst
//check pc relate inst
& backup inst len
PCRelatedCheckVisitor
visitor
;
InstDecode
::
decode
(
method
->
getQuickCodeEntry
(),
SIZE_DIRECT_JUMP_TRAMPOLINE
,
&
visitor
);
return
(
!
visitor
.
pcRelated
)
&&
(
!
visitor
.
instWillBeDestroy
)
;
return
(
!
visitor
.
pcRelated
)
&&
visitor
.
canSafeBackup
;
}
Code
TrampolineManager
::
allocExecuteSpace
(
Size
size
)
{
...
...
@@ -114,7 +115,7 @@ namespace SandHook {
replacementHookTrampoline
->
setHookMethod
(
reinterpret_cast
<
Code
>
(
hookMethod
));
hookTrampoline
->
replacement
=
replacementHookTrampoline
;
if
(
backupMethod
!=
nullptr
)
{
if
(
SWITCH_SETX0
&&
backupMethod
!=
nullptr
)
{
callOriginTrampoline
=
new
CallOriginTrampoline
();
checkThumbCode
(
callOriginTrampoline
,
getEntryCode
(
originMethod
));
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