mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-08-05 07:05:34 +02:00
fix linux related void* insert and stuff
add real logic to example plugin.
This commit is contained in:
parent
af46e8c0e8
commit
d7fe629407
2 changed files with 23 additions and 18 deletions
|
@ -1,13 +1,30 @@
|
||||||
#include "pdk.h"
|
#include "pdk.h"
|
||||||
|
|
||||||
|
#define PRINT_DEBUG_PLUGIN(a, ...) do {FILE *t = fopen("example_debug.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t);} while (0)
|
||||||
|
|
||||||
#define EXPORT extern "C" __declspec( dllexport )
|
#define EXPORT extern "C" __declspec( dllexport )
|
||||||
|
|
||||||
EXPORT void GBE_Load()
|
EXPORT void GBE_Load()
|
||||||
{
|
{
|
||||||
|
PRINT_DEBUG_PLUGIN("GBE_Load");
|
||||||
|
PRINT_DEBUG_PLUGIN("Version of PDK: %d", PDK::GetPDKVersion());
|
||||||
|
// Which one should be good? idk
|
||||||
|
//PDK::RegisterInterface(TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
|
||||||
|
int success = PDK::RegisterInterface(&TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
|
||||||
|
PRINT_DEBUG_PLUGIN("Finished registering interfaces! Is Success: %d", success);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT void GBE_UnLoad()
|
EXPORT void GBE_UnLoad()
|
||||||
{
|
{
|
||||||
|
PRINT_DEBUG_PLUGIN("GBE_UnLoad");
|
||||||
|
int success = PDK::UnRegisterInterface(&TestCreate);
|
||||||
|
PRINT_DEBUG_PLUGIN("Finished registering interfaces! Is Success: %d", success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void* TestCreate(HSteamUser hSteamUser, HSteamPipe hSteamPipe)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG_PLUGIN("Test create with STEAMAPPLIST_INTERFACE_VERSION001");
|
||||||
|
PRINT_DEBUG_PLUGIN("Args: %d %d", hSteamUser, hSteamPipe);
|
||||||
|
return nullptr;
|
||||||
|
}
|
20
pdk/pdk.cpp
20
pdk/pdk.cpp
|
@ -7,14 +7,14 @@ void PDK::LoadPlugin(HMODULE handle)
|
||||||
{
|
{
|
||||||
PluginCall load = (PluginCall)GetProcAddress(handle, "GBE_Load");
|
PluginCall load = (PluginCall)GetProcAddress(handle, "GBE_Load");
|
||||||
load();
|
load();
|
||||||
PRINT_DEBUG("Loaded crack file");
|
PRINT_DEBUG("Loaded plugin file");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PDK::UnloLoadPlugin(HMODULE handle)
|
void PDK::UnloLoadPlugin(HMODULE handle)
|
||||||
{
|
{
|
||||||
PluginCall load = (PluginCall)GetProcAddress(handle, "GBE_UnLoad");
|
PluginCall load = (PluginCall)GetProcAddress(handle, "GBE_UnLoad");
|
||||||
load();
|
load();
|
||||||
PRINT_DEBUG("Loaded crack file");
|
PRINT_DEBUG("Loaded plugin file");
|
||||||
}
|
}
|
||||||
|
|
||||||
int PDK::RegisterInterface(InterfaceMaker interfaceMakePtr, const char* interfaceVersion)
|
int PDK::RegisterInterface(InterfaceMaker interfaceMakePtr, const char* interfaceVersion)
|
||||||
|
@ -25,7 +25,7 @@ int PDK::RegisterInterface(InterfaceMaker interfaceMakePtr, const char* interfac
|
||||||
return 1;
|
return 1;
|
||||||
if (!client_known_interfaces.count(interfaceVersion))
|
if (!client_known_interfaces.count(interfaceVersion))
|
||||||
return 1;
|
return 1;
|
||||||
interfaceMap.insert(std::make_pair(interfaceMakePtr, interfaceVersion));
|
interfaceMap.insert(std::make_pair((void*)interfaceMakePtr, interfaceVersion));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ int PDK::UnRegisterInterface(InterfaceMaker interfaceMakePtr)
|
||||||
if (interfaceMakePtr == NULL)
|
if (interfaceMakePtr == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
interfaceMap.erase(interfaceMakePtr);
|
interfaceMap.erase((void*)interfaceMakePtr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,15 +55,3 @@ int PDK::GetPDKVersion()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* TestCreate(HSteamUser hSteamUser, HSteamPipe hSteamPipe)
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register()
|
|
||||||
{
|
|
||||||
// Which one should be good? idk
|
|
||||||
//PDK::RegisterInterface(TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
|
|
||||||
//PDK::RegisterInterface(&TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue