hapstone- Capstone bindings for Haskell

Copyright(c) Inokentiy Babushkin, 2016
MaintainerInokentiy Babushkin <inokentiy.babushkin@googlemail.com>
Safe HaskellNone



This module contains various utility functions used to perform common actions when sanitizing data passed to and from the C functions exposed by capstone.



peekNum :: (Integral a, Num b, Storable a) => Ptr a -> IO b Source #

peeking with number conversion

getCULongFromEnum :: Enum e => e -> CULong Source #

number conversion and enum casting

withCast :: Storable a => a -> (Ptr b -> IO c) -> IO c Source #

cast a pointer before using with

combine :: (Enum e, Num n, Bits n) => [e] -> n Source #

bitwise OR a list of symbolic constants from an enumeration

stringLookup :: CString -> Maybe String Source #

lookup a possibly NULL-valued char *

fromZero :: (Eq a, Num a) => a -> Maybe a Source #

convert between Maybe and zero/nonzero Num

peekFunMaybe :: Storable a => (Ptr a -> IO a) -> Ptr a -> IO (Maybe a) Source #

peek if given pointer is not NULL