ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Memory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// This file is part of ETISS. It is licensed under the BSD 3-Clause License; you may not use this file except in
4// compliance with the License. You should have received a copy of the license along with this project. If not, see the
5// LICENSE file.
6
7/*
8 * Taken from https://bitbucket.org/rafzi/hacklib
9 */
10
11#ifndef ETISS_MEMORY_H
12#define ETISS_MEMORY_H
13
14#include <vector>
15#include <string>
16#include <memory>
17#include <cstdint>
18
19#ifdef _WIN32
20#include <Windows.h>
21#endif
22
23namespace etiss
24{
25
26#ifdef _WIN32
27
29typedef HINSTANCE ModuleHandle;
30
33
34#else
35
37typedef void *ModuleHandle;
38
40static const ModuleHandle NullModuleHandle = nullptr;
41
42#endif
43
44// An empty string requests the main module.
45etiss::ModuleHandle GetModuleByName(const std::string &name = "");
46
47// Returns hl::NullModuleHandle when the address does not reside in a module.
49
50std::string GetModulePath(etiss::ModuleHandle hModule);
51
54
56std::string GetCurrentModulePath();
57
58} // namespace etiss
59
60#endif
forwards: include/jit/*
Definition Benchmark.h:17
void * ModuleHandle
Represents a module handle. Analogous to Windows this represents the module base address,...
Definition Memory.h:37
etiss::ModuleHandle GetModuleByAddress(uintptr_t adr)
Definition Memory.cpp:90
std::string GetCurrentModulePath()
Returns the abolute path with filename to the own dynamic library.
Definition Memory.cpp:120
etiss::ModuleHandle GetModuleByName(const std::string &name="")
Definition Memory.cpp:61
static const ModuleHandle NullModuleHandle
Represents a null value for hl::ModuleHandle.
Definition Memory.h:40
std::string GetModulePath(etiss::ModuleHandle hModule)
Definition Memory.cpp:97
etiss::ModuleHandle GetCurrentModule()
Returns the module handle to the own dynamic library.
Definition Memory.cpp:109
#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...