BlackBone
Windows memory hacking library
 All Classes Functions
Types.h
1 #pragma once
2 
3 #include "NativeStructures.h"
4 #include "FunctionTypes.h"
5 
6 #include <stdint.h>
7 #include <string>
8 
9 namespace blackbone
10 {
11 
12 typedef uint64_t ptr_t; // Generic pointer in remote process
13 typedef ptr_t module_t; // Module base pointer
14 
15 // PEB helper
16 template<typename T>
17 struct _PEB_T2
18 {
19  typedef typename std::conditional<std::is_same<T, DWORD>::value, _PEB32, _PEB64>::type type;
20 };
21 
22 // Type of barrier
23 enum WoW64Type
24 {
25  wow_32_32 = 0, // Both processes are WoW64
26  wow_64_64, // Both processes are x64
27  wow_32_64, // Managing x64 process from WoW64 process
28  wow_64_32, // Managing WOW64 process from x64 process
29 };
30 
32 {
33  WoW64Type type = wow_32_32;
34  bool sourceWow64 = false;
35  bool targetWow64 = false;
36  bool x86OS = false;
37 };
38 
39 // Module type
40 enum eModType
41 {
42  mt_mod32, // 64 bit module
43  mt_mod64, // 32 bit module
44  mt_default, // type is deduced from target process
45  mt_unknown // Failed to detect type
46 };
47 
48 // Module search method
49 enum eModSeachType
50 {
51  LdrList, // InLoadOrder list
52  Sections, // Scan for section objects
53  PEHeaders, // Scan for PE headers in memory
54 };
55 
56 // Module info
57 struct ModuleData
58 {
59  ptr_t baseAddress; // Base image address
60  std::wstring name; // File name
61  std::wstring fullPath; // Full file path
62  size_t size; // Size of image
63  eModType type; // Module type
64  bool manual; // Image is manually mapped
65 
66  bool operator ==(const ModuleData& other) const
67  {
68  return (baseAddress == other.baseAddress);
69  }
70 
71  bool operator <(const ModuleData& other)
72  {
73  return baseAddress < other.baseAddress;
74  }
75 };
76 
77 // Wow64 register helper
78 union reg64
79 {
80  uint32_t dw[2];
81  uint64_t v;
82 };
83 
84 
85 }
Definition: NativeStructures.h:174
Definition: Types.h:31
Definition: Types.h:78
Definition: AsmHelper32.cpp:6
Definition: Types.h:57
Definition: Types.h:17