Skip to main content
Glama

set_breakpoint

Set a software breakpoint at a memory address to execute JavaScript code when triggered, enabling game debugging and reverse engineering.

Instructions

Set a software breakpoint at address. Args: address: Address for breakpoint callback: JavaScript code to execute when hit Returns: Breakpoint status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
callbackNo

Implementation Reference

  • Handler function that sets a software breakpoint by attaching a Frida Interceptor to the given address, executing an optional JavaScript callback on entry, and storing the script in session state.
    @mcp.tool() def set_breakpoint(address: str, callback: str = "") -> Dict[str, Any]: """ Set a software breakpoint at address. Args: address: Address for breakpoint callback: JavaScript code to execute when hit Returns: Breakpoint status. """ global _session if not _session.is_attached(): return {"error": "Not attached. Use attach() first."} if address in _session.breakpoints: return {"error": f"Breakpoint exists at {address}"} try: addr = int(address, 16) if address.startswith("0x") else int(address) callback_code = callback or "console.log('[BP] Hit at ' + this.context.pc);" script_code = f""" Interceptor.attach(ptr("{hex(addr)}"), {{ onEnter: function(args) {{ {callback_code} }} }}); send("Breakpoint set"); """ script = _session.session.create_script(script_code) script.on('message', lambda m, d: None) script.load() _session.breakpoints[address] = script return {"success": True, "address": address} except Exception as e: return {"error": f"Failed to set breakpoint: {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