winappdbg.win32.defines

Common definitions.

class winappdbg.win32.defines.DefaultStringType(fn_ansi, fn_unicode)

Decorator that uses the default version (A or W) to call based on the configuration of the GuessStringType decorator.

Variables:
  • fn_ansi – ANSI version of the API function to call.

  • fn_unicode – Unicode (wide) version of the API function to call.

class winappdbg.win32.defines.FLOAT128
class winappdbg.win32.defines.GUID
class winappdbg.win32.defines.GuessStringType(fn_ansi, fn_unicode)

Decorator that guesses the correct version (A or W) to call based on the types of the strings passed as parameters.

Calls the ANSI version if the only string types are ANSI.

Calls the Unicode version if Unicode string types are passed.

Raises an exception if mixed types are passed.

The default if no string arguments are passed depends on the value of the t_default class variable.

Variables:
  • fn_ansi – ANSI version of the API function to call.

  • fn_unicode – Unicode (wide) version of the API function to call.

  • t_default

    Default string type to use. Possible values are:

    • type(‘’) for ANSI

    • type(u’’) for Unicode

t_ansi

alias of bytes

t_default

alias of str

t_unicode

alias of str

class winappdbg.win32.defines.LIST_ENTRY
winappdbg.win32.defines.LPBOOL

alias of LP_c_int

winappdbg.win32.defines.LPBYTE

alias of LP_c_ubyte

winappdbg.win32.defines.LPDWORD

alias of LP_c_uint

winappdbg.win32.defines.LPDWORD32

alias of LP_c_uint

winappdbg.win32.defines.LPDWORD64

alias of LP_c_ulong

winappdbg.win32.defines.LPHANDLE

alias of LP_c_void_p

winappdbg.win32.defines.LPLONG

alias of LP_c_int

winappdbg.win32.defines.LPSBYTE

alias of LP_c_byte

winappdbg.win32.defines.LPSDWORD

alias of LP_c_int

winappdbg.win32.defines.LPSWORD

alias of LP_c_short

winappdbg.win32.defines.LPULONG

alias of LP_c_uint

winappdbg.win32.defines.LPULONG32

alias of LP_c_uint

winappdbg.win32.defines.LPULONG64

alias of LP_c_ulong

winappdbg.win32.defines.LPWORD

alias of LP_c_ushort

class winappdbg.win32.defines.M128A
winappdbg.win32.defines.MakeANSIVersion(fn)

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.

winappdbg.win32.defines.MakeWideVersion(fn)

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

Parameters:

fn (callable) – ANSI version of the API function to call.

winappdbg.win32.defines.PACCESS_MASK

alias of LP_c_uint

winappdbg.win32.defines.PBOOL

alias of LP_c_int

winappdbg.win32.defines.PDWORD

alias of LP_c_uint

winappdbg.win32.defines.PDWORD32

alias of LP_c_uint

winappdbg.win32.defines.PDWORD64

alias of LP_c_ulong

winappdbg.win32.defines.PDWORD_PTR

alias of LP_c_ulong

winappdbg.win32.defines.PFLOAT128

alias of LP_FLOAT128

winappdbg.win32.defines.PHANDLE

alias of LP_c_void_p

winappdbg.win32.defines.PHKEY

alias of LP_c_void_p

winappdbg.win32.defines.PLONG

alias of LP_c_int

winappdbg.win32.defines.PM128A

alias of LP_M128A

winappdbg.win32.defines.PNTSTATUS

alias of LP_c_int

winappdbg.win32.defines.PPVOID

alias of LP_c_void_p

winappdbg.win32.defines.PREGSAM

alias of LP_c_uint

winappdbg.win32.defines.PSIZE_T

alias of LP_c_ulong

winappdbg.win32.defines.PULONG

alias of LP_c_uint

winappdbg.win32.defines.PULONG32

alias of LP_c_uint

winappdbg.win32.defines.PULONG64

alias of LP_c_ulong

winappdbg.win32.defines.RaiseIfNotErrorSuccess(result, func=None, arguments=())

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.

winappdbg.win32.defines.RaiseIfNotZero(result, func=None, arguments=())

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.

winappdbg.win32.defines.RaiseIfZero(result, func=None, arguments=())

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.

class winappdbg.win32.defines.Structure
class winappdbg.win32.defines.UNICODE_STRING
class winappdbg.win32.defines.Union