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
44b68896
Commit
44b68896
authored
May 09, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add inst type
parent
852ee689
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
inst_arm64.cpp
nativehook/src/main/cpp/archs/arm64/inst/inst_arm64.cpp
+5
-5
inst_arm64.h
nativehook/src/main/cpp/archs/arm64/inst/inst_arm64.h
+9
-7
inst_struct_aarch64.h
...ehook/src/main/cpp/archs/arm64/inst/inst_struct_aarch64.h
+2
-2
No files found.
nativehook/src/main/cpp/archs/arm64/inst/inst_arm64.cpp
View file @
44b68896
...
...
@@ -73,7 +73,7 @@ void A64_ADR_ADRP::assembler() {
A64_MOV_WIDE
::
A64_MOV_WIDE
()
{}
A64_MOV_WIDE
::
A64_MOV_WIDE
(
aarch64_mov_wide
*
inst
)
:
InstructionA64
(
inst
)
{
A64_MOV_WIDE
::
A64_MOV_WIDE
(
STRUCT_A64
(
MOV_WIDE
)
*
inst
)
:
InstructionA64
(
inst
)
{
decode
(
inst
);
}
...
...
@@ -91,7 +91,7 @@ void A64_MOV_WIDE::assembler() {
get
()
->
rd
=
rd
->
getCode
();
}
void
A64_MOV_WIDE
::
decode
(
aarch64_mov_wide
*
inst
)
{
void
A64_MOV_WIDE
::
decode
(
STRUCT_A64
(
MOV_WIDE
)
*
inst
)
{
imme
=
static_cast
<
U16
>
(
inst
->
imm16
);
shift
=
static_cast
<
U8
>
(
inst
->
hw
*
16
);
op
=
OP
(
inst
->
opc
);
...
...
@@ -108,7 +108,7 @@ void A64_MOV_WIDE::decode(aarch64_mov_wide *inst) {
A64_B_BL
::
A64_B_BL
()
{}
A64_B_BL
::
A64_B_BL
(
aarch64_b_bl
*
inst
)
:
A64_INST_PC_REL
(
inst
)
{
A64_B_BL
::
A64_B_BL
(
STRUCT_A64
(
B_BL
)
*
inst
)
:
A64_INST_PC_REL
(
inst
)
{
decode
(
inst
);
}
...
...
@@ -120,7 +120,7 @@ ADDR A64_B_BL::getImmPCOffset() {
return
signExtend64
(
26
+
2
,
COMBINE
(
get
()
->
imm26
,
0
b00
,
2
));
}
void
A64_B_BL
::
decode
(
aarch64_b_bl
*
inst
)
{
void
A64_B_BL
::
decode
(
STRUCT_A64
(
B_BL
)
*
inst
)
{
op
=
OP
(
inst
->
op
);
offset
=
getImmPCOffset
();
}
...
...
@@ -233,6 +233,6 @@ void A64_TBZ_TBNZ::assembler() {
get
()
->
op
=
op
;
get
()
->
b5
=
rt
->
is64Bit
()
?
1
:
0
;
get
()
->
rt
=
rt
->
getCode
();
get
()
->
b40
=
BITS
(
bit
,
sizeof
(
U32
)
-
5
,
sizeof
(
U32
));
get
()
->
b40
=
static_cast
<
InstA64
>
(
BITS
(
bit
,
sizeof
(
InstA64
)
-
5
,
sizeof
(
InstA64
)
));
get
()
->
imm14
=
TruncateToUint14
(
offset
);
}
\ No newline at end of file
nativehook/src/main/cpp/archs/arm64/inst/inst_arm64.h
View file @
44b68896
...
...
@@ -124,7 +124,7 @@ namespace SandHook {
class
INST_A64
(
MOV_WIDE
)
:
public
InstructionA64
<
aarch64_mov_wide
>
{
class
INST_A64
(
MOV_WIDE
)
:
public
InstructionA64
<
STRUCT_A64
(
MOV_WIDE
)
>
{
public
:
enum
OP
{
...
...
@@ -138,10 +138,12 @@ namespace SandHook {
A64_MOV_WIDE
();
A64_MOV_WIDE
(
aarch64_mov_wide
*
inst
);
A64_MOV_WIDE
(
STRUCT_A64
(
MOV_WIDE
)
*
inst
);
A64_MOV_WIDE
(
A64_MOV_WIDE
::
OP
op
,
RegisterA64
*
rd
,
U16
imme
,
U8
shift
);
DEFINE_IS
(
MOV_WIDE
)
inline
U32
instCode
()
override
{
switch
(
op
)
{
case
MOV_WideOp_K
:
...
...
@@ -157,7 +159,7 @@ namespace SandHook {
void
assembler
()
override
;
void
decode
(
aarch64_mov_wide
*
decode
)
override
;
void
decode
(
STRUCT_A64
(
MOV_WIDE
)
*
decode
)
override
;
inline
U8
getShift
()
{
...
...
@@ -187,7 +189,7 @@ namespace SandHook {
class
INST_A64
(
B_BL
)
:
public
A64_INST_PC_REL
<
aarch64_b_bl
>
{
class
INST_A64
(
B_BL
)
:
public
A64_INST_PC_REL
<
STRUCT_A64
(
B_BL
)
>
{
public
:
enum
OP
{
...
...
@@ -197,7 +199,7 @@ namespace SandHook {
A64_B_BL
();
A64_B_BL
(
aarch64_b_bl
*
inst
);
A64_B_BL
(
STRUCT_A64
(
B_BL
)
*
inst
);
A64_B_BL
(
OP
op
,
ADDR
offset
);
...
...
@@ -210,12 +212,12 @@ namespace SandHook {
}
inline
U32
instCode
()
override
{
return
op
==
B
?
UnconditionalBranchOp
::
B
:
UnconditionalBranchOp
::
BL
;
return
op
==
B
?
UnconditionalBranchOp
::
B
:
UnconditionalBranchOp
::
BL
;
};
ADDR
getImmPCOffset
()
override
;
void
decode
(
aarch64_b_bl
*
decode
)
override
;
void
decode
(
STRUCT_A64
(
B_BL
)
*
decode
)
override
;
void
assembler
()
override
;
...
...
nativehook/src/main/cpp/archs/arm64/inst/inst_struct_aarch64.h
View file @
44b68896
...
...
@@ -78,7 +78,7 @@ struct STRUCT_A64(ADR_ADRP) {
DEFINE_OPCODE
(
MOV_WIDE
,
0
b100101
)
struct
aarch64_mov_wide
{
struct
STRUCT_A64
(
MOV_WIDE
)
{
InstA64
sf
:
1
;
InstA64
opc
:
2
;
InstA64
opcode
:
6
;
...
...
@@ -88,7 +88,7 @@ struct aarch64_mov_wide {
};
DEFINE_OPCODE
(
B_BL
,
0
b00101
)
struct
aarch64_b_bl
{
struct
STRUCT_A64
(
B_BL
)
{
InstA64
op
:
1
;
InstA64
opcode
:
5
;
InstA64
imm26
:
26
;
...
...
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