IDA 位域

IDA的观点就是: bitfields是一种特殊的枚举类型。
strcut software_info_t
{
    unsigned int plateform : 2; //platforms can be combined(0x03)
    #define PC 0x1 //0x01
    #define MAC 0x2 //0x02
    unsigned int os : 3; //OS can be combined (0x1C)
    #define WINDOWS 0x1 //0x04
    #define DOS 0x2 //0x08
    #define OS_X 0x4 //0x10
    unsigned int category : 2;//categories can't be combined(0x60)
    #define DISASSEMBLY 0x1 //0x20
    #define RECOVERY 0x2 //0x40
    #define CRYPTOGRAPHY 0x3 //0x60
};


IDA 中的enum定义
00000001 ; enum software_info_t (bitfield)
00000001 PC               EQU 1
00000002 MAC              EQU 2
00000004 WINDOWS          EQU 4
00000008 DOS              EQU 8
00000010 OS_X             EQU 0x10
00000060 category         EQU 0x60
00000060 DISASSEMBLY      EQU 0x20
00000060 RECOVERY         EQU 0x40
00000060 CRYPTOGRAPHY     EQU 0x60
00000060

注意 DISASSEMBLY,RECOVERY,CRYPTOGRAPHY都以category(mask name),0x60(mask).

你可能感兴趣的:(IDA 位域)