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
c976181d
Commit
c976181d
authored
Jan 21, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak arm64 asm
parent
faa13b1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
arm64.S
app/src/main/cpp/trampoline/arch/arm64.S
+23
-19
No files found.
app/src/main/cpp/trampoline/arch/arm64.S
View file @
c976181d
...
...
@@ -3,12 +3,16 @@
#if defined(__aarch64__)
#define Reg0 x16
#define Reg1 x17
#define RegMethod x0
FUNCTION_START(REPLACEMENT_HOOK_TRAMPOLINE)
ldr
x0
, addr_art_method
ldr
x16
, offset_entry_code
add
x16, x0, x16
ldr
x16, [x16
]
br
x16
ldr
RegMethod
, addr_art_method
ldr
Reg0
, offset_entry_code
add
Reg0, RegMethod, Reg0
ldr
Reg0, [Reg0
]
br
Reg0
addr_art_method:
.long 0
.long 0
...
...
@@ -18,24 +22,24 @@ offset_entry_code:
FUNCTION_END(REPLACEMENT_HOOK_TRAMPOLINE)
FUNCTION_START(DIRECT_JUMP_TRAMPOLINE)
ldr
x16
, addr_target
br
x16
ldr
Reg0
, addr_target
br
Reg0
addr_target:
.long 0
.long 0
FUNCTION_END(DIRECT_JUMP_TRAMPOLINE)
FUNCTION_START(INLINE_HOOK_TRAMPOLINE)
ldr
x17
, addr_origin_art_method
cmp
x0, x17
ldr
Reg1
, addr_origin_art_method
cmp
RegMethod, Reg1
bne go_to_origin_code
ldr
x16
, addr_hook_art_method
ldr
x17
, offset_entry_code2
add
x17, x16, x17
ldr
x17, [x17
]
br
x17
ldr
Reg0
, addr_hook_art_method
ldr
Reg1
, offset_entry_code2
add
Reg1, Reg0, Reg1
ldr
Reg1, [Reg1
]
br
Reg1
go_to_origin_code:
mov
x0, x17
mov
RegMethod, Reg1
b origin_code
addr_origin_art_method:
.long 0
...
...
@@ -45,10 +49,10 @@ origin_code:
.long 0
.long 0
.long 0
ldr
x17
, offset_entry_code2
add
x17, x0, x17
ldr
x17, [x17
]
br
x17
ldr
Reg1
, offset_entry_code2
add
Reg1, RegMethod, Reg1
ldr
Reg1, [Reg1
]
br
Reg1
offset_entry_code2:
.long 0
.long 0
...
...
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