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
75d75c0e
Commit
75d75c0e
authored
Feb 23, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
0aab93f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
0 deletions
+83
-0
art_compiler_options.h
hooklib/src/main/cpp/includes/art_compiler_options.h
+24
-0
art_jit.h
hooklib/src/main/cpp/includes/art_jit.h
+27
-0
art_runtime.h
hooklib/src/main/cpp/includes/art_runtime.h
+18
-0
hide_api.cpp
hooklib/src/main/cpp/utils/hide_api.cpp
+14
-0
No files found.
hooklib/src/main/cpp/includes/art_compiler_options.h
0 → 100644
View file @
75d75c0e
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_COMPILER_OPTIONS_H
#define SANDHOOK_ART_COMPILER_OPTIONS_H
#include "arch.h"
namespace
art
{
class
CompilerOptions
{
public
:
void
*
compiler_filter_
;
Size
huge_method_threshold_
;
Size
large_method_threshold_
;
Size
small_method_threshold_
;
Size
tiny_method_threshold_
;
Size
num_dex_methods_threshold_
;
Size
inline_depth_limit_
;
Size
inline_max_code_units_
;
};
}
#endif //SANDHOOK_ART_COMPILER_OPTIONS_H
hooklib/src/main/cpp/includes/art_jit.h
0 → 100644
View file @
75d75c0e
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_JIT_H
#define SANDHOOK_ART_JIT_H
namespace
art
{
namespace
jit
{
class
JitCompiler
{
public
:
virtual
~
JitCompiler
();
std
::
unique_ptr
<
art
::
CompilerOptions
>
compilerOptions
;
};
class
Jit
{
public
:
//void* getCompilerOptions();
};
};
}
#endif //SANDHOOK_ART_JIT_H
hooklib/src/main/cpp/includes/art_runtime.h
0 → 100644
View file @
75d75c0e
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_RUNTIME_H
#define SANDHOOK_ART_RUNTIME_H
#include "art_jit.h"
namespace
art
{
class
Runtime
{
public
:
jit
::
Jit
*
getJit
();
};
}
#endif //SANDHOOK_ART_RUNTIME_H
hooklib/src/main/cpp/utils/hide_api.cpp
View file @
75d75c0e
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
//
//
#include "../includes/hide_api.h"
#include "../includes/hide_api.h"
#include "../includes/arch.h"
#include "../includes/arch.h"
#include <memory>
#include "../includes/art_compiler_options.h"
#include "../includes/art_jit.h"
extern
int
SDK_INT
;
extern
int
SDK_INT
;
...
@@ -72,6 +75,17 @@ extern "C" {
...
@@ -72,6 +75,17 @@ extern "C" {
:
"_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadENS_6ObjPtrINS_6mirror6ObjectEEE"
;
:
"_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadENS_6ObjPtrINS_6mirror6ObjectEEE"
;
addWeakGlobalRef
=
(
jobject
(
*
)(
JavaVM
*
,
void
*
,
void
*
))
fake_dlsym
(
handle
,
addWeakGlobalRef
=
(
jobject
(
*
)(
JavaVM
*
,
void
*
,
void
*
))
fake_dlsym
(
handle
,
addWeakGloablReferenceSymbol
);
addWeakGloablReferenceSymbol
);
//try disable inline !
void
*
jitCompileHandlerGlobalAddr
=
fake_dlsym
(
handle
,
"_ZN3art3jit3Jit20jit_compiler_handle_E"
);
art
::
jit
::
JitCompiler
*
jitCompileHandlerGlobal
=
*
reinterpret_cast
<
art
::
jit
::
JitCompiler
**>
(
jitCompileHandlerGlobalAddr
);
art
::
jit
::
JitCompiler
*
jitCompileHandlerTemp
=
static_cast
<
art
::
jit
::
JitCompiler
*>
(
jitCompilerHandle
);
if
(
jitCompileHandlerGlobal
==
nullptr
)
{
return
;
}
art
::
CompilerOptions
*
options
=
jitCompileHandlerGlobal
->
compilerOptions
.
get
();
Size
inlineUnit
=
options
->
inline_max_code_units_
;
options
->
inline_max_code_units_
=
0
;
}
}
}
}
...
...
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