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
d09bebd0
Commit
d09bebd0
authored
Jun 01, 2019
by
swift_gan
Committed by
swift_gan
Jun 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NativeHook]fix arm32 break point
parent
770e1992
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
hook_arm32.cpp
nativehook/src/main/cpp/archs/arm/arm32/hook/hook_arm32.cpp
+2
-6
arm32_base.h
nativehook/src/main/cpp/archs/arm/arm32/inst/arm32_base.h
+1
-1
No files found.
nativehook/src/main/cpp/archs/arm/arm32/hook/hook_arm32.cpp
View file @
d09bebd0
...
@@ -78,17 +78,13 @@ bool InlineHookArm32Android::breakPoint(void *origin, void (*callback)(REG *)) {
...
@@ -78,17 +78,13 @@ bool InlineHookArm32Android::breakPoint(void *origin, void (*callback)(REG *)) {
StaticCodeBuffer
inlineBuffer
=
StaticCodeBuffer
(
reinterpret_cast
<
Addr
>
(
originCode
));
StaticCodeBuffer
inlineBuffer
=
StaticCodeBuffer
(
reinterpret_cast
<
Addr
>
(
originCode
));
AssemblerA32
assemblerInline
(
&
inlineBuffer
);
AssemblerA32
assemblerInline
(
&
inlineBuffer
);
CodeContainer
*
codeContainerInline
=
&
assemblerInline
.
codeContainer
;
//build backup method
//build backup method
CodeRelocateA32
relocate
=
CodeRelocateA32
(
assemblerBackup
);
CodeRelocateA32
relocate
=
CodeRelocateA32
(
assemblerBackup
);
backup
=
relocate
.
relocate
(
origin
,
4
*
2
,
nullptr
);
backup
=
relocate
.
relocate
(
origin
,
4
*
2
,
nullptr
);
#define __ assemblerBackup.
#define __ assemblerBackup.
Label
*
origin_addr_label
=
new
Label
();
__
Mov
(
IP
,(
Addr
)
getThumbPC
(
reinterpret_cast
<
void
*>
((
Addr
)
originCode
+
relocate
.
curOffset
)));
__
Ldr
(
PC
,
origin_addr_label
);
__
Bx
(
IP
);
__
Emit
(
origin_addr_label
);
__
Emit
((
Addr
)
getThumbPC
(
reinterpret_cast
<
void
*>
((
Addr
)
originCode
+
relocate
.
curOffset
)));
__
finish
();
__
finish
();
#undef __
#undef __
...
...
nativehook/src/main/cpp/archs/arm/arm32/inst/arm32_base.h
View file @
d09bebd0
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#define DECODE_OFFSET(bits, ext) signExtend32(bits + ext, COMBINE(get()->imm##bits, 0, ext))
#define DECODE_OFFSET(bits, ext) signExtend32(bits + ext, COMBINE(get()->imm##bits, 0, ext))
#define ENCODE_OFFSET(bits, ext) get()->imm##bits = TruncateToUint##bits(offset >> ext)
#define ENCODE_OFFSET(bits, ext) get()->imm##bits = TruncateToUint##bits(offset >> ext)
#define CODE_OFFSET(I) I->offset +
I->instType() == A32 ? 2 * 4 : 2 * 2
#define CODE_OFFSET(I) I->offset +
(I->instType() == A32 ? 2 * 4 : 2 * 2)
using
namespace
SandHook
::
RegistersA32
;
using
namespace
SandHook
::
RegistersA32
;
...
...
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