Skip to content

Conversation

@cybergrind
Copy link
Contributor

Hello @ttimasdf

I'd like to thank you for a great plugin! Also it is a pure joy too use a tool built to use with uv (and pre-commit) ❤️

This PR adds a new tool get_binary to add ability to retrieve arbitrary pieces of binary from a file. It is helpful when analyzing some embedded resources. I've used it to spot bytecode inside exe built with nuitka and it helped a lot.

Let me know what do you think about it

@ttimasdf
Copy link
Member

ttimasdf commented Apr 14, 2025

Hi, cybergrind. Thanks for the contribution ❤️

I've been thinking about a tool to dump binary data too, especially after exploring sidekick recently (#10). A similar MCP tool, get_data_dump, provided by sidekick, is defined like this:

{
    "type": "function",
    "function": {
        "name": "get_data_dump",
        "description": "Return a hex/data listing around a given address (includes known data variables with optional cross-references).",
        "parameters": {
            "type": "object",
            "properties": {
                "address": {
                    "type": "string",
                    "description": "Address in the data section to focus on."
                },
                "window_size": {
                    "type": "integer",
                    "description": "Number of bytes around the address to include (default 128)."
                },
                "include_xrefs": {
                    "type": "boolean",
                    "description": "Whether to include cross-references (default true)."
                }
            },
            "required": [
                "address"
            ]
        }
    }
}

I think it would be great to expose our tool with a similar function name and parameter names. We could skip include_xrefs for now since it's quite a large feature to implement, even in sidekick.

Additionally, moving hex_to_human to utils.py is a good idea to keep things more organized.

@cybergrind cybergrind marked this pull request as draft April 14, 2025 07:28
@cybergrind cybergrind force-pushed the get_binary branch 3 times, most recently from 7050dbd to 98d61f2 Compare April 14, 2025 12:49
@cybergrind cybergrind changed the title tool: initial implementation of get_binary tool: initial implementation of get_data_dump Apr 14, 2025
@cybergrind cybergrind marked this pull request as ready for review April 14, 2025 12:49
@cybergrind
Copy link
Contributor Author

hi @ttimasdf

all done, could you please check?

@ttimasdf
Copy link
Member

Sorry, I've been tied up with work lately. I'll get back to it when I have some free time, hopefully in a week or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants