You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8 KiB

#include <Windows.h>
#include <tuple>
#include <cstdint>
#pragma once
//--- amlegit dll functions
namespace amlegit
{
//--- function is only for extracting the driver
static std::tuple<std::uintptr_t, std::size_t> get_driver()
{
auto get_driver_temp =
reinterpret_cast<__int64(*)(unsigned*)>(
GetProcAddress(LoadLibrary(L"buffer.dll"), "GetDriver"));
unsigned driver_size;
if (get_driver_temp)
return { get_driver_temp(&driver_size), driver_size };
return { {}, {} };
}
//--- this function calls GetDriver inside buffer.dll
static bool load_driver()
{
auto load_drv =
reinterpret_cast<bool(*)()>(
GetProcAddress(LoadLibrary(L"buffer.dll"), "ExportLoad"));
return load_drv ? load_drv() : false;
}
//--- driver_name is the name of the driver which is in current working directory
static bool map_driver(const char* driver_name)
{
auto map_drv =
reinterpret_cast<bool(*)(const char*)>(
GetProcAddress(LoadLibrary(L"mmap.dll"), "ExportMap"));
return map_drv ? map_drv(driver_name) : false;
}
//--- hooks ioctl of gpuenergydrv.sys
static bool connect_driver()
{
auto connect_drv =
reinterpret_cast<bool(*)()>(
GetProcAddress(LoadLibrary(L"inject.dll"), "ExportConnect"));
return connect_drv ? connect_drv() : false;
}
//--- pasted from: https://github.com/btbd/hwid
static bool spoof()
{
auto spoof_addr =
reinterpret_cast<bool(*)()>(
GetProcAddress(LoadLibrary(L"inject.dll"), "ExportSpoof"));
return spoof_addr ? spoof_addr() : false;
}
//--- this doesnt hide memory!
static bool inject(const char* wind_name, const char* dll_name)
{
auto inject_addr =
reinterpret_cast<bool(*)(const char*, const char*)>(
GetProcAddress(LoadLibrary(L"inject.dll"), "ExportInject"));
return inject_addr ? inject_addr(wind_name, dll_name) : false;
}
}