Skip to main content
Glama
0xhackerfren

Frida Game Hacking MCP

by 0xhackerfren

list_memory_regions

Identify and analyze memory regions in a process to support game hacking and reverse engineering tasks. Filter results by protection flags like read, write, or execute permissions.

Instructions

List memory regions in the process.

Args:
    protection: Filter by protection (e.g., "r-x", "rw-", "rwx")

Returns:
    List of memory regions with base, size, and protection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protectionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'list_memory_regions' MCP tool. It injects Frida JavaScript to enumerate all memory ranges using Process.enumerateRanges('r--'), maps them to JSON with base, size, protection, and file path, sends back via send(), parses, optionally filters by protection string, limits to 100, and returns count and regions list. Requires an attached Frida session.
    def list_memory_regions(protection: str = "") -> Dict[str, Any]:
        """
        List memory regions in the process.
        
        Args:
            protection: Filter by protection (e.g., "r-x", "rw-", "rwx")
        
        Returns:
            List of memory regions with base, size, and protection.
        """
        global _session
        
        if not _session.is_attached():
            return {"error": "Not attached. Use attach() first."}
        
        try:
            script_code = """
            var ranges = Process.enumerateRanges('r--');
            var result = ranges.map(function(r) {
                return {
                    base: r.base.toString(),
                    size: r.size,
                    protection: r.protection,
                    file: r.file ? r.file.path : null
                };
            });
            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 regions"}
            
            import json
            regions = json.loads(result_data[0])
            
            if protection:
                regions = [r for r in regions if protection in r['protection']]
            
            return {"count": len(regions), "regions": regions[:100]}
        
        except Exception as e:
            return {"error": f"Failed to enumerate regions: {str(e)}"}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the tool lists memory regions and returns a list with base, size, and protection, but lacks details on permissions needed, rate limits, pagination, or error conditions. For a tool with potential security implications (memory access), this is insufficient behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured: a clear purpose statement followed by 'Args' and 'Returns' sections with bullet-like formatting. Every sentence adds value without redundancy, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (memory-related operation), no annotations, and an output schema present (which handles return values), the description is minimally adequate. It covers purpose and parameter semantics but lacks usage guidelines and sufficient behavioral transparency, leaving gaps for an AI agent to infer context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter 'protection' by providing examples (e.g., 'r-x', 'rw-', 'rwx'), which clarifies its format beyond the schema's basic string type. With 0% schema description coverage and 1 parameter, this compensates well, though it could specify allowed values more explicitly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List memory regions in the process.' It specifies the verb ('List') and resource ('memory regions'), though it doesn't explicitly differentiate from siblings like 'list_modules' or 'list_processes' beyond the resource type. The purpose is unambiguous but lacks sibling comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions a filter parameter but doesn't explain scenarios for filtering or not filtering, nor does it reference sibling tools for related tasks. Usage is implied only by the tool's name and basic function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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