MCPcopy Create free account
hub / github.com/LiteLDev/LeviLamina / getCurrentModuleHandle

Function getCurrentModuleHandle

src/ll/api/utils/SystemUtils_linux.cpp:11–24  ·  view source on GitHub ↗

Defined in CompilerPredefine.h

Source from the content-addressed store, hash-verified

9
10// Defined in CompilerPredefine.h
11LLAPI void* getCurrentModuleHandle() noexcept {
12 std::ifstream maps("/proc/self/maps");
13 std::string line;
14
15 if (std::getline(maps, line)) {
16 std::istringstream stream(line);
17 std::string address;
18 if (std::getline(stream, address, '-')) {
19 return (uintptr_t*)std::stoull(address, nullptr, 16);
20 }
21 }
22
23 return nullptr;
24}
25
26} // namespace ll::internal

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected