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
e4af8592
Commit
e4af8592
authored
Jan 17, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix C++
parent
af878e60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
cast.h
app/src/main/cpp/includes/cast.h
+9
-9
arm64.S
app/src/main/cpp/trampoline/arch/arm64.S
+2
-0
base.h
app/src/main/cpp/trampoline/arch/base.h
+11
-0
trampoline.h
app/src/main/cpp/trampoline/trampoline.h
+8
-0
No files found.
app/src/main/cpp/includes/cast.h
View file @
e4af8592
...
...
@@ -4,6 +4,7 @@
#include <stdint.h>
#include <string.h>
#include <jni.h>
#include "arch.h"
#include "utils.h"
...
...
@@ -74,10 +75,11 @@ namespace SandHook {
};
template
<
typename
PType
>
class
ArrayMember
:
IMember
<
PType
,
void
*>
{
class
ArrayMember
:
public
IMember
<
PType
,
void
*>
{
public
:
virtual
void
init
(
JNIEnv
*
jniEnv
,
PType
p
,
Size
parentSize
)
override
:
IMember
::
init
(
jniEnv
,
p
,
parentSize
)
{
virtual
void
init
(
JNIEnv
*
jniEnv
,
PType
p
,
Size
parentSize
)
override
{
IMember
<
PType
,
void
*>::
init
(
jniEnv
,
p
,
parentSize
);
elementSize
=
calElementSize
(
jniEnv
,
p
);
}
...
...
@@ -85,17 +87,15 @@ namespace SandHook {
return
elementSize
;
}
virtual
void
*
arrayStart
(
PType
parent
)
{
return
get
(
parent
);
virtual
Size
arrayStart
(
PType
parent
)
{
return
reinterpret_cast
<
Size
>
(
IMember
<
PType
,
void
*>::
get
(
parent
)
);
}
Size
getParentSize
()
:
IMember
::
getParentSize
()
=
default
;
public
:
using
IMember
<
PType
,
void
*>::
getParentSize
;
virtual
void
setElement
(
PType
parent
,
int
position
,
void
*
elementPoint
)
{
void
*
array
=
arrayStart
(
parent
);
memcpy
(
array
+
position
*
getElementSize
(
),
elementPoint
,
getElementSize
());
Size
array
=
arrayStart
(
parent
);
memcpy
(
reinterpret_cast
<
void
*>
(
array
+
position
*
getElementSize
()
),
elementPoint
,
getElementSize
());
}
private
:
...
...
app/src/main/cpp/trampoline/arch/arm64.S
0 → 100644
View file @
e4af8592
#include <base.h>
app/src/main/cpp/trampoline/arch/base.h
0 → 100644
View file @
e4af8592
//
// Created by SwiftGan on 2019/1/17.
//
#ifndef SANDHOOK_BASE_H
#define SANDHOOK_BASE_H
#define FUNCTION_START(x) .global x; x:
#define FUNCTION_END(x) . - x
#endif //SANDHOOK_BASE_H
app/src/main/cpp/trampoline/trampoline.h
0 → 100644
View file @
e4af8592
//
// Created by SwiftGan on 2019/1/17.
//
#ifndef SANDHOOK_TRAMPOLINE_H
#define SANDHOOK_TRAMPOLINE_H
#endif //SANDHOOK_TRAMPOLINE_H
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