Skip to content

Instantly share code, notes, and snippets.

@mrexodia
Created September 25, 2016 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrexodia/f31ebe5ae37f8f2dcb95a76b6126cd64 to your computer and use it in GitHub Desktop.
Save mrexodia/f31ebe5ae37f8f2dcb95a76b6126cd64 to your computer and use it in GitHub Desktop.
typedef struct DECLSPEC_ALIGN(16) _XSAVE_FORMAT {
WORD ControlWord;
WORD StatusWord;
BYTE TagWord;
BYTE Reserved1;
WORD ErrorOpcode;
DWORD ErrorOffset;
WORD ErrorSelector;
WORD Reserved2;
DWORD DataOffset;
WORD DataSelector;
WORD Reserved3;
DWORD MxCsr;
DWORD MxCsr_Mask;
M128A FloatRegisters[8];
#if defined(_WIN64)
M128A XmmRegisters[16];
BYTE Reserved4[96];
#else
M128A XmmRegisters[8];
BYTE Reserved4[192];
//
// The fields below are not part of XSAVE/XRSTOR format.
// They are written by the OS which is relying on a fact that
// neither (FX)SAVE nor (F)XSTOR used this area.
//
DWORD StackControl[7]; // KERNEL_STACK_CONTROL structure actualy
DWORD Cr0NpxState;
#endif
} XSAVE_FORMAT, *PXSAVE_FORMAT;
typedef struct _FLOATING_SAVE_AREA {
DWORD ControlWord;
DWORD StatusWord;
DWORD TagWord;
DWORD ErrorOffset;
DWORD ErrorSelector;
DWORD DataOffset;
DWORD DataSelector;
BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
DWORD Cr0NpxState;
} FLOATING_SAVE_AREA;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment