Created
May 22, 2020 08:04
-
-
Save dzervas/1db04bdc1c3306e18bef31fbc48125a7 to your computer and use it in GitHub Desktop.
Frida Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enumerates all Java classes & methods in a nice way | |
var enumer = {}; | |
enumer.exclude = [ "size" ]; | |
filter = filter || function(obj, prop) { return true; }; | |
enumer.enumer = function(filter) { | |
return { | |
onMatch: function(obj) { | |
var tmpStr = ""; | |
for (var prop in obj) { | |
if (enumer.exclude.indexOf(prop)) | |
continue; | |
if (!pattern(obj, prop)) | |
continue; | |
switch(typeof obj[prop]) { | |
case "number": | |
tmpStr += " - " + prop + ": " + obj[prop].toString(); | |
break; | |
case "string": | |
tmpStr += " - " + prop + ": " + obj[prop]; | |
break; | |
default: | |
break; | |
} | |
} | |
if (tmpStr !== "") | |
send(tmpStr); | |
}, | |
onComplete: function() {} | |
}; | |
} | |
enumer.modules = function(filter) { | |
Process.enumerateModules(enumer.enumer(filter)); | |
} | |
enumer.moduleImports = function(module, filter) { | |
Module.enumerateImports(module, enumer.enumer(filter)); | |
} | |
enumer.moduleExports = function(module, filter) { | |
Module.enumerateExports(module, enumer.enumer(filter)); | |
} | |
enumer.moduleSymbols = function(module, filter) { | |
Module.enumerateSymbols(module, enumer.enumer(filter)); | |
} | |
enumer.threads = function(filter) { | |
Process.enumerateThreads(enumer.enumer(filter)); | |
} | |
enumer.javaLoadedClasses = function(module, filter) { | |
filter = filter || function(object, property) { return true; }; | |
Java.perform(function() { | |
Java.enumerateLoadedClasses({ | |
onMatch: function(obj) { | |
if (filter(obj)) | |
console.log("Class Name: " + obj); | |
}, | |
onComplete: function() {} | |
}) | |
}) | |
} | |
var ret0 = new NativeCallback(function(a, b) { | |
console.log("Return 0!"); | |
return 0; | |
}, "int", ["void", "void"]); | |
// Note: X509_verify_cert | |
var ret1 = new NativeCallback(function(a, b) { | |
console.log("Return 1!"); | |
return 1; | |
}, "int", ["void", "void"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment