Skip to content

Commit

Permalink
improve regex module
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch0pin authored and Ch0pin committed Jan 9, 2025
1 parent 0e3d23d commit 3c3ef25
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
22 changes: 21 additions & 1 deletion mango.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,35 @@
import sys

# Local application/library specific imports
from colorama import Fore, Style, init
from libraries.libmango import *
from libraries.Questions import *
from libraries.libguava import *
from libraries.libadb import *
from libraries.logging_config import setup_logging

from shutil import which

logging.getLogger().handlers = []
setup_logging()
logger = logging.getLogger(__name__)
init(autoreset=True)

def check_cli_tools():
tools = ["adb", "jdb", "zipalign", "apksigner", "trufflehog"]
all_installed = True

logger.info("Checking required tools:")
for tool in tools:
if shutil.which(tool):
print(f"{Fore.GREEN}[✔] {tool}")
else:
print(f"{Fore.RED}[x] {tool}")
all_installed = False

if not all_installed:
logger.warning("Some tools are missing. Certain features may not work correctly.")
else:
logger.info("All tools are installed. You are good to go!")

def print_logo():
print(Style.BRIGHT + BLUE + """
Expand Down Expand Up @@ -80,6 +99,7 @@ def interactive_menu():
sys.exit(0)
else:
print_logo()
check_cli_tools()
session = sys.argv[1]
if os.path.exists(session):
start_session(session, existing=True)
Expand Down
21 changes: 21 additions & 0 deletions modules/helpers/regexes.med
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@
{
console.log('\\n--------Kotlin.text.regex hook module--------------');

let hook_1735325965 = Java.use('java.util.regex.Pattern');
let overloadCount_1735325965 = hook_1735325965['matches'].overloads.length;
colorLog('\nTracing ' +'matches' + ' [' + overloadCount_1735325965 + ' overload(s)]',{ c: Color.Green });

for (let i = 0; i < overloadCount_1735325965; i++) {
hook_1735325965['matches'].overloads[i].implementation = function() {
colorLog('*** entered ' +'matches',{ c: Color.Green });

if (arguments.length) console.log();
for (let j = 0; j < arguments.length; j++) {
console.log('arg[' + j + ']: ' + arguments[j]);
}
let retval = this['matches'].apply(this, arguments);
console.log('retval: ' + retval);
colorLog('*** exiting ' + 'matches',{ c: Color.Green });
return retval;
}
}



let Regex = Java.use('kotlin.text.Regex');
var constructors = Regex.$init;

Expand Down

0 comments on commit 3c3ef25

Please sign in to comment.