-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetect_engine.js
More file actions
50 lines (44 loc) · 1.83 KB
/
Copy pathdetect_engine.js
File metadata and controls
50 lines (44 loc) · 1.83 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var result = {
engine: "Unknown",
details: [],
game_modules: []
};
var modules = Process.enumerateModules();
var engineSignatures = {
"Unity": ["UnityFramework", "libunity", "libil2cpp", "libmono", "libMonoPosixHelper"],
"Unreal Engine": ["libUE4", "UE4Game", "libUnreal"],
"Cocos2d-x": ["libcocos2d", "libcocos2dcpp", "cocos2d"],
"SpriteKit": ["SpriteKit"],
"SceneKit": ["SceneKit"],
"Godot": ["libgodot", "godot_ios"],
"LayaAir": ["libLayaAir", "laya"],
};
modules.forEach(function(mod) {
for (var engine in engineSignatures) {
engineSignatures[engine].forEach(function(sig) {
if (mod.name.toLowerCase().indexOf(sig.toLowerCase()) !== -1) {
result.engine = engine;
result.details.push(engine + " => " + mod.name + " @ " + mod.base + " (size: " + mod.size + ")");
}
});
}
});
modules.forEach(function(mod) {
var name = mod.name.toLowerCase();
if (name.indexOf("game") !== -1 || name.indexOf("unity") !== -1 || name.indexOf("il2cpp") !== -1 ||
name.indexOf("mono") !== -1 || name.indexOf("cocos") !== -1 || name.indexOf("unreal") !== -1 ||
name.indexOf("metal") !== -1 || name.indexOf("gpu") !== -1 || name.indexOf("opengl") !== -1 ||
name.indexOf("sprite") !== -1 || name.indexOf("scene") !== -1 || name.indexOf("godot") !== -1 ||
name.indexOf("libmain") !== -1 || name.indexOf("libnative") !== -1) {
result.game_modules.push(mod.name + " @ " + mod.base + " (size: " + mod.size + ")");
}
});
if (ObjC.available) {
["UnityAppController", "UnityView", "UnityFramework", "UnityDefaultViewController"].forEach(function(cls) {
if (ObjC.classes[cls]) {
result.engine = "Unity";
result.details.push("ObjC class found: " + cls);
}
});
}
send(result);