System.Win32.DebugApi

Win32-2.3.1.1: A binding to part of the Win32 library

Copyright | (c) Esa Ilari Vuokko 2006
License | BSD-style (see the file LICENSE)
Maintainer | Esa Ilari Vuokko <ei@vuokko.info>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

System.Win32.DebugApi

Description

A collection of FFI declarations for using Windows DebugApi.

# Documentation

type PID = DWORD Source #

type TID = DWORD Source #

type DebugEventId = (PID, TID) Source #

type ForeignAddress = Word32 Source #

type PHANDLE = Ptr () Source #

type THANDLE = Ptr () Source #

type ThreadInfo = (THANDLE, ForeignAddress, ForeignAddress) Source #

type ImageInfo = (HANDLE, ForeignAddress, DWORD, DWORD, ForeignAddress) Source #

type ExceptionInfo = (Bool, Bool, ForeignAddress) Source #

data Exception Source #

Constructors

UnknownException |
AccessViolation Bool ForeignAddress |
ArrayBoundsExceeded |
Breakpoint |
DataTypeMisalignment |
FltDenormalOperand |
FltDivideByZero |
FltInexactResult |
FltInvalidOperation |
FltOverflow |
FltStackCheck |
FltUnderflow |
IllegalInstruction |
InPageError |
IntDivideByZero |
IntOverflow |
InvalidDisposition |
NonContinuable |
PrivilegedInstruction |
SingleStep |
StackOverflow |

Instances

Show Exception # |
Methods showsPrec :: Int -> Exception -> ShowS Source # show :: Exception -> String Source # showList :: [Exception] -> ShowS Source #

data DebugEventInfo Source #

Constructors

UnknownDebugEvent |
Exception ExceptionInfo Exception |
CreateThread ThreadInfo |
CreateProcess PHANDLE ImageInfo ThreadInfo |
ExitThread TID |
ExitProcess PID |
LoadDll ImageInfo |
UnloadDll TID |
DebugString ForeignAddress Bool WORD |

Instances

Show DebugEventInfo # |
Methods showsPrec :: Int -> DebugEventInfo -> ShowS Source # show :: DebugEventInfo -> String Source # showList :: [DebugEventInfo] -> ShowS Source #

type DebugEvent = (DebugEventId, DebugEventInfo) Source #

peekDebugEvent :: Ptr a -> IO DebugEvent Source #

waitForDebugEvent :: Maybe Int -> IO (Maybe DebugEvent) Source #

getDebugEvents :: Int -> IO [DebugEvent] Source #

continueDebugEvent :: DebugEventId -> Bool -> IO () Source #

debugActiveProcess :: PID -> IO () Source #

peekProcessMemory :: PHANDLE -> ForeignAddress -> Int -> Ptr a -> IO () Source #

readProcessMemory :: PHANDLE -> ForeignAddress -> Int -> IO (ForeignPtr a) Source #

pokeProcessMemory :: PHANDLE -> ForeignAddress -> Int -> Ptr a -> IO () Source #

withProcessMemory :: PHANDLE -> ForeignAddress -> Int -> (Ptr a -> IO b) -> IO b Source #

peekP :: Storable a => PHANDLE -> ForeignAddress -> IO a Source #

pokeP :: Storable a => PHANDLE -> ForeignAddress -> a -> IO () Source #

suspendThread :: THANDLE -> IO DWORD Source #

resumeThread :: THANDLE -> IO DWORD Source #

withSuspendedThread :: THANDLE -> IO a -> IO a Source #

getThreadContext :: THANDLE -> Ptr a -> IO () Source #

setThreadContext :: THANDLE -> Ptr a -> IO () Source #

useAllRegs :: Ptr a -> IO () Source #

withThreadContext :: THANDLE -> (Ptr a -> IO b) -> IO b Source #

rax :: Int Source #

rbx :: Int Source #

rcx :: Int Source #

rdx :: Int Source #

rsi :: Int Source #

rdi :: Int Source #

rbp :: Int Source #

rip :: Int Source #

rsp :: Int Source #

segCs :: Int Source #

segDs :: Int Source #

segEs :: Int Source #

segFs :: Int Source #

segGs :: Int Source #

eFlags :: Int Source #

dr :: Int -> Int Source #

setReg :: Ptr a -> Int -> DWORD -> IO () Source #

getReg :: Ptr a -> Int -> IO DWORD Source #

modReg :: Ptr a -> Int -> (DWORD -> DWORD) -> IO DWORD Source #

makeModThreadContext :: [(Int, DWORD -> DWORD)] -> Ptr a -> IO [DWORD] Source #

modifyThreadContext :: THANDLE -> [(Int, DWORD -> DWORD)] -> IO [DWORD] Source #

outputDebugString :: String -> IO () Source #

c_SuspendThread :: THANDLE -> IO DWORD Source #

c_ResumeThread :: THANDLE -> IO DWORD Source #

c_WaitForDebugEvent :: Ptr () -> DWORD -> IO BOOL Source #

c_ContinueDebugEvent :: DWORD -> DWORD -> DWORD -> IO BOOL Source #

c_DebugActiveProcess :: DWORD -> IO Bool Source #

c_ReadProcessMemory :: PHANDLE -> Ptr () -> Ptr Word8 -> DWORD -> Ptr DWORD -> IO BOOL Source #

c_WriteProcessMemory :: PHANDLE -> Ptr () -> Ptr Word8 -> DWORD -> Ptr DWORD -> IO BOOL Source #

c_GetThreadContext :: THANDLE -> Ptr () -> IO BOOL Source #

c_SetThreadContext :: THANDLE -> Ptr () -> IO BOOL Source #

c_OutputDebugString :: LPTSTR -> IO () Source #

isDebuggerPresent :: IO BOOL Source #

debugBreak :: IO () Source #