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
c10eabf0
Commit
c10eabf0
authored
May 14, 2019
by
swift_gan
Committed by
swift_gan
May 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak code
parent
0ac2a058
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
CMakeLists.txt
nativehook/CMakeLists.txt
+2
-0
hook.cpp
nativehook/src/main/cpp/hook/hook.cpp
+5
-2
hook.h
nativehook/src/main/cpp/includes/hook.h
+7
-1
No files found.
nativehook/CMakeLists.txt
View file @
c10eabf0
...
@@ -42,10 +42,12 @@ include_directories(
...
@@ -42,10 +42,12 @@ include_directories(
src/main/cpp/elf
src/main/cpp/elf
src/main/cpp/utils
src/main/cpp/utils
src/main/cpp/includes
src/main/cpp/includes
src/main/cpp/buffer
src/main/cpp/archs/arm64/inst
src/main/cpp/archs/arm64/inst
src/main/cpp/archs/arm64/register
src/main/cpp/archs/arm64/register
src/main/cpp/archs/arm64/decoder
src/main/cpp/archs/arm64/decoder
src/main/cpp/archs/arm64/assembler
src/main/cpp/archs/arm64/assembler
src/main/cpp/archs/arm64/relocate
src/main/cpp/archs/arm32/inst
src/main/cpp/archs/arm32/inst
src/main/cpp/archs/arm32/register
src/main/cpp/archs/arm32/register
)
)
...
...
nativehook/src/main/cpp/hook/hook.cpp
View file @
c10eabf0
...
@@ -4,17 +4,20 @@
...
@@ -4,17 +4,20 @@
#include "hook.h"
#include "hook.h"
#include "
../buffer/
code_buffer.h"
#include "code_buffer.h"
#include "
../../../../../hooklib/src/main/cpp/utils/
lock.h"
#include "lock.h"
using
namespace
SandHook
::
Hook
;
using
namespace
SandHook
::
Hook
;
using
namespace
SandHook
::
Decoder
;
using
namespace
SandHook
::
Decoder
;
using
namespace
SandHook
::
Asm
;
using
namespace
SandHook
::
Asm
;
using
namespace
SandHook
::
Assembler
;
using
namespace
SandHook
::
Assembler
;
using
namespace
SandHook
::
Utils
;
#include "assembler_a64.h"
#include "assembler_a64.h"
#include "code_relocate_a64.h"
#include "../archs/arm64/relocate/code_relocate_a64.h"
#include "../archs/arm64/relocate/code_relocate_a64.h"
AndroidCodeBuffer
*
backupBuffer
=
new
AndroidCodeBuffer
();
AndroidCodeBuffer
*
backupBuffer
=
new
AndroidCodeBuffer
();
void
*
InlineHookArm64Android
::
inlineHook
(
void
*
origin
,
void
*
replace
)
{
void
*
InlineHookArm64Android
::
inlineHook
(
void
*
origin
,
void
*
replace
)
{
AutoLock
lock
(
hookLock
);
AutoLock
lock
(
hookLock
);
...
...
nativehook/src/main/cpp/includes/hook.h
View file @
c10eabf0
...
@@ -25,9 +25,15 @@ namespace SandHook {
...
@@ -25,9 +25,15 @@ namespace SandHook {
class
InlineHookArm64Android
:
InlineHook
{
class
InlineHookArm64Android
:
InlineHook
{
public
:
public
:
inline
InlineHookArm64Android
()
{
hookLock
=
new
std
::
mutex
();
};
inline
~
InlineHookArm64Android
()
{
delete
hookLock
;
}
void
*
inlineHook
(
void
*
origin
,
void
*
replace
)
override
;
void
*
inlineHook
(
void
*
origin
,
void
*
replace
)
override
;
protected
:
protected
:
std
::
mutex
*
hookLock
=
new
std
::
mutex
()
;
std
::
mutex
*
hookLock
;
};
};
}
}
...
...
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