initial commit -- v1 code

This commit is contained in:
2026-08-10 14:21:07 +02:00
commit 1ecb7f777e
25 changed files with 2472 additions and 0 deletions

51
src/module.h Normal file
View File

@@ -0,0 +1,51 @@
#pragma once
#include "common.h"
#include "interface.h"
#include <cstddef>
#include <cstdint>
#include <dlfcn.h>
#include <string>
#include <string_view>
#include <vector>
struct Section
{
std::string name;
void* base;
size_t size;
};
enum SigError
{
SIG_OK,
SIG_NOT_FOUND,
SIG_FOUND_MULTIPLE,
};
class CModule
{
public:
CModule(const char* relativePath, const char* module);
~CModule() = default;
void* FindSignature(const uint8_t* pattern, size_t length, int& error) const;
void* FindInterface(const char* name) const;
void* GetHandle() const { return m_handle; }
private:
void* m_handle {};
void* m_base {};
size_t m_size {};
std::vector<Section> m_sections;
std::string m_name;
};
namespace modules
{
extern CModule* engine;
extern CModule* server;
extern CModule* schemasystem;
}