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
2217a3b3
Commit
2217a3b3
authored
May 31, 2019
by
swift_gan
Committed by
swift_gan
May 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NativeHook]fix mov for/to SP
parent
3b441fc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
assembler_arm64.cpp
...rc/main/cpp/archs/arm/arm64/assembler/assembler_arm64.cpp
+6
-2
assembler_arm64.h
.../src/main/cpp/archs/arm/arm64/assembler/assembler_arm64.h
+1
-1
sandhook_native.cpp
nativehook/src/main/cpp/sandhook_native.cpp
+2
-2
No files found.
nativehook/src/main/cpp/archs/arm/arm64/assembler/assembler_arm64.cpp
View file @
2217a3b3
...
@@ -243,8 +243,12 @@ void AssemblerA64::Msr(SystemRegister &sysReg, RegisterA64 &rt) {
...
@@ -243,8 +243,12 @@ void AssemblerA64::Msr(SystemRegister &sysReg, RegisterA64 &rt) {
Emit
(
reinterpret_cast
<
Unit
<
Base
>
*>
(
new
INST_A64
(
MSR_MRS
)(
INST_A64
(
MSR_MRS
)
::
MSR
,
sysReg
,
rt
)));
Emit
(
reinterpret_cast
<
Unit
<
Base
>
*>
(
new
INST_A64
(
MSR_MRS
)(
INST_A64
(
MSR_MRS
)
::
MSR
,
sysReg
,
rt
)));
}
}
void
AssemblerA64
::
Mov
(
RegisterA64
&
rd
,
RegisterA64
rt
)
{
void
AssemblerA64
::
Mov
(
RegisterA64
&
rd
,
RegisterA64
&
rt
)
{
Emit
(
reinterpret_cast
<
Unit
<
Base
>
*>
(
new
INST_A64
(
MOV_REG
)(
rd
,
rt
)));
if
(
rd
==
SP
||
rt
==
SP
)
{
Add
(
rd
,
Operand
(
&
rt
,
0
));
}
else
{
Emit
(
reinterpret_cast
<
Unit
<
Base
>
*>
(
new
INST_A64
(
MOV_REG
)(
rd
,
rt
)));
}
}
}
...
...
nativehook/src/main/cpp/archs/arm/arm64/assembler/assembler_arm64.h
View file @
2217a3b3
...
@@ -87,7 +87,7 @@ namespace SandHook {
...
@@ -87,7 +87,7 @@ namespace SandHook {
void
Msr
(
SystemRegister
&
sysReg
,
RegisterA64
&
rt
);
void
Msr
(
SystemRegister
&
sysReg
,
RegisterA64
&
rt
);
void
Mrs
(
SystemRegister
&
sysReg
,
RegisterA64
&
rt
);
void
Mrs
(
SystemRegister
&
sysReg
,
RegisterA64
&
rt
);
void
Mov
(
RegisterA64
&
rd
,
RegisterA64
rt
);
void
Mov
(
RegisterA64
&
rd
,
RegisterA64
&
rt
);
public
:
public
:
...
...
nativehook/src/main/cpp/sandhook_native.cpp
View file @
2217a3b3
...
@@ -93,8 +93,8 @@ void do1() {
...
@@ -93,8 +93,8 @@ void do1() {
do2
();
do2
();
}
}
void
breakCallback
(
REG
regs
[]
)
{
void
breakCallback
(
REG
*
regs
)
{
LOGE
(
"breakCallback
"
);
LOGE
(
"breakCallback
= %d"
,
regs
[
1
]
);
}
}
...
...
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