(still untested) More splitting and cleanup

This commit is contained in:
nastys
2021-09-19 19:42:47 +02:00
parent bb9301978b
commit 5919ab6ff6
12 changed files with 542 additions and 229 deletions
+1 -11
View File
@@ -1,16 +1,6 @@
#include <windows.h>
#include <string>
void InjectCode(void* address, const std::vector<uint8_t> data)
{
const size_t byteCount = data.size() * sizeof(uint8_t);
DWORD oldProtect;
VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy(address, data.data(), byteCount);
VirtualProtect(address, byteCount, oldProtect, nullptr);
}
std::wstring ExePath() {
WCHAR buffer[MAX_PATH];
GetModuleFileNameW(NULL, buffer, MAX_PATH);
@@ -23,5 +13,5 @@ std::wstring DirPath() {
return exepath.substr(0, pos);
}
std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\CustoMixer.ini";
std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\DivaWig.ini";
LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str();