mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Added Reclass.NET plugin compatibility layer
This commit is contained in:
48
plugins/RcNetPluginCompatLayer/RcNetCompatProvider.h
Normal file
48
plugins/RcNetPluginCompatLayer/RcNetCompatProvider.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
#include "../../src/providers/provider.h"
|
||||
#include "ReClassNET_Plugin.hpp"
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
/**
|
||||
* Provider that bridges ReClass.NET native plugin DLL calls
|
||||
* to the ReclassX Provider interface.
|
||||
*/
|
||||
class RcNetCompatProvider : public rcx::Provider
|
||||
{
|
||||
public:
|
||||
RcNetCompatProvider(const RcNetFunctions& fns, uint32_t pid,
|
||||
const QString& processName);
|
||||
~RcNetCompatProvider() override;
|
||||
|
||||
// Required overrides
|
||||
bool read(uint64_t addr, void* buf, int len) const override;
|
||||
int size() const override;
|
||||
|
||||
// Optional overrides
|
||||
bool write(uint64_t addr, const void* buf, int len) override;
|
||||
bool isWritable() const override { return m_fns.WriteRemoteMemory != nullptr; }
|
||||
QString name() const override { return m_processName; }
|
||||
QString kind() const override { return QStringLiteral("RcNet"); }
|
||||
bool isLive() const override { return true; }
|
||||
uint64_t base() const override { return m_base; }
|
||||
void setBase(uint64_t b) override { m_base = b; }
|
||||
QString getSymbol(uint64_t addr) const override;
|
||||
|
||||
struct ModuleInfo {
|
||||
QString name;
|
||||
uint64_t base;
|
||||
uint64_t size;
|
||||
};
|
||||
|
||||
private:
|
||||
void cacheModules();
|
||||
|
||||
RcNetFunctions m_fns;
|
||||
RC_Pointer m_handle = nullptr;
|
||||
uint32_t m_pid;
|
||||
QString m_processName;
|
||||
uint64_t m_base = 0;
|
||||
QVector<ModuleInfo> m_modules;
|
||||
};
|
||||
Reference in New Issue
Block a user