Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
You can execute any script file supported by the built-in scripting engine (IDC or Python), or a scripting language added by a plugin. The scripting language to use is selected by the file name extension of the script.
See also Immediate execution of script commands, Load... submenu commands.
You can enter and execute a small script written in the built-in IDC language or any other registered extlang.
Here is the list of built-in functions.
See also:
IDC language overview
Execute script file command
File... submenu commands
How to use notepad.
In this submenu you can:
This submenu allows you to produce various output files. It also allows you to unload the database.
The text file-producing operations below will make use of
Please enter a file name for the map. IDA will write the following information about this file:
You can use this map file for your information, and also for debugging (for example, Periscope from Periscope Company or Borland's Turbo Debugger can read this file).
Please enter a file name for the assembler text file. IDA will write the disassembled text to this file.
If some I/O problem (e.g. disk full) occurs during writing to the file, IDA will stop and a partial file will be created.
Please enter a file name for the assembler include file. IDA will write the information about the defined types (structures and enums) to this file.
If some I/O problem (e.g. disk full) occurs during writing to the file, IDA will stop and a partial file will be created.
Enter a file name for the assembler listing file. IDA will write the disassembled text to this file.
If some I/O problem (e.g. disk full) occurs during writing to the file, IDA will stop and a partial file will be created.
IDA produces executable files only for:
EXE files: Output files will have the same EXE-header and relocation table as the input file. IDA will fill unused ranges of the EXE file (e.g. between relocation table and loadable pages) with zeroes.
This command will prompt you for a filename and then will create a plain text difference file of the following format:
Please enter a file name for the HTML file. IDA will write the disassembled text to this file.
If some I/O problem (e.g. disk full) occurs during writing to the file, IDA will stop and a partial file will be created.
This command is available only in the graphical version of IDA.
This command creates a GDL (graph description file) with the flow chart of the current function.
If there is an active selection, its flow chart will be generated.
IDA will ask for the output file name. Regardless of the specified extension, the .GDL extension will be used.
This command creates a GDL (graph description file) with the graph of the function calls.
IDA will ask for the output file name. Regardless of the specified extension, the .GDL extension will be used.
This command saves current IDA database into a text file.
You can use it as a safety command:
This command is used when you want to switch to a new version of IDA. Usually each new version of IDA has its own database format. To create a new format database, you need:
Please note that this command does not save everything to text file. Any information about the local variables will be lost!
This command saves all definitions in the local types window into a C header file.
This command saves information about the user-defined types from the IDA database into a text file.
Information about enums, structure types and other user-defined types is saved in a text form as an IDC program.
You can use this command to migrate the type definitions from one database to another.
Load file
Execute a script command
Generate output file
Execute OS commands
Save database in packed form
Save database in packed form in another file
Take database snapshot
Abort - do not save changes
Quit to DOS - save changes
See also submenus.
for output files.
You may disable the generation of the segmentation information. You may also enable or disable names in the output file.
If you have selected a range on the screen using command, IDA will write only the selected range (from the current address to the anchor).
If you've selected a range on the screen using command, IDA will write only the selected range (from the current address to the anchor).
Enter a file name for the new executable file. Usually this command is used after patching (see commands and ) to obtain a patched version of the file.
For other file formats please create a file.
Only commands affect the executable file contents, other commands (including ) will not affect the content of the disassembled file.
See also submenu.
See also submenu.
If you've selected a range on the screen using command, IDA will write only the selected range (from the current address to the anchor).
See also commands.
This command terminates the current IDA session. The Abort command is not available if the database was not packed.
See also other File... submenu commands. Quit command.
This submenu allows you to load additional files into the database.
This command reloads the same input file into the database. IDA tries to retain as much information as possible in the database. All the names, comments, segmentation information and similar will be retained.
Only the values of individual bytes will be changed.
This command works for some input file types only: if the file was loaded into the database with special settings, this command may fail. In this case, use Dump database to IDC file command and reload the file manually.
See also Load... submenu commands.
This command loads a binary file. The new file is added to the current database and all existing information is retained.
The file content will appear as unexplored bytes in the program.
This command only allows you to load binary files.
See also Load... submenu commands.
This command loads an IDS file.
An IDS file contains information about well-known functions (such as functions from MS Windows API), namely:
IDS files are automatically loaded if they are found in the IDS directory. This command allows you to load an IDS file from any directory, even after the main file has been loaded into the database.
See also Load... submenu commands.
This command loads a DBG file.
If the program being disassembled has a companion DBG file, then this command may be used to load information from a DBG file into the database. IDA loads DBG files automatically if it can find them in the directory with the input file.
The built-in debug information loader cannot load NB10 format files and PDB files. To load those files, please use a special plugin, PDB.DLL, which can be run manually using Edit->Plugins submenu. This plugin uses MS Windows DLLs to load the debug information and therefore has the following limitations:
See also Load... submenu commands.
This command loads a PDB file.
If the program being disassembled has a companion PDB file, then this command may be used to load information from the PDB file into the database.
By default IDA uses in-house code to parse and load PDB files. However, our code can not parse old v2.0 PDB files. For them, IDA can fall back to using Microsoft DLLs (the default is "do not fall back"). Please read more in cfg/pdb.cfg.
Command line switch '-Opdb:option1:option2' overrides for ida session the value in cfg/pdb.cfg.
Ida will not load PDB plugin for this session.
This command loads a TDS file.
If the program being disassembled has a companion TDS file, this command may be used to load information from the TDS file into the database.
The TDS file must be placed in the same directory together with the input file.
The LoadTdsFile command launches a special plugin TDS.DLL which can be run manually using Edit->Plugins submenu.
See also Load... submenu commands.
This command allows you to apply an additional signature file to the program.
A signature file contains patterns of standard runtime functions. With their help, IDA is able to recognize the standard functions and names them accordingly.
IDA attempts to detect the necessary signature files automatically but unfortunately, this is not always possible. This command adds the specified signature file into the planned signature files queue.
Signature files reside in the subdirectories of the SIG directory. Each processor has its own subdirectory. The name of the subdirectory is equivalent to the name of the processor module file (z80 for z80.w32, for example). Note: IBM PC signatures are located in the SIG directory itself. Note: the IDASGN environment variable can be used to specify the location of the signatures directory.
There is another way to load a signature file: you may insert/delete signature files in the following way:
This is a preferred way of applying signatures because useful information, such as the number of identified functions is displayed in the signature window.
FLIRT works only for the processors with normal byte size. The byte size must be equal to 8 (processors with wide bytes like AVR or DSP56K are not supported)
See also Load... submenu commands.
This command allows you to apply type declarations from a C header file to the program.
IDA reads and parses the specified header file as a C compiler does. In other words, it mimics the front-end of a C compiler with some restrictions:
Don't forget to specify the compiler and memory model in the compiler setup dialog box before loading a header file.
All type declarations found in the input file are stored in the current database in the form of a type library. These type declarations can be used to define new structure and enumeration definitions by pressing "Add standard structure" or "Add standard enum" buttons in the Add enum type... and Add struct type... dialog boxes.
In the case of an error in the input file, the error messages appear in the message window. In any case, the function declarations that are already parsed are not deleted from the database. IDA stops parsing the input file when 20 errors occur.
IDA 7.7 introduced an alternative header file parser based on libclang.
See also
Load... submenu commands.
The IDAClang plugin is shipped with IDA, and it provides the ability to parse header files that contain arbitrarily complex C/C++/Objective-C source code using the Load C header action.
To enable the IDAClang parser, go to Options>Compiler>Source parser, and select "clang". Then use 'File>Load file>Parse C header file' to invoke the parser on a given source file.
Since IDAClang is based on the third-party libclang parser, it can only parse standalone source files that contain valid C/C++/Objective-C syntax.
See also Load C header command.
See also other File... submenu commands.
By using this command, you can temporarily quit to the operating system.
This command is not available in the MS DOS version.
The database is left open when you use this command, so be careful.
This command saves and packs the current database.
See also commands.
See also commands. command.
This command reverts the previously issued Undo command. It is possible to use Redo multiple times.
This command also reverts all changes that were done to the database after the last Undo command, including the eventual useful modifications made by the autoanalysis. In other words, the entire database is modified to get to the exact state that it had before executing the last Undo command.
See also
This command deletes the current instruction or data, converting it to 'unexplored' bytes. IDA will delete the subsequent instructions if there are no more references to them (functions are never deleted).
If you have selected a range using the anchor, all the bytes in this range will be converted into 'unexplored' bytes. In this case, IDA will not delete any other instructions even if there are no references to them after the deletion.
See also Edit submenu
To delete a name, simply give an empty name.
Local name
Include in name list
Public name
Autogenerated name
Weak name
Create name anyway
This command gives name/renames/deletes for the current item.
If the current item is referenced, you cannot delete its name. Even if you try, IDA will generate a name.
Here you can also include/remove the name from the
. If the name is hidden, you will not see it in
.
See also submenu. . .
This command converts the immediate operand of the current instruction/data to an offset from the current data segment (DS).
If current DS value is unknown (or equal 0xFFFF) IDA will warn you -- it will beep. In this case, you have to define DS register value for the current byte. The best way to do it is:
return or you can change default value of DS for the current segment.
If you want to delete offset definition, you can use this command again - it works as trigger.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
If a range is selected using the anchor, IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to offsets. However, IDA will ask you first the lower and upper limits of immediate operand value. If the operand value is >= lower limit and <= upper limit then the operand will be converted to offset, otherwise it will be left unmodified.
To create offsets to structure members use Convert to struct offset command.
See also:
Enter the operand manually command.
This command converts the immediate operand of the current instruction/data to an offset from the current segment (CS).
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
If a range is selected using the anchor, IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to offsets. However, IDA will ask you first the lower and upper limits of immediate operand value. If the operand value is >= lower limit and <= upper limit then the operand will be converted to offset, otherwise, it will be left unmodified.
If this command is applied to a structure member in the local types window, then IDA will create an "automatic offset". An automatic offset is an offset with the base equal to 0xFFFFFFFF. This base value means that the actual value of the base will be calculated by IDA when a structure instance is created.
To create offsets to structure members, use Convert to struct offset command.
See also:
Enter #th operand manually commands.
This command converts the immediate operand of the current instruction/data to an offset from any segment.
IDA will ask to choose a base segment for the offset.
If a range is selected using the anchor, IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to offsets. However, IDA will ask you first the lower and upper limits of immediate operand value. If the operand value is >= lower limit and <= upper limit then the operand will be converted to offset, otherwise it will be left unmodified.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
To create offsets to structure members use Convert to struct offset command.
See also:
Enter #th operand manually commands.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
If the offset base is specified as 0xFFFFFFFF, then IDA will create "an automatic offset". Automatic offsets mean that the actual value of the base will be calculated by IDA.
The following offset attributes are available:
The offset base is dynamically calculated and is equal to the address of the current element:
for standalone items: their start address
for arrays: the start of the array element
for structures: the start of the structure field The offset expression is displayed in the following concise form: offset target - $ where "$" denotes the start of the element (and is assembler-dependent). To create offsets to structure members use Convert to struct offset command.
See also:
Enter #th operand manually commands.
This command permits to convert all immediate operands of instructions in a range selection to a path of offsets through a structure and its possible sub unions. If no selection is active, IDA will simply permit to convert the current operand. In this case, it will display a simple dialog box the same way as the text version (see below).
You can select the desired register in the drop-down list: all operands relative to this register will be added to the 'Offsets' list. A special empty line in the drop-down list is used to directly work on immediate values. Checkboxes in the 'Offsets' list allow you to select which operand you indeed want to modify. By default, IDA will select only undefined operands, to avoid overwriting previous type definitions. This list is sorted by operand value, by instruction address and finally by operand number. You can easily see the instructions related to the operand by moving the mouse over it, and wait for a hint to be displayed.
The 'Structures and Unions' tree will contain all selectable structures, and sub unions. Once you select or move over a structure, the 'Offsets' list updates itself for each checked offset: the computed name of the operand is displayed, according to the selected structure in the tree. An icon is also drawn, to easily know if a specific structure matchs the offset or not, or if the offset is too big for the selected structure. The structures who match the most offsets will be near the top of the tree. You can also move your mouse over structures in the tree to obtain an interesting hint.
A '?' icon can also appear, if the offset can be specialized by selecting an union member. In this case, if you expand the structure in the tree, you can select the adequate union member simply by checking the desired radio button. IDA automatically corrects the related name in the 'Offsets' list.
The 'Offset delta' value represents the difference between the structure start and the pointer value. For example, if you have an operand 4 and want to convert in into an expression like "mystruct.field_6-2", then you have to enter 2 as the delta. Usually the delta is zero, i.e. the pointer points to the start of the structure.
The 'Hide sub structures without sub unions' option (checked by default) avoids to add unnecessary sub structures to the tree, to keep it as small as possible. If you uncheck this option, all sub structures will be added to the tree.
By default, IDA displays the structure member at offset 0. To change this behaviour, you can directly disable the 'Force zero offset field' in the 'Options' frame. Later zero offsets can be forced using Edit, Structs, Force zero offset menu item.
This command converts immediate operand(s) type of the current instruction/data to an offset within the specified structure. Before using this command, you have to define a structure type.
First of all, IDA will ask a so-called "struct offset delta". This value represents the difference between the structure start and the pointer value. For example, if you have an operand 4 and want to convert in into an expression like "mystruct.field_6-2", then you have to enter 2 as the delta. Usually the delta is zero, i.e. the pointer points to the start of the structure.
If a range is selected using the anchor, IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to offsets. However, IDA will ask you first the lower and upper limits of immediate operand value. If the an operand value is >= lower limit and <= upper limit then the operand will be converted to offset, otherwise it will be left unmodified.
When you use this command, IDA deletes the manually entered operand.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
By default IDA doesn't display the structure member at offset 0. To change this behaviour, use Force zero field offset command.
Moreover, if there are several possible representations (this can happen if unions are used), select the desired representation using the Select union member... command.
See also:
Enter #th operand manually command.
Related topics: Edit|Operand types submenu.
This command allows you to create arrays and change their sizes.
The arrays are created in 2 simple steps:
Apply the array command to the created data item. Enter array size in current array elements (not bytes). The suggested array size is the minimum of the following values:
For string literals, you can use this command to change the length of the string.
The dialog box contains the following fields:
Items on a line (meaningless for string literals):
Please note that the margin parameter affects the number of items on a line too.
Alignment (meaningless for string literals):
If applied to a variable-sized structure, this command is used to specify the overall size of the structure. You cannot create arrays of variable-sized structures.
See also:
Edit submenu
This command converts the immediate operand(s) type of the current instruction/data to segment base. The segment bases are usually displayed like this:
When you use this command, IDA deletes the manually entered operand.
If IDA cannot find a segment whose base is equal to the operand value, it simply displays it as hex number.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
See also Edit|Operand types submenu.
This command converts immediate operand(s) type of the current instruction/data to character.
When you use this command, IDA deletes the manually entered operand.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise, all other operands will be affected.
See also Edit|Operand types submenu.
If you have selected a range before applying an operand conversion command, IDA will display a dialog box.
You can choose a range of operands to perform an en masse operation:
The operation will be performed on all operands as a toggle. For example, if you ask to convert to a character, then all non-character operands will become characters, and all character operands will become non-chars.
The operation will be performed on the void operands which contain immediate numbers in the specified range.
This selection will convert all operands with the specified type to undefined operands. Example: all characters become non-characters.
This selection allows to convert all operands that do not have the specified type to the specified type. Example: all non-characters to characters.
This selection allows to convert all operands without any type to the specified type. Example: all operands with no type to characters.
IDA will check whether an operand can be represented with the specified type (as a character constant, for example), and perform type conversion only if the check is successful.
You may specify any string instead of an operand if IDA does not represent the operand in the desired form. In this case, IDA will simply display the specified string in the instruction instead of the default operand.
The current operand (under the cursor) will be affected.
You can use this command not only with instructions but with data items too.
IDA proposes the previous manual operand as the default value in the input form.
To delete the manual operand and revert back to the default text, specify an empty string.
IDA automatically deletes manually entered operands when you change operand representation using operand types submenu.
NOTE: A text offset reference is generated if you use a label in the program as the operand string. In other cases no cross-references are generated.
See also Edit|Operand types submenu.
This command changes the sign of the current operand. Please note that not all operands can change their sign.
See also: Edit|Operand types submenu. Enter #th operand manually commands. Set operand type
This command allows you to specify the type of the operand under the cursor.
The operand type must be entered as a C declaration. Currently IDA itself does not use the operand type information. However, it can be used by the Hex-Rays decompiler plugin. Setting operand type is most useful in case of indirect calls: the decompiler will use the type information to determine the input parameters to the call instead of guessing, which can make the decompiled code better.
An example of a type declaration:
To delete a type declaration, enter an empty string.
For details on possible calling conventions, see Set function/item type... menu item description.
See also Set function/item type...
This command converts immediate operand(s) type of the current instruction/data to an enum member. Before using this command, you have to define an enumeration type.
If the selected enum is a bitfield, IDA will try to build a bitfield expression to represent the constant. Please note that for bitfields having multiple constants with the same value some expressions won't be possible.
If a range is selected using the anchor, IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to symbolic constants. However, IDA will ask you first the lower and upper limits of immediate operand value. If the operand value is >= lower limit and <= upper limit then the operand will be converted to offset, otherwise it will be left unmodified.
When you use this command, IDA deletes the manually entered operand.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise all other operands will be affected.
See also: Edit|Operand types submenu. Enter #th operand manually commands. Set operand type
This command terminates the current IDA session. IDA will write all changes to the disk and will close all databases.
You can also perform garbage collection on the database before packing it. The garbage collection removes the unused database pages, making it smaller. However, IDA needs some free database pages when it works,therefore it will allocate them again when you reuse the database. Removing and adding free pages takes time and, what is most important, it changes the database control blocks.
Use garbage collection only when you do not intend to work with the database in the near future.
You can enable/disable database packing. When the database is packed, it consists of one file with IDB extension. When the database is not packed, it consists of several files on the disk. If packing is disabled, in the next session you cannot IDA. We do not recommend to leave the database in the unpacked form because you will not have a backup copy.
IDA will remember all information about the screen, cursor position, jump stack, etc. The following information will be lost: , the position To resume a disassembly session simply type: "ida file"
See also commands. command.
This command takes a database snapshot. The snapshot can be later restored from the database snapshot manager.
Note: snapshots work only with regular databases. Unpacked databases do not support them.
See also View database snapshot manager commands.
See also Edit submenu.
This command allows you to create an alignment directive. The alignment directive will replace a number of useless bytes inserted by the linker to align code and data to paragraph boundary or any other address which is equal to a power of two.
You can select a range to be converted to an alignment directive. If you have selected a range, IDA will try to determine a correct alignment automatically.
There are at least two requirements for this command to work:
there must be enough unexplored bytes at the current address.
an alignment directive must always end at an address which is divisible by a power or two.
See also
This command allows you to specify the representation of an instruction or data in the program.
Use it if IDA cannot represent the current instruction as desired. If the instruction itself is ok and only one operand is misrepresented, then use Enter operand manually command.
To delete the manual representation, specify an empty string.
This command allows you to specify the background color for the current instruction or data item.
Only GUI version supports different background colors. Specifying a non-defined custom color will reset the instruction color.
This command allows you to hide a thin border which is like the one generated automatically by IDA between instructions and data. If the border was already hidden, then it is displayed again.
Note that you can hide all borders at once in the Comments Dialog.
This submenu allows you to manipulate segments of the program:
See also:
This command allows you to create a new segment.
You need to specify at least:
If another segment already exists at the specified address, the existing segment is truncated and the new segment lasts from the specified start address to the next segment (or specified end address, whichever is lower). If the old and the new segments have the same base address, instructions/data will not be discarded by IDA. Otherwise, IDA will discard all instructions/data of the new segment.
An additional segment may be created by IDA to cover the range after the end of the new segment.
nternally, IDA has 32-bit linear address space (IDA64 uses 64-bit address space). The internal addresses are called "linear addresses". The input program is loaded into this linear address space.
Please note that usually the linear addresses are not used in the program directly. During disassembling, we use so-called "virtual addresses", which are calculated by the following formula:
We see that the SegmentBase determines what addresses will be displayed on the screen. More than that, IDA allows to create several segments with the same virtual address in them. For this, you just need to create segments with correct segment base values.
There are some address restrictions in IDA.
There is a range of addresses that are used for internal housekeeping. This range can be specified by the configuration variable PRIVRANGE (start address and size). It is not recommended to use these addresses for other purposes.
There is also one address which must never be used in the disassembly. It is the 'all ones' address, or -1. Internally, it is used as a BADADDR (bad address). No address or address range can include BADADDR.
Related topics:
IBM PC case -----------
Suppose we need to create a segment occupying addresses F000:1000..F000:2000 Let's calculate linear addresses:
The segment base must be selected so that the first offset in our segment will be 0x1000. Let's find it using the following equation:
After solving this equation, we see that the segment base is equal to 0xF000. (you see, this is really a very simple case :) )
Now, we can create a segment entering:
Please note that the end address never belongs to the segment in IDA.
Suppose we need to create a segment occupying virtual addresses 8000-C000. Since we are free to place our segment anywhere in the linear address space, we choose the linear addresses at our convenience. Let's say we choose a linear address 0x20000:
The segment base must be selected so that the virtual address in our segment will be 0x8000. Let's find it using the following equation:
After solving this equation, we see that the segment base is equal to 0x1800.
Now we can create a segment entering:
Please note that the end address never belongs to the segment in IDA.
Suppose we need to create a segment occupying linear addresses 200000-200C00 and the virtual addresses must have be 0000..0C00. If we simply enter
Then IDA will notice that the segment base is too big and does not fit into 16bits. Because of this IDA will find a free selector (let's say it has found selector number 5), define it to point at paragraph 0x20000 and create a segment. After all this we will have:
The first virtual address in the segment will be 0:
Please note that the end address never belongs to the segment in IDA.
2. Create a segment. Specify the selector number as the segment base.
This command allows you to delete a segment.
IDA will ask your the permission to disable the addresses occupied by the segment. If you allow this operation, all information about the segment will be deleted. In other words, IDA will discard the information about instructions or data, comments etc.
If you check the "disable addresses" checkbox, IDA will mark the addresses occupied by the segment as "nonexistent" in the program. You will lose *ALL* information, including byte values.
It is impossible to disassemble the content of addresses not located in any segment, therefore you must create a new segment if you want to resume the disassembly of that part of the code.
IDA will ask your the permission to disable addresses occupied by the segment. If you give your permission, information about the segment will be deleted, otherwise IDA will discard information about instruction/data, comments etc, but retain byte values so that you will be able to create another segment afterwards.
Changing the segment class may change the segment type.
DISABLE ADDRESSES: if set, when a segment is shrunk, all information about bytes going out of the segment will be completely removed.. Otherwise, IDA will discard information about instructions/data, comments etc, but will retain byte values so that another segment can be created later and it will use the existing byte values.
If IDA creates 2 segments where only one segment must exist, you may try the following sequence:
Segments with the 'debugger' attribute are the segments whose memory contents are not saved in the database. Usually, these segments are created by the debugger to reflect the current memory state of the program.
However, the user can modify this attribute.
If it is cleared, then the segment will permanently stay in the database after closing the debugger session. The database will reflect the state of the segment which was at the time when the status is changed.
If it is set, then the segment will become a temporary segment and will be deleted at the end of the debugging session.
The "debugger segment" checbkox is available only during debugging sessions.
The 'loader' segments are the segment created by the file loader. The segment having this attribute are considered to be part of the input file.
A segment with the 'debugger' attribute set and the 'loader' attribute not set is considered to be an ephemeral segment. Such segments are not analyzed automatically by IDA.
"Segment permissions" group box can be used to modify Segment access permissions (Read/Write/Execute)
Enter a new name for the segment. A segment name is up to 8 characters long. IDA does check if the length is ok. Try to give mnemonic names for the segments.
The segment class name identifies the segment with a class name (such as CODE, FAR_DATA, or STACK). The linker places segments with the same class name into a contiguous range of memory in the runtime memory map.
Changing the segment class changes only the segment definition on the screen. There are the following predefined segment class names:
If you change segment class and the segment type is "Regular", then the segment type will be changed accordingly.
In order to set the segment type "Regular", you should change the segment class to "UNK".
Segment class names are never deleted. Once you define a segment class name, you cannot reuse it as a name of another object.
You can choose between 16-bit and 32-bit segment addressing.
IDA will delete all instructions and data in the segment if the segment address is changed.
Never do it if you are not sure. It may have irreversible consequences, all instructions/data will be converted to undefined bytes.
Alignment: select between abs,byte,word,dword,para,page
You can specify the segment alignment for the selected segment. By default, IDA assumes 'byte' alignment.
Changing the alignment changes only the segment definition on the screen. Nothing else will happen.
Combination
A field that describes how the linker can combine the segment with other segments. Under MS-DOS, segments with the same name and class can be combined in two ways: they can be concatenated to form one logical segment, or they can be overlapped. In the latter case, they have either the same start address or the same end address, and they describe a common range in memory. Values for the field are:
Changing segment combination changes only the segment definition on the screen. Nothing else will happen.
This command allows you to move segment(s) to another address. Use it if the segment(s) are loaded at a wrong address.
This command shifts (moves) the selected segments in the memory to the target address. There must be enough free space at the target address for the segments.
All information in the segment will be moved to the new address, but since the addresses change, the disassembly might be not valid anymore (especially if the program is moved to the wrong addresses and the relocation information is not available).
The whole program will be shifted by the specified amount of bytes in the memory. The following options are available (we strongly recommend to leave them turned on):
Please note rebasing the program might remove user-defined xrefs.
in the segment C obviously refers to the segment B while the instruction
refers to the segment A.
However, IDA does not try to link these references unless you tell it to do so: include the segments A and B into a translation list of the segment C. It means that you have to create a translation list
for the segment C.
Below is a more complicated example:
translations
allow you to emulate overlays (the first set is A B D, the second A C E)
See also
Relevant only for processors with the segment registers.
You can specify a default value of a segment register for the current segment. When you change the default value, IDA will reanalyze the segment, taking the default value when it cannot determine the actual value of the register. This takes time, so do not be surprised if references are not corrected immediately.
Relevant only for processors with the segment registers. Currently this command works for IBM PC, TMS320C2, Intel80196, and PowerPC processors.
For Alpha processors, the user must enter the difference between the real GP value and the start of the GOT (global offset table). For example:
If you want to specify that a register points to "label", you must calculate and enter the difference "label-.got" as the register value.
The ARM processor module has a virtual segment register T which reflects the state of the T bit of the processor state register (PSR). Therefore, the value of this register controls THUMB/ARM mode. If its value is not zero, then the disassembly will be in the thumb mode.
For PowerPC processors, the user must enter an offset from the beginning of the TOC to the TOC entry which contains the address of the target. An example:
If you want to specify that a register points to "datachunk", you must calculate and enter the difference "sometc-TOC" as the register value. You can change the TOC value in the processor specific options (which is accessible from the analysis options).
For Intel 80196NP/NU processors, the user must enter the value of WSR or WSR1 register. IDA will automatically take the new value into account.
See also:
IDA classifies the change points. In the list of the change points, you can see the following postfixes after the register values:
IDA can display a list of the program segments. Each segment is represented by a line in the list. Please note that the end address of the segment never belongs to the segment in IDA.
The following segment attributes are visible:
The rest of the columns display the default values of the segment registers for the segment.
By default, the cursor is located on the current segment.
You can use normal cursor movement keys and the mouse. You can also search for the segment by pressing Alt-T, or directly jump to the desired line by typing in its number.
Press <Enter> to select line, <Esc> to cancel the selection.
This submenu allows you to patch the image of the input file. More precisely, IDA never modifies the input file. The image of the input file which was loaded to the database will be modified.
You can modify the image of the input file:
IDA will display the original value, the current value and file offset. If the file offset is equal to 0xFFFFFFFF then the current byte comes from a compressed page (LX/LE/NE iterated pages, for example) and/or it is not possible to tell the file position.
The following commands are available:
See also:
If this command is invoked when the debugger is active, then IDA will modify the memory and the database. If the database does not contain the patched bytes, then only the process memory will be modified.
Apply previously patched bytes back to the input file. If the "Restore" option is selected then the original bytes will be applied to the input file.
The sequence must be separated by a space or a comma.
An entered number will occupy the minimal number of bytes it fits in with the restriction that the number of bytes is a power of 2 (1, 2, or 4 bytes).
Two question marks without a space between them are the same as one question mark. One question mark corresponds to one CPU byte. One CPU byte may consist of multiple octets for a wide-byte CPU, like TMS320C28.
Example:
This command allows you to assemble instructions. Currently, only the IBM PC processors provide an assembler, nonetheless, plugin writers can extend or totally replace the built-in assembler by writing their own.
The assembler requires to enclose all memory references into square brackets. For example:
Also, the keyword 'offset' must not be used. Instead of
you must write
This submenu allows you to manipulate the structures in specific operations. The following commands are accessible from the disassembly window.
Commands for creating, editing, and deleting the structures are available from the Local Types window.
Use regular commands to specify struct and union members, their types, comments, etc.
A union is a special kind of structure. Use structure definition commands to manipulate unions.
This command declares a variable of the specified structure type.
You can also use this command to declare a structure field in another structure (i.e. nested structures are supported too).
This command forces IDA to display a full structure member name even if the offset of the member is equal to zero.
If used twice, the command cancels itself.
Example: Suppose we have the following structure:
This command tells IDA how to display references to a union from the current cursor location.
Example: Suppose we have the following union:
This command defines a new structure from data already defined. The new structure is created with adequate data types, and each member uses the current data name if it is available.
This command is available only in the graphical version of IDA.
This command scans the current struct variable and renames the locations pointed by offset expressions unless they already have a non-dummy name.
It also copies the type info from the struct members to pointed locations.
submenu.
If you select a range using the , IDA will propose the start address and the end address of the selection as defaults for the segment bounds.
Click to learn about addressing model used in IDA.
If "sparse storage" is set, IDA will use special sparse storage method for the segment. This method is recommended for huge segments. Later, it is possible to change the storage method of any region using IDC function.
Normally a SegmentBase is a 16bit quantity. To create a segment with base >= 0x10000, you need to use . However, if you try to create a segment with a segment base >= 0x10000, IDA will automatically choose appropriately a free selector and setup for the new segment.
All SegmentBases are looked up in the table.
Click to see an example of segment creation (simple case - IBM PC)
Click to see an example of segment creation (simple case - Z80)
Click to see another example of segment creation (automatically chosen selector)
Click to see another example of segment creation (user-defined selector)
See also
If the example we saw how IDA allocates a selector automatically. You could make it yourself:
1. Create a selector. For this, open the and press Ins. Enter a selector number and its value.
You can also edit (see below) an adjacent segment to it to those addresses.
To disassemble the addresses occupied by the segment, you need to create a new segment again (i.e. you cannot disassemble bytes without a segment). You can also another adjacent segment to these addresses.
MOVE ADJACENT SEGMENTS: means that the previous and next segments will be shrunk or expanded to fill gaps between segments. Click for more information.
one segment. Choose one with bad segment base value. Do not disable addresses occupied by the segment being deleted.
change bounds of another segment. Note that the segment command changes the boundaries of the overlapping segment automatically.
IMPORTANT NOTE1: If you use the segment translations, make sure that all segments have unique segment bases. If two segments are placed in the linear address space so that they must have the same segment base, you may assign different with equal values to them.
IMPORTANT NOTE2: IDA supports only one translation list per segment. This translation is applied by default to all instruction in the segment. If the segment uses other mappings, then these individual mappings can be specified for each instruction separately by using the commands.
IMPORTANT NOTE3: Since only code references are affected by the segment translations, try to create the RAM segment at its usual place (i.e. its linear address in IDA corresponds to its address in the processor memory). This will make all data references to it to be correct without any segment translation. For the data references to other segments you'll need to use the command for each such reference.
To specify a value other than the default value of a segment register, you can use command.
See also
This command creates or updates a segment register .
See for more info.
When IDA encounters an instruction which changes a segment register, it creates a segment register change point. So, mostly change points are maintained by IDA itself. IDA assumes that the segment registers do not change their values between change points. If you find out that IDA failed to locate a segment register change, or if you want to change a register value, you can create a change point using command. You can change the value of a segment register using command too.
IDA generates the appropriate 'assume' instructions for the change points if it was not disabled by .
You can create a file and use an external tool to apply the patches or you can apply the directly to the file using IDA.
submenu.
You can modify the executable file and eventually file.
If you patch bytes, then you may enter multiple bytes. Follow this to learn about format of the input string.
You can create a file too.
See also .
See also .
See also .
See also submenu.
IDA will ask you to choose a structure type. You must have some structure types in order to use this command.
If the supports it, IDA will display the structure in terse form (using just one line). To uncollapse a terse structure variable use the command.
This command converts the current unexplored bytes to instruction(s). IDA will warn you if it is not possible.
If you have selected a range using the [anchor](../../../disassembler/navigation/anchor.md, all the bytes from this range will be converted to instructions.
If you apply this command to an instruction, it will be reanalyzed.
See also Edit submenu
This command reverts the database to the state before executing the last user action. It is possible to apply Undo multiple times, in this case multiple user actions will be reverted.
Please note the entire database is reverted, including all modifications that were made to the database after executing the user action and including the ones that are not connected to the user action. For example, if a third party plugin modified the database during or after the user action, this modification will be reverted. In theory it is possible to go back in time to the very beginning and revert the database to the state state that was present immediately after performing the very first user action. However, in practice the undo buffers overflow because of the changes made by autoanalysis. Autoanalysis generates copious amounts of undo data. Also please note that maintaining undo data during autoanalysis slows it down a bit. In practice it is not a big deal because the limit on the undo data is reached quite quickly (in a matter of minutes). Therefore, if during analysis the user does not perform any actions that modify the database, the undo feature will turn itself off temporarily.
However, if you prefer not to collect undo data at all during the initial autoanalysis, just turn off the UNDO_DURING_AA parameter in ida.cfg.
The configuration file ida.cfg has 2 more undo-related parameters:
Since there is a limit on the size of undo buffers, any action, even the tiniest, may become non-undoable after some time. This is true because the analysis or plugins may continue to modify the database and overflow the buffers. Some massive actions, like deleting a segment, may be non-undoable just because of the sheer amount of undo data they generate.
Please note that Undo does not affect the state of IDC or Python scripts. Script variables will not change their values because of Undo. Also nothing external to the database can be changed: created files will not be deleted, etc.
Some actions cannot be undone. For example, launching a debugger or resuming from a breakpoint cannot be undone.
See also
This command clears the undo history. After it the Undo and Redo commands become unavailable. However, once the user performs a new action, IDA will again start journaling all database modifications.
A side effect of this command is fast autoanalysis: since there is no user action to revert yet, IDA does not maintain undo buffers and this speeds up the analysis.
See also
This submenu allows the user to modify text representation and to patch the file. It also has the commands to control the analysis:
Operand types submenu
Comments submenu
Functions submenu
Structs submenu
Segments submenu
Patch program submenu
Other submenu
Plugins submenu
See also Menu Bar submenus.
This command converts the current unexplored bytes to data. If it is not possible, IDA will warn you.
Multiple using of this command will change the data type:
You may remove some items from this list using setup data command.
If the target assembler does not support double words or another data type, it will be skipped. To create a structure variable, use Declare struct var command. To create an array, use Array command. To convert back, use Undefine command. See also Edit submenu
The full syntax and semantics of the regular expressions that are supported by PCRE2 are described in the pcre2pattern documentation. This document contains a quick-reference summary of the syntax.
QUOTING
ESCAPED CHARACTERS
This table applies to ASCII and Unicode environments.
Note that \0dd is always an octal code. The treatment of backslash followed by a non-zero digit is complicated; for details see the section "Non-printing characters" in the pcre2pattern documentation, where details of escape processing in EBCDIC environments are also given.
When \x is not followed by {, from zero to two hexadecimal digits are read, but if PCRE2_ALT_BSUX is set, \x must be followed by two hexadecimal digits to be recognized as a hexadecimal escape; otherwise it matches a literal "x". Likewise, if \u (in ALT_BSUX mode) is not followed by four hexadecimal digits, it matches a literal "u".
CHARACTER TYPES
\C is dangerous because it may leave the current matching point in the middle of a UTF-8 or UTF-16 character. The application can lock out the use of \C by setting the PCRE2_NEVER_BACKSLASH_C option. It is also possible to build PCRE2 with the use of \C permanently disabled.
By default, \d, \s, and \w match only ASCII characters, even in UTF-8 mode or in the 16-bit and 32-bit libraries. However, if locale-specific matching is happening, \s and \w may also match characters with code points in the range 128-255. If the PCRE2_UCP option is set, the behaviour of these escape sequences is changed to use Unicode properties and they match many more characters.
GENERAL CATEGORY PROPERTIES FOR \p and \P
PCRE2 SPECIAL CATEGORY PROPERTIES FOR \p and \P
Perl and POSIX space are now the same. Perl added VT to its space character set at release 5.18.
SCRIPT NAMES FOR \p AND \P
Ahom, Anatolian_Hieroglyphs, Arabic, Armenian, Avestan, Balinese, Bamum, Bassa_Vah, Batak, Bengali, Bopomofo, Brahmi, Braille, Buginese, Buhid, Canadian_Aboriginal, Carian, Caucasian_Albanian, Chakma, Cham, Cherokee, Common, Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, Devanagari, Duployan, Egyptian_Hieroglyphs, Elbasan, Ethiopic, Georgian, Glagolitic, Gothic, Grantha, Greek, Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hatran, Hebrew, Hiragana, Imperial_Aramaic, Inherited, Inscriptional_Pahlavi, Inscriptional_Parthian, Javanese, Kaithi, Kannada, Katakana, Kayah_Li, Kharoshthi, Khmer, Khojki, Khudawadi, Lao, Latin, Lepcha, Limbu, Linear_A, Linear_B, Lisu, Lycian, Lydian, Mahajani, Malayalam, Mandaic, Manichaean, Meetei_Mayek, Mende_Kikakui, Meroitic_Cursive, Meroitic_Hieroglyphs, Miao, Modi, Mongolian, Mro, Multani, Myanmar, Nabataean, New_Tai_Lue, Nko, Ogham, Ol_Chiki, Old_Hungarian, Old_Italic, Old_North_Arabian, Old_Permic, Old_Persian, Old_South_Arabian, Old_Turkic, Oriya, Osmanya, Pahawh_Hmong, Palmyrene, Pau_Cin_Hau, Phags_Pa, Phoenician, Psalter_Pahlavi, Rejang, Runic, Samaritan, Saurashtra, Sharada, Shavian, Siddham, SignWriting, Sinhala, Sora_Sompeng, Sundanese, Syloti_Nagri, Syriac, Tagalog, Tagbanwa, Tai_Le, Tai_Tham, Tai_Viet, Takri, Tamil, Telugu, Thaana, Thai, Tibetan, Tifinagh, Tirhuta, Ugaritic, Vai, Warang_Citi, Yi.
CHARACTER CLASSES
In PCRE2, POSIX character set names recognize only ASCII characters by default, but some of them use Unicode properties if PCRE2_UCP is set. You can use \Q...\E inside a character class.
QUANTIFIERS
ANCHORS AND SIMPLE ASSERTIONS
MATCH POINT RESET
\K is honoured in positive assertions, but ignored in negative ones.
ALTERNATION
CAPTURING
ATOMIC GROUPS
COMMENT
OPTION SETTING
The following are recognized only at the very start of a pattern or after one of the newline or \R options with similar syntax. More than one of them may appear. (*LIMIT_MATCH=d) set the match limit to d (decimal number)
Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value of the limits set by the caller of pcre2_match(), not increase them. The application can lock out the use of (*UTF) and (*UCP) by setting the PCRE2_NEVER_UTF or PCRE2_NEVER_UCP options, respectively, at compile time.
NEWLINE CONVENTION
These are recognized only at the very start of the pattern or after option settings with a similar syntax.
WHAT \R MATCHES
These are recognized only at the very start of the pattern or after option setting with a similar syntax.
LOOKAHEAD AND LOOKBEHIND ASSERTIONS
Each top-level branch of a look behind must be of a fixed length.
BACKREFERENCES
SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)
CONDITIONAL PATTERNS
BACKTRACKING CONTROL
The following act immediately they are reached:
The following act only when a subsequent match failure causes a backtrack to reach them. They all force a match failure, but they differ in what happens afterwards. Those that advance the start-of-match point do so only if the pattern is not anchored. (*COMMIT) overall failure, no advance of starting point
CALLOUTS
The allowed string delimiters are ` ' " ^ % # $ (which are the same for the start and the end), and the starting delimiter { matched with the ending delimiter }. To encode the ending delimiter within the string, double it.
You can search for:
See also
Data arrays are considered to be suspicious if the first element of the data array is within the lower and upper suspicious limits. Values of other elements are not examined.
NOTE: We strongly recommend that before producing an ASM file you go through all 'suspicious' marks and get rid of them. After this you have a certain level of confidence that the file has been disassembled correctly.
This command searches for the first instruction or data byte that contains the specified immediate value. The command is relatively slow (but much faster than the text search), because it disassembles each instruction to find the operand values.
If the immediate value in an instruction has been logically or bitwise negated, then this command will check against the modified value. Example:
will be found if the user searches for the immediate value 2 but not when he searches for 0xFE.
If the checkbox "any untyped value" is checked, then the "value" field is ignored. IDA will look for all immediate values without type in this case.
Note that this command searches the same as what you see on your screen (and not in binary image).
This command searches for the specified substring in the file being disassembled. This command can be used for fast lookups of text strings in the executable file or even to find references to a data. You can interrupt it pressing Ctrl-Break.
The substring is specified like this:
i.e. in the double-quotes. Also you can specify individual byte values as numbers:
For example, if you want to find a reference to the following string:
you could search for number 106A in the file.
See also
The current direction for searches is displayed in the right upper corner of the screen. Using this command, you can toggle the display.
This command searches for all suspicious operands and presents a list of them. You may use this list to examine the operands and modify them as needed.
See also
This commands searches for the 'error' operands. Usually, these operands are displayed with a red color.
Below is the list of probable causes of error operands:
This command searches for all strings containing any error and presents a list of them. You may use this list to examine errors and correct them as needed.
See also
This command converts immediate operand(s) type of the current instruction to an offset to stack variables, i.e. a local variable or function argument in the stack.
If the cursor is on the first operand (the cursor is before ',') then the first operand will be affected; otherwise all other operands will be affected.
IDA opens a special non-closable window at the start. This window is called "message window". In this window you see various IDA messages.
If the message window is hidden behind other windows, you will not see the IDA messages.
You can duplicate all messages appearing in this window to a file. For this, you have to define an environment variable:
This command shows the database snapshot manager. In this dialog, it is possible to restore previously saved snapshots, rename or delete them.
Note: snapshots work only with regular databases. Unpacked databases do not support them.
Here are commands to open various windows, display information etc.
In this menu, you can select a command to search for something in the disassembly. Searches are relatively slow and your previous position is saved in the .
(instructions that need your attention)
in both - (up and down).
menu for fast navigating.
submenus
Suspicious operands are the operands that need your attention because they contain an immediate value that could be a number or an offset. IDA does not know about it, so it marks these instructions as 'suspicious'. You can change the suspiciousness of the operands using and commands.
You can disable the display of the 'suspicious' marks in the .
This command searches for the first in the .
This command searches for the first item in the .
This command searches for the first byte in the .
This command searches for the first defined byte ( or ) in the .
This command repeats command.
This command searches for the specified substring in the text representation of the disassembly. This command is a slow command, because it disassembles each instruction to get the text representation. IDA will show its progress on the . You can interrupt this command pressing Ctrl-Break.
You may search for too.
If a range is selected using , IDA will search for the specified substring in the range.
For binary search, look at
This command repeats command.
If a range is selected using , IDA will search for the specified substring in the range.
Follow this to learn more about the format of the input string.
command.
This command repeats command.
This command searches for the first byte not belonging to any function in the .
See also submenu.
You need to stack variables before using this command.
If the current operand is based on the value of the stack pointer ([ESP+xxx]) and the SP value is traced incorrectly, then you need to correct SP value using command.
If a range is selected using the , IDA will perform 'en masse' conversion. It will convert immediate operands of all instructions in the selected range to stack variables. However, IDA will ask you first the lower and upper limits of immediate operand value. If the operand value is >= lower limit and <= upper limit then the operand will be converted to stack variable, otherwise it will be left unmodified.
When you use this command, IDA deletes the entered operand.
See also: submenu. commands.
The set of allowed characters is specified in the file, parameter StrlitChars. Character '\0' is not allowed in any case. If the current does not allow characters above 0x7F, characters with high bit set are not allowed.
If the has been dropped, IDA will take for the string all characters between the current cursor position and the anchor.
Use the if the string starts a disallowed character.
This command also generates a for the string. In the file, you can specify the characters allowed in names (NameChars).
You can change the literal string length using command.
To create Pascal style strings (with first byte indicating string length) use command.
See also submenu
See also commands.
See also submenus.