MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / VectoredException

Class VectoredException

windows/winobject/exception.py:329–347  ·  view source on GitHub ↗

A decorator that create a callable which can be passed to :func:`AddVectoredExceptionHandler`

Source from the content-addressed store, hash-verified

327
328
329class VectoredException(object):
330 """A decorator that create a callable which can be passed to :func:`AddVectoredExceptionHandler`"""
331 func_type = ctypes.WINFUNCTYPE(ctypes.c_uint, ctypes.POINTER(EEXCEPTION_POINTERS))
332
333 def __new__(cls, func):
334 self = object.__new__(cls)
335 self.func = func
336 v = self.func_type(self.decorator)
337 v.self = self
338 return v
339
340 def decorator(self, exception_pointers):
341 try:
342 return self.func(exception_pointers)
343 except BaseException as e:
344 import traceback
345 print("Ignored Python Exception in Vectored Exception: {0}".format(e))
346 traceback.print_exc()
347 return windef.EXCEPTION_CONTINUE_SEARCH
348
349
350class VectoredExceptionHandler(object):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected