commit
bba5c8a39a
109 files changed
+14085
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace voidlibc::loader::windows_handoff {
|
||||
|
||||
struct LoadResult {
|
||||
void* handle = nullptr; // opaque OS handle (HMODULE on Windows)
|
||||
std::string error;
|
||||
bool ok = true;
|
||||
};
|
||||
|
||||
// Write `bytes` to a temp file and load it via LoadLibraryEx (Windows) /
|
||||
// dlopen from a temp file (stub for non-Windows builds so the code compiles
|
||||
// everywhere). The temp file is deleted once the DLL is loaded.
|
||||
LoadResult load_pe_buffer(const std::vector<std::uint8_t>& bytes);
|
||||
|
||||
// Resolve a symbol from a handle returned by load_pe_buffer.
|
||||
void* get_proc(void* handle, const char* name);
|
||||
|
||||
// Unload a handle returned by load_pe_buffer.
|
||||
void unload(void* handle);
|
||||
|
||||
} // namespace voidlibc::loader::windows_handoff
|
||||
Reference in new issue
Block a user