dbgtypedef.h 4.61 KB
Newer Older
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
1 2
#pragma once

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
3 4
#include <string>

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
5 6 7 8 9 10
namespace kdlib {

///////////////////////////////////////////////////////////////////////////////

typedef unsigned long           PROCESS_ID;
typedef unsigned long           PROCESS_DEBUG_ID;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
11
typedef unsigned long           THREAD_ID;
12
typedef unsigned long           THREAD_DEBUG_ID;
SND\ussrhero_cp's avatar
SND\ussrhero_cp committed
13
typedef unsigned long           SYSTEM_DEBUG_ID;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
14
typedef unsigned long           BREAKPOINT_ID;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
15 16
typedef unsigned long long      MEMOFFSET_64;
typedef unsigned long           MEMOFFSET_32;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
17
typedef long                    MEMOFFSET_REL;
18
typedef long                    MEMDISPLACEMENT;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
19
typedef unsigned long           BITOFFSET;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
20
typedef unsigned long           ACCESS_TYPE;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
21
typedef unsigned long long      EXTENSION_ID;
22
typedef unsigned long           RELREG_ID;
23
typedef unsigned long long      SYMBOL_ID;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
24

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
25 26 27 28 29 30 31 32
enum DebugCallbackResult {
    DebugCallbackProceed = 0,
    DebugCallbackNoChange = 1,
    DebugCallbackBreak = 2,
    DebugCallbackMax = 3
};

enum ExecutionStatus {
33 34 35 36
    DebugStatusNoChange,
    DebugStatusGo,
    DebugStatusBreak,
    DebugStatusNoDebuggee
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
37 38
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
39 40 41 42 43 44 45

enum BreakpointType {

    SoftwareBreakpoint,
    DataAccessBreakpoint
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
46 47 48 49 50 51
enum CPUType {
    CPU_I386 = 0,
    CPU_AMD64 = 1,
    CPU_MAX = 2
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
52 53 54 55 56 57 58 59 60 61 62 63 64
enum CPURegType {
    RegInt8,
    RegInt16,
    RegInt32,
    RegInt64,
    RegFloat32,
    RegFloat64,
    RegFloat80,
    RegFloat128,
    RegVector64,
    RegVector128
};

65 66

enum EventType {
SND\ussrhero_cp's avatar
 
SND\ussrhero_cp committed
67
    EventTypeNoEvent,
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    EventTypeBreakpoint,
    EventTypeException,
    EventTypeCreateThread,
    EventTypeExitThread,
    EventTypeCreateProcess,
    EventTypeExitProcess,
    EventTypeLoadModule,
    EventTypeUnloadModule,
    EventTypeSystemError,
    EventTypeSessionStatus,
    EventTypeChangeDebuggeeState,
    EventTypeChangeEngineState,
    EventTypeChangeSymbolState
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
83 84 85
struct SystemInfo {
    unsigned long  majorVersion;
    unsigned long  minorVersion;
86
    unsigned long  servicePackNumber;
SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
87 88 89 90
    unsigned long  buildNumber;
    std::wstring  buildDescription;
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
91 92 93 94 95 96
struct SystemCrashInfo {
    unsigned long long  code;
    unsigned long paramterCount;
    unsigned long long parameters[0x10];
};

97 98 99 100 101 102
struct ExceptionInfo {
    bool  firstChance;
    unsigned long  exceptionCode;
    unsigned long  exceptionFlags;
    MEMOFFSET_64  exceptionRecord;
    MEMOFFSET_64  exceptionAddress;
103 104
    PROCESS_DEBUG_ID  process;
    THREAD_DEBUG_ID  thread;
105 106 107 108
    unsigned long parameterCount;
    unsigned long long parameters[0x10];
};

109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
struct FixedFileInfo {
    unsigned long Signature;
    unsigned long StrucVersion;
    unsigned long FileVersionMS;
    unsigned long FileVersionLS;
    unsigned long ProductVersionMS;
    unsigned long ProductVersionLS;
    unsigned long FileFlagsMask;
    unsigned long FileFlags;
    unsigned long FileOS;
    unsigned long FileType;
    unsigned long FileSubtype;
    unsigned long FileDateMS;
    unsigned long FileDateLS;
};

enum FileFlag {
    FileFlagDebug           = 0x00000001,
    FileFlagPreRelease      = 0x00000002,
    FileFlagPatched         = 0x00000004,
    FileFlagPrivateBuild    = 0x00000008,
    FileFlagInfoInferred    = 0x00000010,
    FileFlagSpecialBuild    = 0x00000020,
};

134 135 136 137 138 139 140 141 142 143 144 145
enum MemoryProtect {

    PageNoAccess            = 0x00000001,
    PageReadOnly            = 0x00000002,
    PageReadWrite           = 0x00000004,
    PageWriteCopy           = 0x00000008,
    PageExecute             = 0x00000010,
    PageExecuteRead         = 0x00000020,
    PageExecuteReadWrite    = 0x00000040,
    PageExecuteWriteCopy    = 0x00000080
};

146 147 148 149 150 151 152

enum ProcessExitReason {
    ProcessExit,
    ProcessTerminate,
    ProcessDetach
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
153 154 155 156 157 158 159 160 161 162 163 164
enum ProcessDebugOptions {
    ProcessBreakOnStart    = 0x00000001,
    ProcessBreakOnStop     = 0x00000002,
    ProcessDebugChildren   = 0x00000004,
    ProcessNoDebugHeap     = 0x00000008,

    ProcessDebugDefault = ProcessBreakOnStart
};

typedef unsigned long  ProcessDebugFlags;


165
struct FrameDesc {
166
    MEMOFFSET_64            instructionOffset;
167 168 169 170 171
    MEMOFFSET_64            returnOffset;
    MEMOFFSET_64            frameOffset;
    MEMOFFSET_64            stackOffset; 
};

172 173 174 175 176
struct SyntheticSymbol {
    MEMOFFSET_64    moduleBase;
    SYMBOL_ID       symbolId;
};

177
enum VarStorage {
SND\ussrhero_cp's avatar
SND\ussrhero_cp committed
178
    UnknownVar,
179 180 181 182
    MemoryVar,
    RegisterVar
};

183 184 185

struct LiveProcessInfo {
    PROCESS_ID  pid;
186
    PROCESS_ID  parentPid;
187 188 189 190 191
    std::wstring  name;
    std::wstring  user;
    std::wstring  commandLine;
};

SND\kernelnet_cp's avatar
SND\kernelnet_cp committed
192 193 194 195 196
///////////////////////////////////////////////////////////////////////////////

} // kdlib namespace end