Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
 Action    name: SegmentTranslation
 
A segment translation is a sequence of other segments to use when resolving the references to instructions from the current segment. Only code references are affected by the segment translation. Data references can be redirected to the desired addresses by modifying the data segment register.

This feature is available only for selected processors (it is not available for IBM PC processors).

We hope it is easier to give an example than to give a formal definition. Suppose we have 3 segments:

                start   end
        A       0000    1000
        B       1000    2000
        C       3000    4000
The instruction
        call    1000
in the segment C obviously refers to the segment B while the instruction
        call    500
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

        A B
for the segment C.

Below is a more complicated example:

                start   end
        A       0000    1000
        B       1000    2000
        C       1000    2000
        D       3000    4000
        E       3000    4000
translations
        B:      A
        C:      A
        D:      A B
        E:      A C
allow you to emulate overlays (the first set is A B D, the second A C E)

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 selectors 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 make offset 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 make offset command for each such reference.

See also

         addressing space concepts
         Edit|Segments submenu.
Index | Previous topic | Next topic