-
Notifications
You must be signed in to change notification settings - Fork 0
/
mhl-cyclic-scanner.js
52 lines (42 loc) · 1.97 KB
/
mhl-cyclic-scanner.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
// frida -U -l mhl-cyclic-scanner.js -f <app-package-name>
// frida -H <device-IP-address> -l mhl-cyclic-scanner.js -f <app-package-name>
Java.perform(function() {
const color = {
red : '\x1b[0;31m',
yellow : '\x1b[0;33m',
green : '\x1b[0;32m',
blue : '\x1b[0;34m',
purple : '\x1b[0;35m',
cyan : '\x1b[0;36m',
nc : '\x1b[0m'
};
function getDateTime() {
var today = new Date();
var year = today.getFullYear();
var month = `${today.getMonth() + 1}`.padStart(2, "0");
var day = `${today.getDate()}`.padStart(2, "0");
var dateTime = [day, month, year].join("/");
var hour = `${today.getHours()}`.padStart(2, "0") + ":" + `${today.getMinutes()}`.padStart(2, "0") + ":" + `${today.getSeconds()}`.padStart(2, "0");
return "[" + color.blue + dateTime + " " + hour + color.nc + "]";
}
function init() {
console.log("\n")
successLogger("Script started successfully");
}
function successLogger(message) {
console.log(getDateTime() + " [" + color.green + "INFO" + color.nc + "] " + message);
}
function errorLogger(message){
console.log(getDateTime() + " [" + color.red + "ERROR" + color.nc + "] " + message + "\n");
}
function logger(type, method, typeValue, value) {
console.log(getDateTime() + " [" + color.yellow + type.toUpperCase() + color.nc + "] [" + color.green + method + color.nc + "] [" + color.cyan + typeValue.toLowerCase() + color.nc + "] " + value);
}
var ScanEngineCompanion = Java.use("com.mobilehackinglab.cyclicscanner.scanner.ScanEngine$Companion");
ScanEngineCompanion.scanFile.overload('java.io.File').implementation = function(file) {
var ret = this.scanFile.overload('java.io.File').call(this, file);
logger("logger", "ScanEngine$Companion.scanFile", "input", file);
return ret;
}
init();
});