ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Memory.h
Go to the documentation of this file.
1 /*
2  * Taken from https://bitbucket.org/rafzi/hacklib
3  */
4 
5 #ifndef ETISS_MEMORY_H
6 #define ETISS_MEMORY_H
7 
8 #include <vector>
9 #include <string>
10 #include <memory>
11 
12 #ifdef _WIN32
13 #include <Windows.h>
14 #endif
15 
16 
17 namespace etiss
18 {
19 
20 #ifdef _WIN32
21 
23 typedef HINSTANCE ModuleHandle;
24 
26 static const ModuleHandle NullModuleHandle = NULL;
27 
28 #else
29 
31 typedef void *ModuleHandle;
32 
34 static const ModuleHandle NullModuleHandle = nullptr;
35 
36 #endif
37 
38 
39 // An empty string requests the main module.
40 etiss::ModuleHandle GetModuleByName(const std::string &name = "");
41 
42 // Returns hl::NullModuleHandle when the address does not reside in a module.
44 
45 std::string GetModulePath(etiss::ModuleHandle hModule);
46 
47 
50 
52 std::string GetCurrentModulePath();
53 
54 } // namespace etiss
55 
56 #endif
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53
void * ModuleHandle
Represents a module handle. Analogous to Windows this represents the module base address,...
Definition: Memory.h:31
etiss::ModuleHandle GetModuleByAddress(uintptr_t adr)
Definition: Memory.cpp:85
std::string GetCurrentModulePath()
Returns the abolute path with filename to the own dynamic library.
Definition: Memory.cpp:117
etiss::ModuleHandle GetModuleByName(const std::string &name="")
Definition: Memory.cpp:56
static const ModuleHandle NullModuleHandle
Represents a null value for hl::ModuleHandle.
Definition: Memory.h:34
std::string GetModulePath(etiss::ModuleHandle hModule)
Definition: Memory.cpp:92
etiss::ModuleHandle GetCurrentModule()
Returns the module handle to the own dynamic library.
Definition: Memory.cpp:106
#define NULL
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c-base.h:62