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
790083c1
Commit
790083c1
authored
Jan 23, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done arm32 compat
parent
c2bf39ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
arm32.S
app/src/main/cpp/trampoline/arch/arm32.S
+1
-1
trampoline.h
app/src/main/cpp/trampoline/trampoline.h
+1
-0
trampoline_manager.cpp
app/src/main/cpp/trampoline/trampoline_manager.cpp
+13
-1
MyApp.java
app/src/main/java/com/swift/sandhook/MyApp.java
+1
-1
No files found.
app/src/main/cpp/trampoline/arch/arm32.S
View file @
790083c1
...
...
@@ -100,7 +100,7 @@ origin_code_t:
//4 byte
ldr RegT, [RegT]
//4 byte
add RegT, RegT,
#8
add RegT, RegT,
SIZE_JUMP
//2 byte
mov pc, RegT
nop
...
...
app/src/main/cpp/trampoline/trampoline.h
View file @
790083c1
...
...
@@ -51,6 +51,7 @@
#define SIZE_INLINE_HOOK_TRAMPOLINE 4 * 17
#define OFFSET_INLINE_ORIGIN_CODE 4 * 7
#define OFFSET_INLINE_OP_OFFSET_CODE 4 * 10
#define OFFSET_INLINE_OP_ORIGIN_OFFSET_CODE 4 * 12
#define OFFSET_INLINE_ADDR_ORIGIN_METHOD 4 * 14
#define OFFSET_INLINE_OFFSET_ENTRY_CODE 4 * 15
#define OFFSET_INLINE_ADDR_HOOK_METHOD 4 * 16
...
...
app/src/main/cpp/trampoline/trampoline_manager.cpp
View file @
790083c1
...
...
@@ -2,6 +2,7 @@
// Created by swift on 2019/1/20.
//
#include "trampoline_manager.h"
#include "trampoline.h"
namespace
SandHook
{
...
...
@@ -103,7 +104,8 @@ namespace SandHook {
}
if
(
directJumpTrampoline
->
isThumCode
())
{
directJumpTrampoline
->
setExecuteSpace
(
directJumpTrampoline
->
getThumbCodeAddress
(
originEntry
));
originEntry
=
directJumpTrampoline
->
getThumbCodeAddress
(
originEntry
);
directJumpTrampoline
->
setExecuteSpace
(
originEntry
);
directJumpTrampoline
->
setJumpTarget
(
directJumpTrampoline
->
getThumbCodePcAddress
(
inlineHookTrampoline
->
getCode
()));
}
else
{
directJumpTrampoline
->
setExecuteSpace
(
originEntry
);
...
...
@@ -124,6 +126,16 @@ namespace SandHook {
Code
originCode
=
nullptr
;
if
(
callOriginTrampoline
->
isThumCode
())
{
originCode
=
callOriginTrampoline
->
getThumbCodePcAddress
(
inlineHookTrampoline
->
getCallOriginCode
());
#if defined(__arm__)
Code
originRemCode
=
callOriginTrampoline
->
getThumbCodePcAddress
(
originEntry
+
directJumpTrampoline
->
getCodeLen
());
Size
offset
=
originRemCode
-
getEntryCode
(
originMethod
);
if
(
offset
!=
directJumpTrampoline
->
getCodeLen
())
{
Code32Bit
offset32
;
offset32
.
code
=
offset
;
unsigned
char
offsetOP
=
callOriginTrampoline
->
isBigEnd
()
?
offset32
.
op
.
op2
:
offset32
.
op
.
op1
;
callOriginTrampoline
->
tweakOpImm
(
OFFSET_INLINE_OP_ORIGIN_OFFSET_CODE
,
offsetOP
);
}
#endif
}
else
{
originCode
=
inlineHookTrampoline
->
getCallOriginCode
();
}
...
...
app/src/main/java/com/swift/sandhook/MyApp.java
View file @
790083c1
...
...
@@ -9,7 +9,7 @@ public class MyApp extends Application {
public
void
onCreate
()
{
super
.
onCreate
();
try
{
SandHook
.
addHookClass
(
LogHooker
.
class
,
ActivityHooker
.
class
,
ObjectHooker
.
class
);
SandHook
.
addHookClass
(
ActivityHooker
.
class
,
ObjectHooker
.
class
);
}
catch
(
HookErrorException
e
)
{
e
.
printStackTrace
();
}
...
...
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