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
2f56fd50
Commit
2f56fd50
authored
May 24, 2019
by
swift_gan
Committed by
swift_gan
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NativeHook]fix b
parent
c7fbe9ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
assembler_arm32.cpp
...rc/main/cpp/archs/arm/arm32/assembler/assembler_arm32.cpp
+1
-1
inst_t16.cpp
nativehook/src/main/cpp/archs/arm/arm32/inst/inst_t16.cpp
+3
-3
code_relocate_arm32.cpp
...main/cpp/archs/arm/arm32/relocate/code_relocate_arm32.cpp
+8
-4
No files found.
nativehook/src/main/cpp/archs/arm/arm32/assembler/assembler_arm32.cpp
View file @
2f56fd50
...
...
@@ -98,7 +98,7 @@ void AssemblerA32::Ldrsh(RegisterA32 &rt, const MemOperand &operand) {
}
void
AssemblerA32
::
B
(
Label
*
label
)
{
Emit
(
reinterpret_cast
<
Unit
<
Base
>*>
(
new
INST_T
32
(
B32
)(
INST_T32
(
B32
)
::
B
,
INST_T32
(
B32
)
::
arm
,
*
label
)));
Emit
(
reinterpret_cast
<
Unit
<
Base
>*>
(
new
INST_T
16
(
B
)(
*
label
)));
}
void
AssemblerA32
::
Bl
(
Label
*
label
)
{
...
...
nativehook/src/main/cpp/archs/arm/arm32/inst/inst_t16.cpp
View file @
2f56fd50
...
...
@@ -43,7 +43,7 @@ T16_B::T16_B(Label &label) {
}
Off
T16_B
::
getImmPCOffset
()
{
return
signExtend32
(
11
+
1
,
COMBINE
(
get
()
->
imm11
,
0
,
1
)
);
return
DECODE_OFFSET
(
11
,
1
);
}
void
T16_B
::
decode
(
T16_STRUCT_B
*
inst
)
{
...
...
@@ -52,12 +52,12 @@ void T16_B::decode(T16_STRUCT_B *inst) {
void
T16_B
::
assembler
()
{
SET_OPCODE
(
B
);
get
()
->
imm11
=
TruncateToUint11
(
offset
>>
1
);
DECODE_OFFSET
(
11
,
1
);
}
void
T16_B
::
onOffsetApply
(
Off
offset
)
{
this
->
offset
=
offset
;
get
()
->
imm11
=
TruncateToUint11
(
offset
>>
1
);
DECODE_OFFSET
(
11
,
1
);
}
...
...
nativehook/src/main/cpp/archs/arm/arm32/relocate/code_relocate_arm32.cpp
View file @
2f56fd50
...
...
@@ -170,8 +170,10 @@ IMPL_RELOCATE(T16, CBZ_CBNZ) {
IMPL_RELOCATE
(
T16
,
LDR_LIT
)
{
if
(
inRelocateRange
(
CODE_OFFSET
(
inst
),
sizeof
(
InstT16
)))
{
__
Ldr
(
*
inst
->
rt
,
getLaterBindLabel
(
CODE_OFFSET
(
inst
)
+
curOffset
));
if
(
inRelocateRange
(
CODE_OFFSET
(
inst
),
inst
->
rt
->
getWide
()))
{
inst
->
ref
();
inst
->
bindLabel
(
*
getLaterBindLabel
(
CODE_OFFSET
(
inst
)
+
curOffset
));
__
Emit
(
reinterpret_cast
<
Instruction
<
Base
>*>
(
inst
));
return
;
}
...
...
@@ -183,8 +185,10 @@ IMPL_RELOCATE(T16, LDR_LIT) {
IMPL_RELOCATE
(
T16
,
ADR
)
{
if
(
inRelocateRange
(
CODE_OFFSET
(
inst
),
sizeof
(
InstT16
)))
{
__
Adr
(
*
inst
->
rd
,
getLaterBindLabel
(
CODE_OFFSET
(
inst
)
+
curOffset
));
if
(
inRelocateRange
(
CODE_OFFSET
(
inst
),
inst
->
rd
->
getWide
()))
{
inst
->
ref
();
inst
->
bindLabel
(
*
getLaterBindLabel
(
CODE_OFFSET
(
inst
)
+
curOffset
));
__
Emit
(
reinterpret_cast
<
Instruction
<
Base
>*>
(
inst
));
return
;
}
...
...
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