30#define FASTCALL __fastcall
33#define FAST486_CHAR_MIN (-128)
34#define FAST486_CHAR_MAX (127)
35#define FAST486_SHORT_MIN (-32768L)
36#define FAST486_SHORT_MAX (32767L)
37#define FAST486_LONG_MIN (-2147483648LL)
38#define FAST486_LONG_MAX (2147483647LL)
40#define FAST486_NUM_GEN_REGS 8
41#define FAST486_NUM_SEG_REGS 6
42#define FAST486_NUM_CTRL_REGS 3
43#define FAST486_NUM_DBG_REGS 6
44#define FAST486_NUM_FPU_REGS 8
46#define FAST486_CR0_PE (1 << 0)
47#define FAST486_CR0_MP (1 << 1)
48#define FAST486_CR0_EM (1 << 2)
49#define FAST486_CR0_TS (1 << 3)
50#define FAST486_CR0_ET (1 << 4)
51#define FAST486_CR0_NE (1 << 5)
52#define FAST486_CR0_WP (1 << 16)
53#define FAST486_CR0_AM (1 << 18)
54#define FAST486_CR0_NW (1 << 29)
55#define FAST486_CR0_CD (1 << 30)
56#define FAST486_CR0_PG (1 << 31)
58#define FAST486_DR4_B0 (1 << 0)
59#define FAST486_DR4_B1 (1 << 1)
60#define FAST486_DR4_B2 (1 << 2)
61#define FAST486_DR4_B3 (1 << 3)
62#define FAST486_DR4_BD (1 << 13)
63#define FAST486_DR4_BS (1 << 14)
64#define FAST486_DR4_BT (1 << 15)
66#define FAST486_DR5_L0 (1 << 0)
67#define FAST486_DR5_G0 (1 << 1)
68#define FAST486_DR5_L1 (1 << 2)
69#define FAST486_DR5_G1 (1 << 3)
70#define FAST486_DR5_L2 (1 << 4)
71#define FAST486_DR5_G2 (1 << 5)
72#define FAST486_DR5_L3 (1 << 6)
73#define FAST486_DR5_G3 (1 << 7)
74#define FAST486_DR5_LE (1 << 8)
75#define FAST486_DR5_GE (1 << 9)
76#define FAST486_DR5_GD (1 << 13)
78#define FAST486_DBG_BREAK_EXEC 0
79#define FAST486_DBG_BREAK_WRITE 1
80#define FAST486_DBG_BREAK_READWRITE 3
82#define FAST486_DR4_RESERVED 0xFFFF1FF0
83#define FAST486_DR5_RESERVED 0x0000DC00
85#define FAST486_TSS_16_SIGNATURE 0x01
86#define FAST486_LDT_SIGNATURE 0x02
87#define FAST486_BUSY_TSS_16_SIGNATURE 0x03
88#define FAST486_CALL_GATE_16_SIGNATURE 0x04
89#define FAST486_TASK_GATE_SIGNATURE 0x05
90#define FAST486_IDT_INT_GATE 0x06
91#define FAST486_IDT_TRAP_GATE 0x07
92#define FAST486_TSS_SIGNATURE 0x09
93#define FAST486_BUSY_TSS_SIGNATURE 0x0B
94#define FAST486_CALL_GATE_SIGNATURE 0x0C
95#define FAST486_IDT_INT_GATE_32 0x0E
96#define FAST486_IDT_TRAP_GATE_32 0x0F
98#define FAST486_PREFIX_SEG (1 << 0)
99#define FAST486_PREFIX_OPSIZE (1 << 1)
100#define FAST486_PREFIX_ADSIZE (1 << 2)
101#define FAST486_PREFIX_LOCK (1 << 3)
102#define FAST486_PREFIX_REPNZ (1 << 4)
103#define FAST486_PREFIX_REP (1 << 5)
105#define FAST486_FPU_DEFAULT_CONTROL 0x037F
107#define FAST486_PAGE_SIZE 4096
108#define FAST486_CACHE_SIZE 32
119struct _FAST486_STATE;
120typedef struct _FAST486_STATE FAST486_STATE, *PFAST486_STATE;
122typedef enum _FAST486_GEN_REGS
132} FAST486_GEN_REGS, *PFAST486_GEN_REGS;
134typedef enum _FAST486_SEG_REGS
142} FAST486_SEG_REGS, *PFAST486_SEG_REGS;
144typedef enum _FAST486_CTRL_REGS
149} FAST486_CTRL_REGS, *PFAST486_CTRL_REGS;
151typedef enum _FAST486_DBG_REGS
161} FAST486_DBG_REGS, *PFAST486_DBG_REGS;
163typedef enum _FAST486_EXCEPTIONS
165 FAST486_EXCEPTION_DE = 0x00,
166 FAST486_EXCEPTION_DB = 0x01,
167 FAST486_EXCEPTION_BP = 0x03,
168 FAST486_EXCEPTION_OF = 0x04,
169 FAST486_EXCEPTION_BR = 0x05,
170 FAST486_EXCEPTION_UD = 0x06,
171 FAST486_EXCEPTION_NM = 0x07,
172 FAST486_EXCEPTION_DF = 0x08,
173 FAST486_EXCEPTION_TS = 0x0A,
174 FAST486_EXCEPTION_NP = 0x0B,
175 FAST486_EXCEPTION_SS = 0x0C,
176 FAST486_EXCEPTION_GP = 0x0D,
177 FAST486_EXCEPTION_PF = 0x0E,
178 FAST486_EXCEPTION_MF = 0x10,
179 FAST486_EXCEPTION_AC = 0x11,
180 FAST486_EXCEPTION_MC = 0x12
181} FAST486_EXCEPTIONS, *PFAST486_EXCEPTIONS;
187 PFAST486_STATE
State,
197 PFAST486_STATE
State,
207 PFAST486_STATE
State,
218 PFAST486_STATE
State,
229 PFAST486_STATE
State,
247typedef union _FAST486_REG
259} FAST486_REG, *PFAST486_REG;
261typedef struct _FAST486_SEG_REG
269 ULONG Executable : 1;
270 ULONG SystemType : 1;
277} FAST486_SEG_REG, *PFAST486_SEG_REG;
279typedef struct _FAST486_LDT_REG
284} FAST486_LDT_REG, *PFAST486_LDT_REG;
286typedef struct _FAST486_TASK_REG
292} FAST486_TASK_REG, *PFAST486_TASK_REG;
304 ULONG Executable : 1;
305 ULONG SystemType : 1;
312 ULONG Granularity : 1;
314} FAST486_GDT_ENTRY, *PFAST486_GDT_ENTRY;
330 ULONG Granularity : 1;
332} FAST486_SYSTEM_DESCRIPTOR, *PFAST486_SYSTEM_DESCRIPTOR;
341 ULONG ParamCount : 5;
344 ULONG SystemType : 1;
347 ULONG OffsetHigh : 16;
348} FAST486_CALL_GATE, *PFAST486_CALL_GATE;
362 ULONG OffsetHigh : 16;
363} FAST486_IDT_ENTRY, *PFAST486_IDT_ENTRY;
368typedef struct _FAST486_TSS
396} FAST486_TSS, *PFAST486_TSS;
398typedef struct _FAST486_LEGACY_TSS
422} FAST486_LEGACY_TSS, *PFAST486_LEGACY_TSS;
426typedef struct _FAST486_TABLE_REG
430} FAST486_TABLE_REG, *PFAST486_TABLE_REG;
432typedef union _FAST486_FLAGS_REG
460} FAST486_FLAGS_REG, *PFAST486_FLAGS_REG;
462typedef struct _FAST486_FPU_DATA_REG
467} FAST486_FPU_DATA_REG, *PFAST486_FPU_DATA_REG;
469typedef const FAST486_FPU_DATA_REG *PCFAST486_FPU_DATA_REG;
471typedef union _FAST486_FPU_STATUS_REG
492} FAST486_FPU_STATUS_REG, *PFAST486_FPU_STATUS_REG;
494typedef union _FAST486_FPU_CONTROL_REG
512} FAST486_FPU_CONTROL_REG, *PFAST486_FPU_CONTROL_REG;
516 FAST486_MEM_READ_PROC MemReadCallback;
517 FAST486_MEM_WRITE_PROC MemWriteCallback;
518 FAST486_IO_READ_PROC IoReadCallback;
519 FAST486_IO_WRITE_PROC IoWriteCallback;
520 FAST486_BOP_PROC BopCallback;
521 FAST486_INT_ACK_PROC IntAckCallback;
522 FAST486_FPU_PROC FpuCallback;
525 FAST486_REG InstPtr, SavedInstPtr;
526 FAST486_REG SavedStackPtr;
527 FAST486_FLAGS_REG
Flags;
528 FAST486_TABLE_REG Gdtr, Idtr;
529 FAST486_LDT_REG Ldtr;
530 FAST486_TASK_REG TaskReg;
534 ULONG ExceptionCount;
536 FAST486_SEG_REGS SegmentOverride;
542#ifndef FAST486_NO_PREFETCH
544 ULONG PrefetchAddress;
547#ifndef FAST486_NO_FPU
549 FAST486_FPU_STATUS_REG FpuStatus;
550 FAST486_FPU_CONTROL_REG FpuControl;
552 FAST486_REG FpuLastInstPtr;
554 FAST486_REG FpuLastOpPtr;
564 FAST486_MEM_READ_PROC MemReadCallback,
565 FAST486_MEM_WRITE_PROC MemWriteCallback,
566 FAST486_IO_READ_PROC IoReadCallback,
567 FAST486_IO_WRITE_PROC IoWriteCallback,
568 FAST486_BOP_PROC BopCallback,
569 FAST486_INT_ACK_PROC IntAckCallback,
570 FAST486_FPU_PROC FpuCallback,
613 PFAST486_STATE
State,
static const WCHAR Signature[]
VOID NTAPI Fast486SetStack(PFAST486_STATE State, USHORT Segment, ULONG Offset)
VOID NTAPI Fast486InterruptSignal(PFAST486_STATE State)
VOID NTAPI Fast486Rewind(PFAST486_STATE State)
VOID NTAPI Fast486Initialize(PFAST486_STATE State, FAST486_MEM_READ_PROC MemReadCallback, FAST486_MEM_WRITE_PROC MemWriteCallback, FAST486_IO_READ_PROC IoReadCallback, FAST486_IO_WRITE_PROC IoWriteCallback, FAST486_BOP_PROC BopCallback, FAST486_INT_ACK_PROC IntAckCallback, FAST486_FPU_PROC FpuCallback, PULONG Tlb)
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
VOID NTAPI Fast486Reset(PFAST486_STATE State)
VOID NTAPI Fast486ExecuteAt(PFAST486_STATE State, USHORT Segment, ULONG Offset)
#define FAST486_NUM_FPU_REGS
#define FAST486_NUM_CTRL_REGS
#define FAST486_NUM_GEN_REGS
#define FAST486_CACHE_SIZE
#define FAST486_NUM_SEG_REGS
#define FAST486_PAGE_SIZE
#define FAST486_NUM_DBG_REGS
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_In_ ULONG _In_ ULONG Offset
DRIVER_DISPATCH ReadWrite
VOID NTAPI Fast486StepOut(PFAST486_STATE State)
VOID NTAPI Fast486DumpState(PFAST486_STATE State)
VOID NTAPI Fast486StepInto(PFAST486_STATE State)
VOID NTAPI Fast486Continue(PFAST486_STATE State)
VOID NTAPI Fast486StepOver(PFAST486_STATE State)
static int Link(const char **args)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_Reserved_ PVOID Reserved
_Must_inspect_result_ _In_ ULONG Flags
_In_ LONG _In_ LONG Limit