forked from Rob--/memoryjs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
69 lines (58 loc) · 1.51 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const memoryjs = require('./build/Release/memoryjs');
module.exports = {
// data type constants
BYTE: 'byte',
INT: 'int',
INT32: 'int32',
UINT32: 'uint32',
INT64: 'int64',
UINT64: 'uint64',
DWORD: 'dword',
SHORT: 'short',
LONG: 'long',
FLOAT: 'float',
DOUBLE: 'double',
BOOL: 'bool',
BOOLEAN: 'boolean',
PTR: 'ptr',
POINTER: 'pointer',
STR: 'str',
STRING: 'string',
VEC3: 'vec3',
VECTOR3: 'vector3',
VEC4: 'vec4',
VECTOR4: 'vector4',
// function data type constants
T_VOID: 0x0,
T_STRING: 0x1,
T_CHAR: 0x2,
T_BOOL: 0x3,
T_INT: 0x4,
T_DOUBLE: 0x5,
T_FLOAT: 0x6,
openProcess(processIdentifier, callback) {
if (arguments.length === 1) {
return memoryjs.openProcess(processIdentifier);
}
memoryjs.openProcess(processIdentifier, callback);
},
findModule(moduleName, processId, callback) {
if (arguments.length === 2) {
return memoryjs.findModule(moduleName, processId);
}
memoryjs.findModule(moduleName, processId, callback);
},
readMemory(handle, address, dataType, callback) {
if (arguments.length === 3) {
return memoryjs.readMemory(handle, address, dataType.toLowerCase());
}
memoryjs.readMemory(handle, address, dataType.toLowerCase(), callback);
},
readBuffer(handle, address, size, callback) {
if (arguments.length === 3) {
return memoryjs.readBuffer(handle, address, size);
}
memoryjs.readBuffer(handle, address, size, callback);
},
closeProcess: memoryjs.closeProcess, // nop
};