list_modules
Lists all loaded modules (DLLs/shared libraries) with base address, size, and path information for game hacking and reverse engineering analysis.
Instructions
List all loaded modules (DLLs/shared libraries).
Returns:
List of modules with base address, size, and path.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The primary handler for the 'list_modules' MCP tool. It checks if attached to a process, injects a Frida script to enumerate modules using Process.enumerateModules(), collects the results via message handler, parses JSON, and returns count and module list (name, base, size, path).@mcp.tool() def list_modules() -> Dict[str, Any]: """ List all loaded modules (DLLs/shared libraries). Returns: List of modules with base address, size, and path. """ global _session if not _session.is_attached(): return {"error": "Not attached. Use attach() first."} try: script_code = """ var modules = Process.enumerateModules(); var result = modules.map(function(m) { return {name: m.name, base: m.base.toString(), size: m.size, path: m.path}; }); send(JSON.stringify(result)); """ result_data = [] def on_message(message, data): if message['type'] == 'send': result_data.append(message['payload']) script = _session.session.create_script(script_code) script.on('message', on_message) script.load() script.unload() if not result_data: return {"error": "Failed to enumerate modules"} import json modules = json.loads(result_data[0]) return {"count": len(modules), "modules": modules} except Exception as e: return {"error": f"Failed to list modules: {str(e)}"}