objdump
Analyze object files to display headers, disassemble code, or examine sections for malware investigation.
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 |
|---|---|---|---|
| target | Yes | Target file or data to analyze | |
| options | No | Additional command-line options | |
| disassemble | No | Disassemble executable sections | |
| headers | No | Display the contents of the section headers |
Implementation Reference
- serverMCP.js:130-163 (handler)Core handler logic for executing the 'objdump' tool: checks if specialized command, validates input using the tool's schema, builds the shell command using buildCommand, executes it via terminalManager.shellCommand, and returns the 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) { console.error(`Error executing ${name} command:`, error); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true, }; }
- serverMCP.js:113-121 (registration)Registers the 'objdump' tool (among specialized tools) in the MCP tools list by dynamically mapping from the commands configuration to include name, description, and inputSchema.const specializedTools = Object.values(commands).map(cmd => ({ name: cmd.name, description: cmd.description + (cmd.helpText ? '\n' + cmd.helpText : ''), inputSchema: zodToJsonSchema(cmd.schema), })); return { tools: [...basicTools, ...specializedTools], };
- commands.js:102-105 (schema)Zod input schema definition for the 'objdump' tool, extending the base schema with optional boolean parameters for disassembly and headers.schema: baseCommandSchema.extend({ disassemble: z.boolean().optional().describe("Disassemble executable sections"), headers: z.boolean().optional().describe("Display the contents of the section headers") }),
- commands.js:106-123 (helper)Helper function that constructs the specific 'objdump' shell command string based on provided arguments, adding appropriate flags or defaulting to file headers.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}`; },