Package winappdbg :: Package win32 :: Module defines
[hide private]
[frames] | no frames]

Module defines

source code

Common definitions.

Classes [hide private]
  WinDllHook
  WinFuncHook
  WinCallHook
  GuessStringType
Decorator that guesses the correct version (A or W) to call based on the types of the strings passed as parameters.
  DefaultStringType
Decorator that uses the default version (A or W) to call based on the configuration of the GuessStringType decorator.
  PSIZE_T
  PPVOID
  LPBYTE
  LPSBYTE
  LPWORD
  LPSWORD
  LPDWORD
  LPSDWORD
  LPULONG
  LPLONG
  PDWORD
  PDWORD_PTR
  PULONG
  PLONG
  PBOOL
  LPBOOL
  LPDWORD32
  LPULONG32
  LPDWORD64
  LPULONG64
  PDWORD32
  PULONG32
  PDWORD64
  PULONG64
  PHANDLE
  LPHANDLE
  PHKEY
  PNTSTATUS
  PACCESS_MASK
  PREGSAM
  FLOAT128
  PFLOAT128
  M128A
  PM128A
  UNICODE_STRING
  GUID
  LIST_ENTRY
Functions [hide private]
 
RaiseIfZero(result, func=None, arguments=())
Error checking for most Win32 API calls.
source code
 
RaiseIfNotZero(result, func=None, arguments=())
Error checking for some odd Win32 API calls.
source code
 
RaiseIfNotErrorSuccess(result, func=None, arguments=())
Error checking for Win32 Registry API calls.
source code
 
MakeANSIVersion(fn)
Decorator that generates an ANSI version of a Unicode (wide) only API call.
source code
 
MakeWideVersion(fn)
Decorator that generates a Unicode (wide) version of an ANSI only API call.
source code
Variables [hide private]
  __revision__ = '$Id: defines.py 1299 2013-12-20 09:30:55Z qvas...
  WIN32_VERBOSE_MODE = False
  windll = WinDllHook()
  NULL = None
