Untitled
By: a guest | Feb 9th, 2010 | Syntax:
None | Size: 0.52 KB | Hits: 68 | Expires: Never
// Usage: EFLAGS(ctx)->SF = 1;
// The above would set the sign flag for CONTEXT variable, ctx, to 1 (The only two valid options being 0 or 1).
typedef union {
DWORD flags;
struct {
unsigned CF : 1;
unsigned reserved1 : 1;
unsigned PF : 1;
unsigned reserved2 : 1;
unsigned AF : 1;
unsigned reserved3 : 1;
unsigned ZF : 1;
unsigned SF : 1;
unsigned TF : 1;
unsigned IF : 1;
unsigned DF : 1;
unsigned OF : 1;
};
} EFLAGS;
#define EFLAGS(ctx) (reinterpret_cast<EFLAGS *>(&ctx->EFlags))