Add Segment
add_segmentCreates a new memory segment in an IDA Pro database by specifying start address, size, name, permissions, bitness, and segment class.
Instructions
Add a new memory segment to the IDB.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"start_ea": "<start_ea>",
"size": "<size>",
"name": "<name>"
},
"name": "add_segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Segment name (e.g. '.text', 'my_seg') | |
| perm | No | Permission string: combination of r/w/x (e.g. 'rwx', 'r-x') | rw- |
| size | Yes | Segment size in bytes | |
| bitness | No | Address size: 16, 32, or 64 | |
| timeout | No | Timeout in seconds | |
| start_ea | Yes | Segment start address (hex string, e.g. '0x401000') | |
| seg_class | No | Segment class (e.g. 'CODE', 'DATA', 'BSS') | DATA |
| instance_id | No | REQUIRED whenever more than one database is open (from open_database's result or list_databases()); optional only while exactly one instance is live. |