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
48df9f47
Commit
48df9f47
authored
Jan 17, 2019
by
swift_gan
Committed by
swift_gan
Jan 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build
parent
efb8f4c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
16 deletions
+12
-16
build.gradle
app/build.gradle
+1
-0
native-lib.cpp
app/src/main/cpp/native-lib.cpp
+2
-2
arm64.S
app/src/main/cpp/trampoline/arch/arm64.S
+3
-4
base.h
app/src/main/cpp/trampoline/arch/base.h
+6
-9
trampoline.h
app/src/main/cpp/trampoline/trampoline.h
+0
-1
No files found.
app/build.gradle
View file @
48df9f47
...
@@ -11,6 +11,7 @@ android {
...
@@ -11,6 +11,7 @@ android {
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild
{
externalNativeBuild
{
cmake
{
cmake
{
arguments
'-DBUILD_TESTING=OFF'
,
'-DANDROID_TOOLCHAIN=gcc'
cppFlags
"-frtti -fexceptions"
cppFlags
"-frtti -fexceptions"
abiFilters
'arm64-v8a'
abiFilters
'arm64-v8a'
}
}
...
...
app/src/main/cpp/native-lib.cpp
View file @
48df9f47
...
@@ -32,13 +32,13 @@ Java_com_swift_sandhook_MainActivity_calArtSize(JNIEnv *env, jobject instance, j
...
@@ -32,13 +32,13 @@ Java_com_swift_sandhook_MainActivity_calArtSize(JNIEnv *env, jobject instance, j
return
0
;
return
0
;
}
}
extern
void
hook_trampoline
();
extern
"C"
void
hook_trampoline
();
extern
"C"
extern
"C"
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_com_swift_sandhook_MainActivity_initHook
(
JNIEnv
*
env
,
jobject
instance
)
{
Java_com_swift_sandhook_MainActivity_initHook
(
JNIEnv
*
env
,
jobject
instance
)
{
void
(
*
fp
)()
=
hook_trampoline
;
hook_trampoline
()
;
SandHook
::
cast_art_method
::
init
(
env
);
SandHook
::
cast_art_method
::
init
(
env
);
...
...
app/src/main/cpp/trampoline/arch/arm64.S
View file @
48df9f47
#include "base.h"
#include "base.h"
.align 4
FUNCTION_START(hook_trampoline)
.global hook_trampoline
hook_trampoline:
ldr x0, addr_art_method
ldr x0, addr_art_method
ldr x16, addr_entry_code
ldr x16, addr_entry_code
br x16
br x16
...
@@ -11,4 +9,5 @@ addr_art_method:
...
@@ -11,4 +9,5 @@ addr_art_method:
.long 0
.long 0
addr_entry_code:
addr_entry_code:
.long 0
.long 0
.long 0
.long 0
\ No newline at end of file
FUNCTION_END(hook_trampoline)
app/src/main/cpp/trampoline/arch/base.h
View file @
48df9f47
...
@@ -5,15 +5,12 @@
...
@@ -5,15 +5,12 @@
#ifndef SANDHOOK_BASE_H
#ifndef SANDHOOK_BASE_H
#define SANDHOOK_BASE_H
#define SANDHOOK_BASE_H
#
if defined(__WIN32__) || defined(__APPLE__)
#
define FUNCTION_START(x) \
#define cdecl(s) s
.text; \
#else
.align 4; \
#define cdecl(s) s
.global x; \
#endif
x: \
#define FUNCTION_START(x) .globl cdecl(x) \
#define FUNCTION_END(x) .size x, .-x
cdecl(x):
#define FUNCTION_END(x) .x:
#endif //SANDHOOK_BASE_H
#endif //SANDHOOK_BASE_H
app/src/main/cpp/trampoline/trampoline.h
View file @
48df9f47
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
#ifndef SANDHOOK_TRAMPOLINE_H
#ifndef SANDHOOK_TRAMPOLINE_H
#define SANDHOOK_TRAMPOLINE_H
#define SANDHOOK_TRAMPOLINE_H
extern
void
hook_trampoline
();
#if defined(__i386__)
#if defined(__i386__)
#define SIZE_TRAMPOLINE = 4 * 7
#define SIZE_TRAMPOLINE = 4 * 7
...
...
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