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
49ddfce5
Unverified
Commit
49ddfce5
authored
Jul 18, 2019
by
ganyao114
Committed by
GitHub
Jul 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24 from ganyao114/short_method
[BugFix]Fix ADRP
parents
09517e01
21f15732
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
inst_arm64.cpp
nativehook/src/main/cpp/archs/arm/arm64/inst/inst_arm64.cpp
+2
-2
code_buffer.cpp
nativehook/src/main/cpp/buffer/code_buffer.cpp
+1
-1
base.h
nativehook/src/main/cpp/includes/base.h
+1
-1
platform.cpp
nativehook/src/main/cpp/utils/platform.cpp
+1
-1
No files found.
nativehook/src/main/cpp/archs/arm/arm64/inst/inst_arm64.cpp
View file @
49ddfce5
...
...
@@ -58,8 +58,8 @@ Off A64_ADR_ADRP::GetImmPCOffset() {
}
Addr
A64_ADR_ADRP
::
GetImmPCOffsetTarget
()
{
void
*
base
=
AlignDown
(
GetPC
(),
P
_SIZE
);
return
offset
+
reinterpret_cast
<
Addr
>
(
base
)
;
Addr
base
=
AlignDown
((
Addr
)
GetPC
(),
PAGE
_SIZE
);
return
offset
+
base
;
}
void
A64_ADR_ADRP
::
Assemble
()
{
...
...
nativehook/src/main/cpp/buffer/code_buffer.cpp
View file @
49ddfce5
...
...
@@ -27,7 +27,7 @@ void *AndroidCodeBuffer::GetBuffer(U32 size) {
return
reinterpret_cast
<
void
*>
(
retSpace
);
}
label_alloc_new_space
:
current_execute_page_size
=
static_cast
<
U32
>
(
FIT
(
size
,
P_SIZE
));
current_execute_page_size
=
static_cast
<
U32
>
(
FIT
(
size
,
P
AGE
_SIZE
));
mmapRes
=
mmap
(
NULL
,
current_execute_page_size
,
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
,
MAP_ANON
|
MAP_PRIVATE
,
-
1
,
0
);
if
(
mmapRes
==
MAP_FAILED
)
{
...
...
nativehook/src/main/cpp/includes/base.h
View file @
49ddfce5
...
...
@@ -35,7 +35,7 @@ typedef S64 Off;
const
int
BITS_OF_BYTE
=
8
;
const
Addr
P_SIZE
=
2
<<
PAGE_OFFSET
;
#define P_SIZE PAGE_SIZE
enum
Arch
{
arm32
,
...
...
nativehook/src/main/cpp/utils/platform.cpp
View file @
49ddfce5
...
...
@@ -22,7 +22,7 @@ bool FlushCache(Addr addr, Off len) {
extern
"C"
bool
MemUnprotect
(
Addr
addr
,
Addr
len
)
{
long
pagesize
=
P_SIZE
;
long
pagesize
=
P
AGE
_SIZE
;
unsigned
alignment
=
(
unsigned
)((
unsigned
long
long
)
addr
%
pagesize
);
int
i
=
mprotect
((
void
*
)
(
addr
-
alignment
),
(
size_t
)
(
alignment
+
len
),
PROT_READ
|
PROT_WRITE
|
PROT_EXEC
);
...
...
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