hash(x)
  INFINITE = -1
  TRUE = 1
  FALSE = 0
  ANYSIZE_ARRAY = 1
  INVALID_HANDLE_VALUE = 4294967295
  MAX_MODULE_NAME32 = 255
  MAX_PATH = 260
  ERROR_SUCCESS = 0
  ERROR_INVALID_FUNCTION = 1
  ERROR_FILE_NOT_FOUND = 2
  ERROR_PATH_NOT_FOUND = 3
  ERROR_ACCESS_DENIED = 5
  ERROR_INVALID_HANDLE = 6
  ERROR_NOT_ENOUGH_MEMORY = 8
  ERROR_INVALID_DRIVE = 15
  ERROR_NO_MORE_FILES = 18
  ERROR_BAD_LENGTH = 24
  ERROR_HANDLE_EOF = 38
  ERROR_HANDLE_DISK_FULL = 39
  ERROR_NOT_SUPPORTED = 50
  ERROR_FILE_EXISTS = 80
  ERROR_INVALID_PARAMETER = 87
  ERROR_BUFFER_OVERFLOW = 111
  ERROR_DISK_FULL = 112
  ERROR_CALL_NOT_IMPLEMENTED = 120
  ERROR_SEM_TIMEOUT = 121
  ERROR_INSUFFICIENT_BUFFER = 122
  ERROR_INVALID_NAME = 123
  ERROR_MOD_NOT_FOUND = 126
  ERROR_PROC_NOT_FOUND = 127
  ERROR_DIR_NOT_EMPTY = 145
  ERROR_BAD_THREADID_ADDR = 159
  ERROR_BAD_ARGUMENTS = 160
  ERROR_BAD_PATHNAME = 161
  ERROR_ALREADY_EXISTS = 183
  ERROR_INVALID_FLAG_NUMBER = 186
  ERROR_ENVVAR_NOT_FOUND = 203
  ERROR_FILENAME_EXCED_RANGE = 206
  ERROR_MORE_DATA = 234
  WAIT_TIMEOUT = 258
  ERROR_NO_MORE_ITEMS = 259
  ERROR_PARTIAL_COPY = 299
  ERROR_INVALID_ADDRESS = 487
  ERROR_THREAD_NOT_IN_PROCESS = 566
  ERROR_CONTROL_C_EXIT = 572
  ERROR_UNHANDLED_EXCEPTION = 574
  ERROR_ASSERTION_FAILURE = 668
  ERROR_WOW_ASSERTION = 670
  ERROR_DBG_EXCEPTION_NOT_HANDLED = 688
  ERROR_DBG_REPLY_LATER = 689
  ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE = 690
  ERROR_DBG_TERMINATE_THREAD = 691
  ERROR_DBG_TERMINATE_PROCESS = 692
  ERROR_DBG_CONTROL_C = 693
  ERROR_DBG_PRINTEXCEPTION_C = 694
  ERROR_DBG_RIPEXCEPTION = 695
  ERROR_DBG_CONTROL_BREAK = 696
  ERROR_DBG_COMMAND_EXCEPTION = 697
  ERROR_DBG_EXCEPTION_HANDLED = 766
  ERROR_DBG_CONTINUE = 767
  ERROR_ELEVATION_REQUIRED = 740
  ERROR_NOACCESS = 998
  ERROR_CIRCULAR_DEPENDENCY = 1059
  ERROR_SERVICE_DOES_NOT_EXIST = 1060
  ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
  ERROR_SERVICE_NOT_ACTIVE = 1062
  ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063
  ERROR_EXCEPTION_IN_SERVICE = 1064
  ERROR_DATABASE_DOES_NOT_EXIST = 1065
  ERROR_SERVICE_SPECIFIC_ERROR = 1066
  ERROR_PROCESS_ABORTED = 1067
  ERROR_SERVICE_DEPENDENCY_FAIL = 1068
  ERROR_SERVICE_LOGON_FAILED = 1069
  ERROR_SERVICE_START_HANG = 1070
  ERROR_INVALID_SERVICE_LOCK = 1071
  ERROR_SERVICE_MARKED_FOR_DELETE = 1072
  ERROR_SERVICE_EXISTS = 1073
  ERROR_ALREADY_RUNNING_LKG = 1074
  ERROR_SERVICE_DEPENDENCY_DELETED = 1075
  ERROR_BOOT_ALREADY_ACCEPTED = 1076
  ERROR_SERVICE_NEVER_STARTED = 1077
  ERROR_DUPLICATE_SERVICE_NAME = 1078
  ERROR_DIFFERENT_SERVICE_ACCOUNT = 1079
  ERROR_CANNOT_DETECT_DRIVER_FAILURE = 1080
  ERROR_CANNOT_DETECT_PROCESS_ABORT = 1081
  ERROR_NO_RECOVERY_PROGRAM = 1082
  ERROR_SERVICE_NOT_IN_EXE = 1083
  ERROR_NOT_SAFEBOOT_SERVICE = 1084
  ERROR_DEBUGGER_INACTIVE = 1284
  ERROR_PRIVILEGE_NOT_HELD = 1314
  ERROR_NONE_MAPPED = 1332
  RPC_S_SERVER_UNAVAILABLE = 1722
  DELETE = 65536
  READ_CONTROL = 131072
  WRITE_DAC = 262144
  WRITE_OWNER = 524288
  SYNCHRONIZE = 1048576
  STANDARD_RIGHTS_REQUIRED = 983040
  STANDARD_RIGHTS_READ = 131072
  STANDARD_RIGHTS_WRITE = 131072
  STANDARD_RIGHTS_EXECUTE = 131072
  STANDARD_RIGHTS_ALL = 2031616
  SPECIFIC_RIGHTS_ALL = 65535
  _all = set(['ACCESS_MASK', 'ANYSIZE_ARRAY', 'ATOM', 'BOOL', 'B...
  __package__ = 'winappdbg.win32'
Function Details [hide private]

RaiseIfZero(result, func=None, arguments=())

source code 

Error checking for most Win32 API calls.

The function is assumed to return an integer, which is 0 on error. In that case the WindowsError exception is raised.

RaiseIfNotZero(result, func=None, arguments=())

source code 

Error checking for some odd Win32 API calls.

The function is assumed to return an integer, which is zero on success. If the return value is nonzero the WindowsError exception is raised.

This is mostly useful for free() like functions, where the return value is the pointer to the memory block on failure or a NULL pointer on success.

RaiseIfNotErrorSuccess(result, func=None, arguments=())

source code 

Error checking for Win32 Registry API calls.

The function is assumed to return a Win32 error code. If the code is not ERROR_SUCCESS then a WindowsError exception is raised.

MakeANSIVersion(fn)

source code 

Decorator that generates an ANSI version of a Unicode (wide) only API call.

Parameters:
  • fn (callable) - Unicode (wide) version of the API function to call.

MakeWideVersion(fn)

source code 

Decorator that generates a Unicode (wide) version of an ANSI only API call.

Parameters:
  • fn (callable) - ANSI version of the API function to call.

Variables Details [hide private]

__revision__

Value:
'$Id: defines.py 1299 2013-12-20 09:30:55Z qvasimodo $'

_all

Value:
set(['ACCESS_MASK',
     'ANYSIZE_ARRAY',
     'ATOM',
     'BOOL',
     'BOOLEAN',
     'BYTE',
     'CCHAR',
     'CHAR',
...