MCPcopy
hub / github.com/OWASP/mastg / logStackTrace

Function logStackTrace

demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/script.js:96–107  ·  view source on GitHub ↗

* Logs the current Java stack trace.

()

Source from the content-addressed store, hash-verified

94 * Logs the current Java stack trace.
95 */
96 function logStackTrace() {
97 console.log(" Stack Trace:");
98 const exception = Java.use("java.lang.Exception").$new();
99 const stackTraceElements = exception.getStackTrace();
100 for (let i = 0; i < stackTraceElements.length; i++) {
101 const element = stackTraceElements[i];
102 if (i < 10) { // Limit stack depth for cleaner output
103 console.log(" " + element.toString());
104 }
105 }
106 console.log(" --- End Stack Trace ---");
107 }
108
109
110 // --- HOOKS: Cipher (Encryption/Decryption) ---

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected