forked from Rob--/memoryjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (27 loc) · 1.16 KB
/
index.js
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
var memoryjs = require('./build/Release/memoryjs');
module.exports = {
openProcess: function(processName, callback){
if(arguments.length == 1) return memoryjs.openProcess(processName);
else memoryjs.openProcess(processName, callback);
},
getProcesses: function(callback){
if(arguments.length == 0) return memoryjs.getProcesses();
else memoryjs.getProcesses(callback);
},
findModule: function(moduleName, processId, callback){
if(arguments.length == 2) return memoryjs.findModule(moduleName, processId);
else memoryjs.findModule(moduleName, processId, callback);
},
getModules: function(processId, callback){
if(arguments.length == 1) return memoryjs.getModules(processId);
else memoryjs.getModules(processId, callback);
},
readMemory: function(address, dataType, callback){
if(arguments.length == 2) return memoryjs.readMemory(address, dataType);
else memoryjs.readMemory(address, dataType, callback);
},
writeMemory: function(address, value, dataType, callback){
if(arguments.length == 3) return memoryjs.writeMemory(address, value, dataType);
else memoryjs.writeMemory(address, value, dataType, callback);
}
};