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 
13 {
14  ptr_t base;
15  ptr_t size;
16 };
17 
18 
23 {
24  ptr_t count; // Number of used entries
25  ExceptionModule entry[250]; // Module data
26 };
27 
31 class MExcept
32 {
33 public:
34  // For debug purposes only
35  BLACKBONE_API static void* g_pImageBase;
36  BLACKBONE_API static size_t g_imageSize;
37 
38 protected:
39  BLACKBONE_API MExcept( class Process& proc );
40  BLACKBONE_API ~MExcept();
41 
51  BLACKBONE_API NTSTATUS CreateVEH( size_t pTargetBase, size_t imageSize, eModType mt, bool partial );
52 
58  BLACKBONE_API NTSTATUS RemoveVEH( bool partial );
59 
60 private:
61  MExcept( const MExcept& ) = delete;
62  MExcept& operator =(const MExcept&) = delete;
63 
64 private:
65  class Process& _proc; // Underlying process
66  MemBlock _pVEHCode; // VEH function codecave
67  MemBlock _pModTable; // x64 module address range table
68  size_t _hVEH = 0; // VEH handle
69 };
70 
71 }
Exception handling support for arbitrary code
Definition: MExcept.h:31
x64 exception module info
Definition: MExcept.h:12
Definition: Process.h:80
Definition: MemBlock.h:39
x64 module table
Definition: MExcept.h:22
BLACKBONE_API NTSTATUS RemoveVEH(bool partial)
Removes VEH from target process
Definition: MExcept.cpp:225
Definition: AsmHelper32.cpp:6
BLACKBONE_API NTSTATUS CreateVEH(size_t pTargetBase, size_t imageSize, eModType mt, bool partial)
Inject VEH wrapper into process Used to enable execution of SEH handlers out of image ...
Definition: MExcept.cpp:40