/** * Core type definitions for x64dbg MCP Server */ export interface Session { id: string; pid: number; executable: string; architecture: "x86" | "x64"; state: DebugState; /** D2: non-null iff state === "paused" */ pauseReason: PauseReason | null; /** D2: non-null iff state === "terminated" */ terminationReason: TerminationReason | null; /** D2: timestamp of last state transition (epoch ms) */ terminatedAt?: number; /** D2: most recent debug event of any kind */ lastEvent: DebugEvent | null; /** D2/D4: per-session ring buffer (50 entries, chronological) */ recentEvents: DebugEvent[]; bridgePort: number; createdAt: number; lastActivity: number; breakpoints: Map; modules: ModuleInfo[]; } /** * D2 — coarse session phase. * Narrowed from v1.1.x's 7-value enum to spec's 4 values. * * State transitions: * - "idle" → bridge connected, no debuggee loaded * - "loading" → debug.load / debug.attach in flight * - "running" → debuggee executing * - "paused" → debuggee halted (set by bridge stateChange push) * - "terminated" → session ended; retained 30s then GC'd * * Invariant: "terminated" is a terminal state — applyStateChange must * never overwrite it. Transitions back to "idle" are valid from any * non-terminal state (e.g. debuggee exits, x64dbg stays alive). */ export declare const DEBUG_STATES: readonly ["idle", "loading", "running", "paused", "terminated"]; export type DebugState = (typeof DEBUG_STATES)[number]; /** * D3 — why execution is currently halted. Set when state === "paused". */ export declare const PAUSE_REASONS: readonly ["breakpoint", "step", "exception", "tls_callback", "system_breakpoint", "manual_pause", "trace_terminated", "dll_load_break", "dll_unload_break", "thread_create_break", "thread_exit_break", "output_debug_break", "unknown"]; export type PauseReason = (typeof PAUSE_REASONS)[number]; /** * D3 — why the session ended. Set when state === "terminated". */ export declare const TERMINATION_REASONS: readonly ["process_exit", "detached", "bridge_lost", "unknown"]; export type TerminationReason = (typeof TERMINATION_REASONS)[number]; /** * D3 — kind of every observable x64dbg callback. Goes into the event log * regardless of whether the callback caused a pause. */ export declare const DEBUG_EVENT_KINDS: readonly ["breakpoint", "step", "exception", "tls_callback", "dll_load", "dll_unload", "thread_create", "thread_exit", "process_create", "process_exit", "system_breakpoint", "manual_pause", "output_debug_string", "trace_terminated", "detached"]; export type DebugEventKind = (typeof DEBUG_EVENT_KINDS)[number]; /** * D3 — breakpoint event sub-discriminators. */ export declare const BP_TYPES: readonly ["sw", "hw", "mem", "dll", "exception"]; export type BpType = (typeof BP_TYPES)[number]; export declare const BP_KINDS: readonly ["user", "temporary", "system"]; export type BpKind = (typeof BP_KINDS)[number]; /** * D3 — single entry in the event log. Kind-specific fields are carried in * `details` so the wire payload stays uniform across kinds. */ export interface DebugEvent { kind: DebugEventKind; timestamp: number; address: string | null; threadId: number | null; /** True iff this event caused the session to enter `paused`. */ pausedExecution: boolean; /** Kind-specific fields (bpAddress, exceptionCode, moduleName, etc.). */ details?: Record; } export interface Registers64 { rax: string; rbx: string; rcx: string; rdx: string; rsi: string; rdi: string; rbp: string; rsp: string; rip: string; r8: string; r9: string; r10: string; r11: string; r12: string; r13: string; r14: string; r15: string; rflags: string; } export interface Registers32 { eax: string; ebx: string; ecx: string; edx: string; esi: string; edi: string; ebp: string; esp: string; eip: string; eflags: string; } export type Registers = Registers64 | Registers32; export interface FlagRegister { CF: boolean; PF: boolean; AF: boolean; ZF: boolean; SF: boolean; TF: boolean; IF: boolean; DF: boolean; OF: boolean; } export interface Breakpoint { address: string; type: BreakpointType; enabled: boolean; hitCount: number; condition?: string; logText?: string; name?: string; module?: string; } export type BreakpointType = "software" | "hardware_execute" | "hardware_read" | "hardware_write" | "hardware_access" | "memory_read" | "memory_write" | "memory_access"; export interface Instruction { address: string; bytes: string; mnemonic: string; operands: string; comment?: string; isCall: boolean; isJump: boolean; isRet: boolean; isNop: boolean; refAddress?: string; } export interface DisassemblyBlock { startAddress: string; endAddress: string; instructions: Instruction[]; functionName?: string; } export interface MemoryRegion { baseAddress: string; size: string; protection: string; type: string; module?: string; } export interface MemoryDump { address: string; size: number; hex: string; ascii: string; bytes: number[]; } export interface MemoryMap { regions: MemoryRegion[]; totalMapped: string; } export interface ModuleInfo { name: string; path: string; base: string; size: string; entry: string; sections: SectionInfo[]; imports?: ImportEntry[]; exports?: ExportEntry[]; } export interface SectionInfo { name: string; virtualAddress: string; virtualSize: string; rawSize: string; characteristics: string; entropy?: number; } export interface ImportEntry { module: string; function: string; ordinal?: number; address: string; } export interface ExportEntry { name: string; ordinal: number; address: string; forwarder?: string; } export interface FunctionInfo { address: string; endAddress: string; name: string; size: number; instructionCount: number; callCount: number; isLeaf: boolean; callers: string[]; callees: string[]; } export interface CrossReference { from: string; to: string; type: "call" | "jump" | "data_read" | "data_write" | "unknown"; instruction?: string; module?: string; } export interface StringReference { address: string; value: string; type: "ascii" | "unicode"; length: number; module?: string; referencedBy: string[]; } export interface StackFrame { index: number; address: string; returnAddress: string; module?: string; function?: string; offset?: string; args: string[]; } export interface ThreadInfo { id: number; handle: string; entry: string; teb: string; state: string; priority: string; name?: string; } export interface PackingAnalysis { isPacked: boolean; confidence: number; packerName?: string; indicators: PackingIndicator[]; sectionEntropies: Record; overallEntropy: number; } export interface PackingIndicator { type: string; description: string; severity: "low" | "medium" | "high"; } export interface SuspiciousApiAnalysis { totalImports: number; suspiciousCount: number; categories: Record; riskLevel: "low" | "medium" | "high" | "critical"; summary: string; } export interface SuspiciousApiEntry { function: string; module: string; address: string; category: string; description: string; riskLevel: "low" | "medium" | "high" | "critical"; } export declare const BRIDGE_PROTOCOL_VERSION: "2"; export interface BridgeRequest { id: string; method: string; params: Record; authToken?: string; protocolVersion: typeof BRIDGE_PROTOCOL_VERSION; } export interface BridgeResponse { id: string; success: boolean; data?: unknown; error?: string; } export interface BridgeEvent { event: string; data: Record; sessionId?: string; timestamp: number; } export interface ServerConfig { x64dbgPath: string; bridgeHost: string; bridgePort: number; bridgeAuthToken: string; mcpTransport: "stdio" | "streamable-http"; mcpHttpHost: string; mcpHttpPort: number; logLevel: "error" | "warn" | "info" | "debug"; sessionTimeoutMs: number; maxSessions: number; maxDisasmInstructions: number; maxTraceInstructions: number; maxSearchResults: number; maxStringLength: number; } //# sourceMappingURL=types.d.ts.map