objdump
Analyze and extract details from object files, including file headers, section headers, and disassembled code, for malware analysis and debugging purposes.
Instructions
Display information from object files
Example usage:
Display file headers: { "target": "suspicious.o" }
Disassemble code: { "target": "suspicious.exe", "disassemble": true }
Show section headers: { "target": "suspicious.exe", "headers": true }
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| disassemble | No | Disassemble executable sections | |
| headers | No | Display the contents of the section headers | |
| options | No | Additional command-line options | |
| target | Yes | Target file or data to analyze |
Implementation Reference
- commands.js:106-123 (handler)The handler function that constructs the objdump shell command based on provided arguments, adding flags for disassembly (-d), headers (-h), or default file info (-f).buildCommand: (args) => { let options = args.options ? args.options : ''; if (args.disassemble) { options += ' -d'; } if (args.headers) { options += ' -h'; } // Default to displaying file headers if no specific options provided if (!options && !args.disassemble && !args.headers) { options = ' -f'; } return `objdump${options} ${args.target}`; },
- commands.js:102-105 (schema)Input schema definition for the objdump tool, extending base schema with optional disassemble and headers flags.schema: baseCommandSchema.extend({ disassemble: z.boolean().optional().describe("Disassemble executable sections"), headers: z.boolean().optional().describe("Display the contents of the section headers") }),
- serverMCP.js:113-117 (registration)Dynamically registers the objdump tool (and other commands) by mapping the commands configuration to MCP tool specifications in the list tools handler.const specializedTools = Object.values(commands).map(cmd => ({ name: cmd.name, description: cmd.description + (cmd.helpText ? '\n' + cmd.helpText : ''), inputSchema: zodToJsonSchema(cmd.schema), }));
- serverMCP.js:130-157 (handler)Dispatch handler in callToolRequest that processes objdump calls: validates input, builds command using config, executes via terminalManager, and returns result.if (commands[name]) { try { const cmdConfig = commands[name]; // Validate arguments against schema const validationResult = cmdConfig.schema.safeParse(args); if (!validationResult.success) { return { content: [{ type: "text", text: `Error: Invalid parameters for ${name} command.\n${JSON.stringify(validationResult.error.format())}` }], isError: true, }; } // Build the command string const commandStr = cmdConfig.buildCommand(validationResult.data); console.error(`Executing specialized command: ${commandStr}`); // Execute the command via the terminal manager const result = await terminalManager.shellCommand(commandStr); console.error(`${name} command executed with PID: ${result.pid}, blocked: ${result.isBlocked}`); return { content: [{ type: "text", text: JSON.stringify(result) }], }; } catch (error) {