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
Syntax:
  __enum(enum_name)
Instead of a plain number, a symbolic constant from the specified enum will be used. The enum can be a regular enum or a bitmask enum. For bitmask enums, a bitwise combination of symbolic constants will be printed. If the value to print cannot be represented using the specified enum, it will be displayed in red.

Example:

   enum myenum { A=0, B=1, C=3 };
   short var __enum(myenum);
   If `var` is equal to 1, it will be represented as "B"
Another example:
   enum mybits __bitmask { INITED=1, STARTED=2, DONE=4 };
   short var __enum(mybits);
   If `var` is equal to 3, it will be represented as "INITED|STARTED"
This annotation is useful if the enum size is not equal to the variable size. Otherwise using the enum type for the declaration is better:
   myenum var;  // is 4 bytes, not 2 as above
Index | Previous topic | Next topic