Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
RatelApi
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
ratel
RatelApi
Commits
e5cdeeac
Commit
e5cdeeac
authored
Dec 21, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add NativeHelper
parent
3b22a491
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
NativeHelper.java
src/main/java/com/virjar/ratel/api/NativeHelper.java
+68
-0
No files found.
src/main/java/com/virjar/ratel/api/NativeHelper.java
0 → 100644
View file @
e5cdeeac
package
com
.
virjar
.
ratel
.
api
;
import
java.lang.reflect.Method
;
/**
* native分析相关的帮助类
*/
public
interface
NativeHelper
{
/**
* 查询一个native方法的的native的函数指针
*
* @param method native方法
* @return 指针
*/
long
queryNativeMethodPtr
(
Method
method
);
/**
* 尝试计算一个native方法的所在so的文件地址
*
* @param method native方法
* @return so地址,如果被特殊处理过,或者是内存释放的so。那么这里可能没有地址
*/
String
queryNativeSoPath
(
Method
method
);
/**
* 尝试将一个native方法的so文件dump下来
*
* @param method native方法
* @return so文件。有可能识别失败,此时返回null
*/
byte
[]
dumpSo
(
Method
method
);
/**
* dump读取内存中的数据
*
* @param start 开始地址
* @param size 数据大小
* @return dump的数据内容
*/
byte
[]
dumpMemory
(
long
start
,
int
size
);
/**
* 监控应用程序的读写操作
*
* @param feature 包含的特定字符串
* @param mode 监控模式 {@link TraceFileMode}
*/
void
traceFile
(
String
feature
,
int
mode
);
/**
* 监控应用程序的读写操作
*
* @param feature 包含的特定字符串
* @param mode 监控模式 {@link TraceFileMode}
* @param fileOpCallback 当文件读写操作发生时的回调
*/
void
traceFile
(
String
feature
,
int
mode
,
FileOpCallback
fileOpCallback
);
interface
FileOpCallback
{
void
onFileOp
(
int
mode
,
String
path
);
}
enum
TraceFileMode
{
READ
,
WRITE
,
OPEN
}
}
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