We’ve seen how custom structures can be used to format data tables nicely, but sometimes you can improve your understanding even further with small adjustments. For example, in the structure we created, the first member (nMessage
) is printed as a simple integer:
If you know Win32 API well, you may recognize that these numbers correspond to window messages, but it would be nice to see the symbolic names instead of numbers without having to check MSDN or Windows headers every time. In fact, IDA already has this mapping in the standard type libraries, so we just need to use it for our structure member. It can be done pretty easily using the following steps:
WM_COMMAND
), or just type MACRO_WM
in the Name field directly, then click OK.AFX_MSGMAP_ENTRY
in the Structures window MACRO_WM
from the list. An automatic comment is added for the field:See also:
Igor’s tip of the week #99: Enums
Igor’s Tip of the Week #125: Structure field representation
Igor’s tip of the week #60: Type libraries