resolve_symbol
Find memory addresses of functions or symbols in game modules for reverse engineering and hooking operations.
Instructions
Resolve a symbol to its address.
Args:
module_name: Name of the module containing the symbol
symbol_name: Name of the symbol/function
Returns:
Address of the symbol.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module_name | Yes | ||
| symbol_name | Yes |
Implementation Reference
- The primary handler for the 'resolve_symbol' MCP tool. It uses a Frida script to call Module.findExportByName to resolve the symbol address in the specified module and returns it or an error.@mcp.tool() def resolve_symbol(module_name: str, symbol_name: str) -> Dict[str, Any]: """ Resolve a symbol to its address. Args: module_name: Name of the module containing the symbol symbol_name: Name of the symbol/function Returns: Address of the symbol. """ global _session if not _session.is_attached(): return {"error": "Not attached. Use attach() first."} try: script_code = f""" var addr = Module.findExportByName("{module_name}", "{symbol_name}"); send(JSON.stringify(addr ? {{address: addr.toString()}} : {{error: "Symbol not found"}})); """ 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() import json result = json.loads(result_data[0]) if result_data else {"error": "No response"} result["module"] = module_name result["symbol"] = symbol_name return result except Exception as e: return {"error": f"Failed to resolve symbol: {str(e)}"}
- src/frida_game_hacking_mcp/server.py:200-224 (registration)The resolve_symbol tool is registered/listed in the capabilities under the 'module_information' category in the list_capabilities tool."module_information": [ "list_modules", "get_module_info", "get_module_exports", "get_module_imports", "resolve_symbol" ], "function_hooking": [ "hook_function", "unhook_function", "replace_function", "hook_native_function", "list_hooks", "intercept_module_function" ], "debugging": [ "set_breakpoint", "remove_breakpoint", "list_breakpoints", "read_registers" ], "script_management": [ "load_script", "unload_script", "call_rpc" ], "window_interaction": [ "list_windows", "screenshot_window", "screenshot_screen", "send_key_to_window", "focus_window" ], "standard": [ "list_capabilities", "get_documentation", "check_installation" ] }, "total_tools": 42 }
- The resolve_symbol tool is used as a helper in the intercept_module_function tool to resolve the function address before hooking it.result = resolve_symbol(module_name, function_name) if "error" in result: return result return hook_function(result["address"], on_enter, on_leave, f"{module_name}!{function_name}")