BlackBone
Windows memory hacking library
 All Classes Functions
MExcept.h
1 #pragma once
2 
3 #include "../Include/Winheaders.h"
4 #include "../Process/MemBlock.h"
5 
6 namespace blackbone
7 {
8 
12 class MExcept
13 {
14 public:
15  // For debug purposes only
16  BLACKBONE_API static void* g_pImageBase;
17  BLACKBONE_API static size_t g_imageSize;
18 
19 protected:
20  BLACKBONE_API MExcept( class Process& proc );
21  BLACKBONE_API ~MExcept();
22 
30  BLACKBONE_API NTSTATUS CreateVEH( size_t pTargetBase, size_t imageSize, eModType mt = mt_default );
31 
36  BLACKBONE_API NTSTATUS RemoveVEH();
37 
38 private:
39  MExcept( const MExcept& ) = delete;
40  MExcept& operator =(const MExcept&) = delete;
41 
42 private:
43  class Process& _proc; // Underlying process
44  MemBlock _pVEHCode; // VEH function codecave
45  size_t _hVEH = 0; // VEH handle
46 };
47 
48 }
Exception handling support for arbitrary code
Definition: MExcept.h:12
BLACKBONE_API NTSTATUS CreateVEH(size_t pTargetBase, size_t imageSize, eModType mt=mt_default)
Inject VEH wrapper into process Used to enable execution of SEH handlers out of image ...
Definition: MExcept.cpp:37
BLACKBONE_API NTSTATUS RemoveVEH()
Removes VEH from target process
Definition: MExcept.cpp:151
Definition: Process.h:43
Definition: MemBlock.h:39
Definition: AsmHelper32.cpp:6