-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (35 loc) · 1.14 KB
/
Copy pathscript.js
File metadata and controls
36 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
rpc.exports = {
moduleInfo: function (so_name) {
var info = Process.findModuleByName(so_name);
if (info == null) {
return -1;
}
return info;
},
memoryRanges: function (base, size) {
var start = ptr(base);
var end = start.add(size);
return Process.enumerateRanges({ protection: '---', coalesce: false })
.filter(function (range) {
var rangeEnd = range.base.add(range.size);
return range.base.compare(end) < 0 && rangeEnd.compare(start) > 0;
})
.map(function (range) {
return {
base: range.base.toString(),
size: range.size,
protection: range.protection
};
});
},
dumpMemory: function (base, size) {
var p = ptr(base);
try {
return p.readByteArray(size);
} catch (e) {
// A mapping can change between enumeration and reading. Let the
// host preserve this portion of the image with zero-filled bytes.
return null;
}
}
}