Skip to main content
Glama
0xhackerfren

Frida Game Hacking MCP

by 0xhackerfren

load_script

Load custom JavaScript scripts into game processes for memory scanning, value modification, and function hooking using Frida's instrumentation framework.

Instructions

Load a custom Frida JavaScript script.

Args:
    script_code: JavaScript code to load
    name: Name to identify the script

Returns:
    Load status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
script_codeYes
nameNocustom

Implementation Reference

  • The handler function that implements the 'load_script' MCP tool. It creates and loads a Frida script into the current session, storing it by name for later use with unload_script or call_rpc.
    @mcp.tool()
    def load_script(script_code: str, name: str = "custom") -> Dict[str, Any]:
        """
        Load a custom Frida JavaScript script.
        
        Args:
            script_code: JavaScript code to load
            name: Name to identify the script
        
        Returns:
            Load status.
        """
        global _session
        
        if not _session.is_attached():
            return {"error": "Not attached. Use attach() first."}
        
        if name in _session.custom_scripts:
            return {"error": f"Script '{name}' exists. Use unload_script() first."}
        
        try:
            script = _session.session.create_script(script_code)
            script.on('message', lambda m, d: logger.info(f"[{name}] {m}"))
            script.load()
            
            _session.custom_scripts[name] = script
            return {"success": True, "name": name}
        
        except Exception as e:
            return {"error": f"Failed to load script: {str(e)}"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xhackerfren/frida-game-hacking-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server