[General] Refactor all the code

This is the actual refactoring, the last commit was broken
This commit is contained in:
momo5502 2017-01-20 22:41:03 +01:00
parent 73d569df43
commit 82e9f3864c
77 changed files with 672 additions and 626 deletions

View File

@ -341,7 +341,6 @@ workspace "iw4x"
if _OPTIONS["disable-base128"] then if _OPTIONS["disable-base128"] then
defines { "DISABLE_BASE128" } defines { "DISABLE_BASE128" }
end end
if _OPTIONS["disable-steam-game"] then if _OPTIONS["disable-steam-game"] then
defines { "DISABLE_STEAM_GAME" } defines { "DISABLE_STEAM_GAME" }
end end

View File

@ -50,7 +50,7 @@ namespace Components
void AntiCheat::AssertCalleeModule(void* callee) void AntiCheat::AssertCalleeModule(void* callee)
{ {
HMODULE hModuleSelf = nullptr, hModuleTarget = nullptr, hModuleProcess = GetModuleHandleA(NULL); HMODULE hModuleSelf = nullptr, hModuleTarget = nullptr, hModuleProcess = GetModuleHandleA(nullptr);
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(callee), &hModuleTarget); GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(callee), &hModuleTarget);
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(AntiCheat::AssertCalleeModule), &hModuleSelf); GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(AntiCheat::AssertCalleeModule), &hModuleSelf);
@ -69,9 +69,6 @@ namespace Components
void AntiCheat::InitLoadLibHook() void AntiCheat::InitLoadLibHook()
{ {
static uint8_t loadLibStub[] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 }; // xor eax, eax; retn 04h
static uint8_t loadLibExStub[] = { 0x33, 0xC0, 0xC2, 0x0C, 0x00 }; // xor eax, eax; retn 0Ch
static uint8_t kernel32Str[] = { 0xB4, 0x9A, 0x8D, 0xB1, 0x9A, 0x93, 0xCC, 0xCD, 0xD1, 0x9B, 0x93, 0x93 }; // KerNel32.dll static uint8_t kernel32Str[] = { 0xB4, 0x9A, 0x8D, 0xB1, 0x9A, 0x93, 0xCC, 0xCD, 0xD1, 0x9B, 0x93, 0x93 }; // KerNel32.dll
static uint8_t loadLibAStr[] = { 0xB3, 0x90, 0x9E, 0x9B, 0xB3, 0x96, 0x9D, 0x8D, 0x9E, 0x8D, 0x86, 0xBE }; // LoadLibraryA static uint8_t loadLibAStr[] = { 0xB3, 0x90, 0x9E, 0x9B, 0xB3, 0x96, 0x9D, 0x8D, 0x9E, 0x8D, 0x86, 0xBE }; // LoadLibraryA
static uint8_t loadLibWStr[] = { 0xB3, 0x90, 0x9E, 0x9B, 0xB3, 0x96, 0x9D, 0x8D, 0x9E, 0x8D, 0x86, 0xA8 }; // LoadLibraryW static uint8_t loadLibWStr[] = { 0xB3, 0x90, 0x9E, 0x9B, 0xB3, 0x96, 0x9D, 0x8D, 0x9E, 0x8D, 0x86, 0xA8 }; // LoadLibraryW
@ -89,9 +86,11 @@ namespace Components
AntiCheat::LoadLibHook[0].initialize(loadLibA, LoadLibaryAStub, HOOK_JUMP); AntiCheat::LoadLibHook[0].initialize(loadLibA, LoadLibaryAStub, HOOK_JUMP);
AntiCheat::LoadLibHook[1].initialize(loadLibW, LoadLibaryWStub, HOOK_JUMP); AntiCheat::LoadLibHook[1].initialize(loadLibW, LoadLibaryWStub, HOOK_JUMP);
#else #else
static uint8_t loadLibStub[] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 }; // xor eax, eax; retn 04h
AntiCheat::LoadLibHook[0].initialize(loadLibA, loadLibStub, HOOK_JUMP); AntiCheat::LoadLibHook[0].initialize(loadLibA, loadLibStub, HOOK_JUMP);
AntiCheat::LoadLibHook[1].initialize(loadLibW, loadLibStub, HOOK_JUMP); AntiCheat::LoadLibHook[1].initialize(loadLibW, loadLibStub, HOOK_JUMP);
#endif #endif
//static uint8_t loadLibExStub[] = { 0x33, 0xC0, 0xC2, 0x0C, 0x00 }; // xor eax, eax; retn 0Ch
//AntiCheat::LoadLibHook[2].initialize(LoadLibraryExA, loadLibExStub, HOOK_JUMP); //AntiCheat::LoadLibHook[2].initialize(LoadLibraryExA, loadLibExStub, HOOK_JUMP);
//AntiCheat::LoadLibHook[3].initialize(LoadLibraryExW, loadLibExStub, HOOK_JUMP); //AntiCheat::LoadLibHook[3].initialize(LoadLibraryExW, loadLibExStub, HOOK_JUMP);
} }
@ -198,7 +197,7 @@ namespace Components
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(callee), &module); GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char*>(callee), &module);
GetModuleFileNameA(module, buffer, sizeof buffer); GetModuleFileNameA(module, buffer, sizeof buffer);
MessageBoxA(0, Utils::String::VA("Loading library %s via %s %X", std::string(library.begin(), library.end()).data(), buffer, reinterpret_cast<uint32_t>(callee)), 0, 0); MessageBoxA(nullptr, Utils::String::VA("Loading library %s via %s %X", std::string(library.begin(), library.end()).data(), buffer, reinterpret_cast<uint32_t>(callee)), nullptr, 0);
return LoadLibraryExW(library.data(), nullptr, 0); return LoadLibraryExW(library.data(), nullptr, 0);
} }

View File

@ -1,3 +1,5 @@
#pragma once
namespace Components namespace Components
{ {
class ArenaLength : public Component class ArenaLength : public Component

View File

@ -50,7 +50,7 @@ namespace Components
Game::XAssetHeader AssetHandler::FindAsset(Game::XAssetType type, const char* filename) Game::XAssetHeader AssetHandler::FindAsset(Game::XAssetType type, const char* filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
if (filename) if (filename)
{ {

View File

@ -5,6 +5,7 @@ namespace Assets
void IComWorld::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) void IComWorld::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
{ {
Game::ComWorld* asset = header.comWorld; Game::ComWorld* asset = header.comWorld;
if (asset->lights) if (asset->lights)
{ {
for (int i = 0; i < asset->lightCount; ++i) for (int i = 0; i < asset->lightCount; ++i)

View File

@ -29,7 +29,8 @@ namespace Assets
{ {
Utils::Stream::Reader reader(builder->getAllocator(), imageFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), imageFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xImg" IW4X_IMG_VERSION)) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xImg" IW4X_IMG_VERSION, 8))
{ {
Components::Logger::Error(0, "Reading image '%s' failed, header is invalid!", name.data()); Components::Logger::Error(0, "Reading image '%s' failed, header is invalid!", name.data());
} }
@ -132,6 +133,11 @@ namespace Assets
image->loadDef->format = 0x35545844; image->loadDef->format = 0x35545844;
break; break;
} }
default:
{
break;
}
} }
header->image = image; header->image = image;

View File

@ -136,7 +136,8 @@ namespace Assets
{ {
Utils::Stream::Reader reader(builder->getAllocator(), mapFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), mapFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xGfxW")) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xGfxW", 8))
{ {
Components::Logger::Error("Reading gfxworld '%s' failed, header is invalid!", name.data()); Components::Logger::Error("Reading gfxworld '%s' failed, header is invalid!", name.data());
} }

View File

@ -25,7 +25,8 @@ namespace Assets
Utils::Stream::Reader reader(builder->getAllocator(), materialFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), materialFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xMat" IW4X_MAT_VERSION)) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xMat" IW4X_MAT_VERSION, 8))
{ {
Components::Logger::Error(0, "Reading material '%s' failed, header is invalid!", name.data()); Components::Logger::Error(0, "Reading material '%s' failed, header is invalid!", name.data());
} }
@ -39,7 +40,7 @@ namespace Assets
material->surfaceTypeBits = reader.read<int>(); material->surfaceTypeBits = reader.read<int>();
material->hashIndex = reader.read<unsigned __int16>(); material->hashIndex = reader.read<unsigned __int16>();
char* stateBitsEntry = reader.readArray<char>(48); char* stateBitsEntry = reader.readArray<char>(48);
memcpy(material->stateBitsEntry, stateBitsEntry, 48); std::memcpy(material->stateBitsEntry, stateBitsEntry, 48);
material->textureCount = reader.readByte(); material->textureCount = reader.readByte();
material->constantCount = reader.readByte(); material->constantCount = reader.readByte();
material->stateBitsCount = reader.readByte(); material->stateBitsCount = reader.readByte();
@ -297,7 +298,7 @@ namespace Assets
} }
else else
{ {
material->textureTable = 0; material->textureTable = nullptr;
} }
material->textureCount = static_cast<char>(textureList.size()) & 0xFF; material->textureCount = static_cast<char>(textureList.size()) & 0xFF;

View File

@ -12,7 +12,8 @@ namespace Assets
{ {
Utils::Stream::Reader reader(builder->getAllocator(), animFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), animFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xAnim")) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xAnim", 8))
{ {
Components::Logger::Error(0, "Reading animation '%s' failed, header is invalid!", name.data()); Components::Logger::Error(0, "Reading animation '%s' failed, header is invalid!", name.data());
} }

View File

@ -80,7 +80,8 @@ namespace Assets
{ {
Utils::Stream::Reader reader(builder->getAllocator(), modelFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), modelFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xModl")) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xModl", 8))
{ {
Components::Logger::Error(0, "Reading model '%s' failed, header is invalid!", name.data()); Components::Logger::Error(0, "Reading model '%s' failed, header is invalid!", name.data());
} }

View File

@ -371,7 +371,7 @@ namespace Assets
{ {
AssertSize(Game::cbrushside_t, 8); AssertSize(Game::cbrushside_t, 8);
MessageBoxA(0, "BrushSide shouldn't be written in cBrush!", "WARNING", MB_ICONEXCLAMATION); MessageBoxA(nullptr, "BrushSide shouldn't be written in cBrush!", "WARNING", MB_ICONEXCLAMATION);
buffer->align(Utils::Stream::ALIGN_4); buffer->align(Utils::Stream::ALIGN_4);
builder->storePointer(brush->sides); builder->storePointer(brush->sides);
@ -588,7 +588,8 @@ namespace Assets
Utils::Stream::Reader reader(builder->getAllocator(), clipFile.getBuffer()); Utils::Stream::Reader reader(builder->getAllocator(), clipFile.getBuffer());
if (reader.read<__int64>() != *reinterpret_cast<__int64*>("IW4xClip")) __int64 magic = reader.read<__int64>();
if (std::memcmp(&magic, "IW4xClip", 8))
{ {
Components::Logger::Error(0, "Reading clipMap_t '%s' failed, header is invalid!", name.data()); Components::Logger::Error(0, "Reading clipMap_t '%s' failed, header is invalid!", name.data());
} }

View File

@ -62,7 +62,7 @@ namespace Components
{ {
if (Loader::IsPregame()) if (Loader::IsPregame())
{ {
MessageBoxA(0, "Registering server commands in pregamestate is illegal!", nullptr, MB_ICONERROR); MessageBoxA(nullptr, "Registering server commands in pregamestate is illegal!", nullptr, MB_ICONERROR);
#ifdef DEBUG #ifdef DEBUG
__debugbreak(); __debugbreak();

View File

@ -68,11 +68,11 @@ namespace Components
char regred[MAX_PATH] = { 0 }; char regred[MAX_PATH] = { 0 };
// Check if the game has been moved. // Check if the game has been moved.
openRes = RegQueryValueExA(hKey, nullptr, 0, 0, reinterpret_cast<BYTE*>(regred), &dwsize); openRes = RegQueryValueExA(hKey, nullptr, nullptr, nullptr, reinterpret_cast<BYTE*>(regred), &dwsize);
if (openRes == ERROR_SUCCESS) if (openRes == ERROR_SUCCESS)
{ {
char* endPtr = strstr(regred, "\" \"%1\""); char* endPtr = strstr(regred, "\" \"%1\"");
if (endPtr != NULL) if (endPtr != nullptr)
{ {
*endPtr = 0; *endPtr = 0;
} }
@ -110,7 +110,7 @@ namespace Components
} }
// Create SOFTWARE\\Classes\\iw4x // Create SOFTWARE\\Classes\\iw4x
openRes = RegCreateKeyExA(hKey, "iw4x", 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, 0); openRes = RegCreateKeyExA(hKey, "iw4x", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, nullptr);
if (openRes != ERROR_SUCCESS) if (openRes != ERROR_SUCCESS)
{ {
@ -128,7 +128,7 @@ namespace Components
} }
// Create SOFTWARE\\Classes\\iw4x\\DefaultIcon // Create SOFTWARE\\Classes\\iw4x\\DefaultIcon
openRes = RegCreateKeyExA(hKey, "DefaultIcon", 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, 0); openRes = RegCreateKeyExA(hKey, "DefaultIcon", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, nullptr);
if (openRes != ERROR_SUCCESS) if (openRes != ERROR_SUCCESS)
{ {
@ -136,7 +136,7 @@ namespace Components
} }
data = Utils::String::VA("%s,1", ownPth); data = Utils::String::VA("%s,1", ownPth);
openRes = RegSetValueExA(hKey, 0, 0, REG_SZ, reinterpret_cast<const BYTE*>(data.data()), data.size() + 1); openRes = RegSetValueExA(hKey, nullptr, 0, REG_SZ, reinterpret_cast<const BYTE*>(data.data()), data.size() + 1);
RegCloseKey(hKey); RegCloseKey(hKey);
if (openRes != ERROR_SUCCESS) if (openRes != ERROR_SUCCESS)
@ -152,7 +152,7 @@ namespace Components
return false; return false;
} }
openRes = RegCreateKeyExA(hKey, "shell\\open\\command", 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, 0); openRes = RegCreateKeyExA(hKey, "shell\\open\\command", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, nullptr);
if (openRes != ERROR_SUCCESS) if (openRes != ERROR_SUCCESS)
{ {
@ -160,7 +160,7 @@ namespace Components
} }
data = Utils::String::VA("\"%s\" \"%s\"", ownPth, "%1"); data = Utils::String::VA("\"%s\" \"%s\"", ownPth, "%1");
openRes = RegSetValueExA(hKey, 0, 0, REG_SZ, reinterpret_cast<const BYTE*>(data.data()), data.size() + 1); openRes = RegSetValueExA(hKey, nullptr, 0, REG_SZ, reinterpret_cast<const BYTE*>(data.data()), data.size() + 1);
RegCloseKey(hKey); RegCloseKey(hKey);
if (openRes != ERROR_SUCCESS) if (openRes != ERROR_SUCCESS)

View File

@ -36,7 +36,7 @@ namespace Components
Utils::Hook::Xor<DWORD>(0xB2C538, 1); Utils::Hook::Xor<DWORD>(0xB2C538, 1);
// g_consoleField // g_consoleField
Game::Field_Clear((void*)0xA1B6B0); Game::Field_Clear(reinterpret_cast<void*>(0xA1B6B0));
// show console output? // show console output?
Utils::Hook::Set<BYTE>(0xA15F38, 0); Utils::Hook::Set<BYTE>(0xA15F38, 0);
@ -142,7 +142,7 @@ namespace Components
if (c == ERR) if (c == ERR)
{ {
return NULL; return nullptr;
} }
switch (c) switch (c)
@ -241,7 +241,7 @@ namespace Components
break; break;
} }
return NULL; return nullptr;
} }
void Console::Destroy() void Console::Destroy()
@ -388,7 +388,7 @@ namespace Components
Game::Sys_ShowConsole(); Game::Sys_ShowConsole();
MSG message; MSG message;
while (IsWindow(*reinterpret_cast<HWND*>(0x64A3288)) != FALSE && GetMessageA(&message, 0, 0, 0)) while (IsWindow(*reinterpret_cast<HWND*>(0x64A3288)) != FALSE && GetMessageA(&message, nullptr, 0, 0))
{ {
TranslateMessage(&message); TranslateMessage(&message);
DispatchMessageA(&message); DispatchMessageA(&message);
@ -397,7 +397,7 @@ namespace Components
if (Console::SkipShutdown) return; if (Console::SkipShutdown) return;
if (Game::Sys_Milliseconds() - Console::LastRefresh > 100 && if (Game::Sys_Milliseconds() - Console::LastRefresh > 100 &&
MessageBoxA(0, "The application is not responding anymore, do you want to force its termination?", "Application is not responding", MB_ICONEXCLAMATION | MB_YESNO) == IDYES) MessageBoxA(nullptr, "The application is not responding anymore, do you want to force its termination?", "Application is not responding", MB_ICONEXCLAMATION | MB_YESNO) == IDYES)
{ {
// Force process termination // Force process termination
// if the main thread is not responding // if the main thread is not responding

View File

@ -6,36 +6,36 @@ namespace Components
HRESULT D3D9Ex::D3D9Device::QueryInterface(REFIID riid, void** ppvObj) HRESULT D3D9Ex::D3D9Device::QueryInterface(REFIID riid, void** ppvObj)
{ {
*ppvObj = NULL; *ppvObj = nullptr;
HRESULT hRes = m_pIDirect3DDevice9->QueryInterface(riid, ppvObj); HRESULT hRes = m_pIDirect3DDevice9->QueryInterface(riid, ppvObj);
if (hRes == NOERROR) *ppvObj = this; if (hRes == NOERROR) *ppvObj = this;
return hRes; return hRes;
} }
ULONG D3D9Ex::D3D9Device::AddRef(void) ULONG D3D9Ex::D3D9Device::AddRef()
{ {
return m_pIDirect3DDevice9->AddRef(); return m_pIDirect3DDevice9->AddRef();
} }
ULONG D3D9Ex::D3D9Device::Release(void) ULONG D3D9Ex::D3D9Device::Release()
{ {
ULONG count = m_pIDirect3DDevice9->Release(); ULONG count = m_pIDirect3DDevice9->Release();
if (!count) delete this; if (!count) delete this;
return count; return count;
} }
HRESULT D3D9Ex::D3D9Device::TestCooperativeLevel(void) HRESULT D3D9Ex::D3D9Device::TestCooperativeLevel()
{ {
return m_pIDirect3DDevice9->TestCooperativeLevel(); return m_pIDirect3DDevice9->TestCooperativeLevel();
} }
UINT D3D9Ex::D3D9Device::GetAvailableTextureMem(void) UINT D3D9Ex::D3D9Device::GetAvailableTextureMem()
{ {
return m_pIDirect3DDevice9->GetAvailableTextureMem(); return m_pIDirect3DDevice9->GetAvailableTextureMem();
} }
HRESULT D3D9Ex::D3D9Device::EvictManagedResources(void) HRESULT D3D9Ex::D3D9Device::EvictManagedResources()
{ {
return m_pIDirect3DDevice9->EvictManagedResources(); return m_pIDirect3DDevice9->EvictManagedResources();
} }
@ -85,7 +85,7 @@ namespace Components
return m_pIDirect3DDevice9->GetSwapChain(iSwapChain, pSwapChain); return m_pIDirect3DDevice9->GetSwapChain(iSwapChain, pSwapChain);
} }
UINT D3D9Ex::D3D9Device::GetNumberOfSwapChains(void) UINT D3D9Ex::D3D9Device::GetNumberOfSwapChains()
{ {
return m_pIDirect3DDevice9->GetNumberOfSwapChains(); return m_pIDirect3DDevice9->GetNumberOfSwapChains();
} }
@ -227,12 +227,12 @@ namespace Components
return m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface); return m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface);
} }
HRESULT D3D9Ex::D3D9Device::BeginScene(void) HRESULT D3D9Ex::D3D9Device::BeginScene()
{ {
return m_pIDirect3DDevice9->BeginScene(); return m_pIDirect3DDevice9->BeginScene();
} }
HRESULT D3D9Ex::D3D9Device::EndScene(void) HRESULT D3D9Ex::D3D9Device::EndScene()
{ {
return m_pIDirect3DDevice9->EndScene(); return m_pIDirect3DDevice9->EndScene();
} }
@ -322,7 +322,7 @@ namespace Components
return m_pIDirect3DDevice9->CreateStateBlock(Type, ppSB); return m_pIDirect3DDevice9->CreateStateBlock(Type, ppSB);
} }
HRESULT D3D9Ex::D3D9Device::BeginStateBlock(void) HRESULT D3D9Ex::D3D9Device::BeginStateBlock()
{ {
return m_pIDirect3DDevice9->BeginStateBlock(); return m_pIDirect3DDevice9->BeginStateBlock();
} }
@ -412,7 +412,7 @@ namespace Components
return m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware); return m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware);
} }
BOOL D3D9Ex::D3D9Device::GetSoftwareVertexProcessing(void) BOOL D3D9Ex::D3D9Device::GetSoftwareVertexProcessing()
{ {
return m_pIDirect3DDevice9->GetSoftwareVertexProcessing(); return m_pIDirect3DDevice9->GetSoftwareVertexProcessing();
} }
@ -422,7 +422,7 @@ namespace Components
return m_pIDirect3DDevice9->SetNPatchMode(nSegments); return m_pIDirect3DDevice9->SetNPatchMode(nSegments);
} }
float D3D9Ex::D3D9Device::GetNPatchMode(void) float D3D9Ex::D3D9Device::GetNPatchMode()
{ {
return m_pIDirect3DDevice9->GetNPatchMode(); return m_pIDirect3DDevice9->GetNPatchMode();
} }
@ -629,7 +629,7 @@ namespace Components
HRESULT __stdcall D3D9Ex::D3D9::QueryInterface(REFIID riid, void** ppvObj) HRESULT __stdcall D3D9Ex::D3D9::QueryInterface(REFIID riid, void** ppvObj)
{ {
*ppvObj = NULL; *ppvObj = nullptr;
HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj); HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj);
@ -641,12 +641,12 @@ namespace Components
return hRes; return hRes;
} }
ULONG __stdcall D3D9Ex::D3D9::AddRef(void) ULONG __stdcall D3D9Ex::D3D9::AddRef()
{ {
return m_pIDirect3D9->AddRef(); return m_pIDirect3D9->AddRef();
} }
ULONG __stdcall D3D9Ex::D3D9::Release(void) ULONG __stdcall D3D9Ex::D3D9::Release()
{ {
ULONG count = m_pIDirect3D9->Release(); ULONG count = m_pIDirect3D9->Release();
if (!count) delete this; if (!count) delete this;
@ -658,7 +658,7 @@ namespace Components
return m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction); return m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction);
} }
UINT __stdcall D3D9Ex::D3D9::GetAdapterCount(void) UINT __stdcall D3D9Ex::D3D9::GetAdapterCount()
{ {
return m_pIDirect3D9->GetAdapterCount(); return m_pIDirect3D9->GetAdapterCount();
} }

View File

@ -17,127 +17,127 @@ namespace Components
{ {
public: public:
D3D9Device(IDirect3DDevice9* pOriginal) : m_pIDirect3DDevice9(pOriginal) {}; D3D9Device(IDirect3DDevice9* pOriginal) : m_pIDirect3DDevice9(pOriginal) {};
virtual ~D3D9Device(void) {}; virtual ~D3D9Device() {};
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj) override;
ULONG __stdcall AddRef(void); ULONG __stdcall AddRef() override;
ULONG __stdcall Release(void); ULONG __stdcall Release() override;
HRESULT __stdcall TestCooperativeLevel(void); HRESULT __stdcall TestCooperativeLevel() override;
UINT __stdcall GetAvailableTextureMem(void); UINT __stdcall GetAvailableTextureMem() override;
HRESULT __stdcall EvictManagedResources(void); HRESULT __stdcall EvictManagedResources() override;
HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9); HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9) override;
HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps); HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps) override;
HRESULT __stdcall GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode); HRESULT __stdcall GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode) override;
HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters); HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) override;
HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap); HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) override;
void __stdcall SetCursorPosition(int X, int Y, DWORD Flags); void __stdcall SetCursorPosition(int X, int Y, DWORD Flags) override;
BOOL __stdcall ShowCursor(BOOL bShow); BOOL __stdcall ShowCursor(BOOL bShow) override;
HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain); HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) override;
HRESULT __stdcall GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain); HRESULT __stdcall GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) override;
UINT __stdcall GetNumberOfSwapChains(void); UINT __stdcall GetNumberOfSwapChains() override;
HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters); HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) override;
HRESULT __stdcall Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion); HRESULT __stdcall Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) override;
HRESULT __stdcall GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer); HRESULT __stdcall GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) override;
HRESULT __stdcall GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus); HRESULT __stdcall GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) override;
HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs); HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs) override;
void __stdcall SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp); void __stdcall SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) override;
void __stdcall GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp); void __stdcall GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp) override;
HRESULT __stdcall CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle); HRESULT __stdcall CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle); HRESULT __stdcall CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle); HRESULT __stdcall CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle); HRESULT __stdcall CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle); HRESULT __stdcall CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); HRESULT __stdcall CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) override;
HRESULT __stdcall CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); HRESULT __stdcall CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) override;
HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint); HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) override;
HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture); HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) override;
HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface); HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) override;
HRESULT __stdcall GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface); HRESULT __stdcall GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface) override;
HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter); HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) override;
HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color); HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) override;
HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) override;
HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget); HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) override;
HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget); HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) override;
HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil); HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) override;
HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface); HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) override;
HRESULT __stdcall BeginScene(void); HRESULT __stdcall BeginScene() override;
HRESULT __stdcall EndScene(void); HRESULT __stdcall EndScene() override;
HRESULT __stdcall Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil); HRESULT __stdcall Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) override;
HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) override;
HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix); HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) override;
HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) override;
HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport); HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport) override;
HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport); HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport) override;
HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial); HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial) override;
HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial); HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial) override;
HRESULT __stdcall SetLight(DWORD Index, CONST D3DLIGHT9* pLight); HRESULT __stdcall SetLight(DWORD Index, CONST D3DLIGHT9* pLight) override;
HRESULT __stdcall GetLight(DWORD Index, D3DLIGHT9* pLight); HRESULT __stdcall GetLight(DWORD Index, D3DLIGHT9* pLight) override;
HRESULT __stdcall LightEnable(DWORD Index, BOOL Enable); HRESULT __stdcall LightEnable(DWORD Index, BOOL Enable) override;
HRESULT __stdcall GetLightEnable(DWORD Index, BOOL* pEnable); HRESULT __stdcall GetLightEnable(DWORD Index, BOOL* pEnable) override;
HRESULT __stdcall SetClipPlane(DWORD Index, CONST float* pPlane); HRESULT __stdcall SetClipPlane(DWORD Index, CONST float* pPlane) override;
HRESULT __stdcall GetClipPlane(DWORD Index, float* pPlane); HRESULT __stdcall GetClipPlane(DWORD Index, float* pPlane) override;
HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State, DWORD Value); HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) override;
HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue); HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) override;
HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB); HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) override;
HRESULT __stdcall BeginStateBlock(void); HRESULT __stdcall BeginStateBlock() override;
HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB); HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB) override;
HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus); HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) override;
HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus); HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus) override;
HRESULT __stdcall GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture); HRESULT __stdcall GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture) override;
HRESULT __stdcall SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture); HRESULT __stdcall SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) override;
HRESULT __stdcall GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue); HRESULT __stdcall GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) override;
HRESULT __stdcall SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value); HRESULT __stdcall SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) override;
HRESULT __stdcall GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue); HRESULT __stdcall GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) override;
HRESULT __stdcall SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value); HRESULT __stdcall SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) override;
HRESULT __stdcall ValidateDevice(DWORD* pNumPasses); HRESULT __stdcall ValidateDevice(DWORD* pNumPasses) override;
HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries); HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries) override;
HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries); HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) override;
HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber); HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber) override;
HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber); HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber) override;
HRESULT __stdcall SetScissorRect(CONST RECT* pRect); HRESULT __stdcall SetScissorRect(CONST RECT* pRect) override;
HRESULT __stdcall GetScissorRect(RECT* pRect); HRESULT __stdcall GetScissorRect(RECT* pRect) override;
HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware); HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware) override;
BOOL __stdcall GetSoftwareVertexProcessing(void); BOOL __stdcall GetSoftwareVertexProcessing() override;
HRESULT __stdcall SetNPatchMode(float nSegments); HRESULT __stdcall SetNPatchMode(float nSegments) override;
float __stdcall GetNPatchMode(void); float __stdcall GetNPatchMode() override;
HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount); HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) override;
HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount); HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) override;
HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) override;
HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) override;
HRESULT __stdcall ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags); HRESULT __stdcall ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) override;
HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl); HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) override;
HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl); HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) override;
HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl); HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) override;
HRESULT __stdcall SetFVF(DWORD FVF); HRESULT __stdcall SetFVF(DWORD FVF) override;
HRESULT __stdcall GetFVF(DWORD* pFVF); HRESULT __stdcall GetFVF(DWORD* pFVF) override;
HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader); HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) override;
HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader); HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader) override;
HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader); HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader) override;
HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount); HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) override;
HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount); HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) override;
HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount); HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) override;
HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount); HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) override;
HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) override;
HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount); HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) override;
HRESULT __stdcall SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride); HRESULT __stdcall SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) override;
HRESULT __stdcall GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride); HRESULT __stdcall GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) override;
HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber, UINT Divider); HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber, UINT Divider) override;
HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber, UINT* Divider); HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber, UINT* Divider) override;
HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData); HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData) override;
HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData); HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData) override;
HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader); HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) override;
HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader); HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader) override;
HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader); HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader) override;
HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount); HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) override;
HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount); HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) override;
HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount); HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) override;
HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount); HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) override;
HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) override;
HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount); HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) override;
HRESULT __stdcall DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo); HRESULT __stdcall DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) override;
HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo); HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) override;
HRESULT __stdcall DeletePatch(UINT Handle); HRESULT __stdcall DeletePatch(UINT Handle) override;
HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery); HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) override;
private: private:
IDirect3DDevice9 *m_pIDirect3DDevice9; IDirect3DDevice9 *m_pIDirect3DDevice9;
@ -147,25 +147,25 @@ namespace Components
{ {
public: public:
D3D9(IDirect3D9Ex *pOriginal) : m_pIDirect3D9(pOriginal) {}; D3D9(IDirect3D9Ex *pOriginal) : m_pIDirect3D9(pOriginal) {};
virtual ~D3D9(void) {}; virtual ~D3D9() {};
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj) override;
ULONG __stdcall AddRef(void); ULONG __stdcall AddRef() override;
ULONG __stdcall Release(void); ULONG __stdcall Release() override;
HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction); HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction) override;
UINT __stdcall GetAdapterCount(void); UINT __stdcall GetAdapterCount() override;
HRESULT __stdcall GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier); HRESULT __stdcall GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) override;
UINT __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format); UINT __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) override;
HRESULT __stdcall EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode); HRESULT __stdcall EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) override;
HRESULT __stdcall GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode); HRESULT __stdcall GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) override;
HRESULT __stdcall CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed); HRESULT __stdcall CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) override;
HRESULT __stdcall CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat); HRESULT __stdcall CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) override;
HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels); HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) override;
HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat); HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) override;
HRESULT __stdcall CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat); HRESULT __stdcall CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) override;
HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps); HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) override;
HMONITOR __stdcall GetAdapterMonitor(UINT Adapter); HMONITOR __stdcall GetAdapterMonitor(UINT Adapter) override;
HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) override;
private: private:
IDirect3D9 *m_pIDirect3D9; IDirect3D9 *m_pIDirect3D9;

View File

@ -160,7 +160,7 @@ namespace Components
download->valid = true; download->valid = true;
mg_mgr_init(&download->mgr, &fDownload); mg_mgr_init(&download->mgr, &fDownload);
mg_connect_http(&download->mgr, Download::DownloadHandler, url.data(), NULL, NULL); mg_connect_http(&download->mgr, Download::DownloadHandler, url.data(), nullptr, nullptr);
while (fDownload.downloading && !fDownload.download->terminateThread) while (fDownload.downloading && !fDownload.download->terminateThread)
{ {
@ -343,7 +343,7 @@ namespace Components
for (auto i = list.begin(); i != list.end(); ++i) for (auto i = list.begin(); i != list.end(); ++i)
{ {
std::string filename = path + "\\" + *i; std::string filename = path + "\\" + *i;
if (strstr(i->data(), "_svr_") == NULL && Utils::IO::FileExists(filename)) if (strstr(i->data(), "_svr_") == nullptr && Utils::IO::FileExists(filename))
{ {
std::map<std::string, json11::Json> file; std::map<std::string, json11::Json> file;
std::string fileBuffer = Utils::IO::ReadFile(path + "\\" + *i); std::string fileBuffer = Utils::IO::ReadFile(path + "\\" + *i);
@ -389,7 +389,7 @@ namespace Components
Utils::String::Replace(url, "%20", " "); Utils::String::Replace(url, "%20", " ");
if (url.find_first_of("/") != std::string::npos || (!Utils::String::EndsWith(url, ".iwd") && url != "mod.ff") || strstr(url.data(), "_svr_") != NULL) if (url.find_first_of("/") != std::string::npos || (!Utils::String::EndsWith(url, ".iwd") && url != "mod.ff") || strstr(url.data(), "_svr_") != nullptr)
{ {
Download::Forbid(nc); Download::Forbid(nc);
return; return;
@ -564,7 +564,7 @@ namespace Components
{ {
if (Dedicated::IsEnabled()) if (Dedicated::IsEnabled())
{ {
mg_mgr_init(&Download::Mgr, NULL); mg_mgr_init(&Download::Mgr, nullptr);
Network::OnStart([] () Network::OnStart([] ()
{ {

View File

@ -19,7 +19,7 @@ namespace Components
class Var class Var
{ {
public: public:
Var() : dvar(0) {}; Var() : dvar(nullptr) {};
Var(const Var &obj) { this->dvar = obj.dvar; }; Var(const Var &obj) { this->dvar = obj.dvar; };
Var(Game::dvar_t* _dvar) : dvar(_dvar) {}; Var(Game::dvar_t* _dvar) : dvar(_dvar) {};
Var(DWORD ppdvar) : Var(*reinterpret_cast<Game::dvar_t**>(ppdvar)) {}; Var(DWORD ppdvar) : Var(*reinterpret_cast<Game::dvar_t**>(ppdvar)) {};
@ -57,6 +57,6 @@ namespace Components
private: private:
static Utils::Signal<Callback> RegistrationSignal; static Utils::Signal<Callback> RegistrationSignal;
static Game::dvar_t* RegisterName(const char* name, const char* default, Game::dvar_flag flag, const char* description); static Game::dvar_t* RegisterName(const char* name, const char* defaultVal, Game::dvar_flag flag, const char* description);
}; };
} }

View File

@ -1,12 +1,5 @@
#include "STDInclude.hpp" #include "STDInclude.hpp"
// Stuff causes warnings
#pragma warning(push)
#pragma warning(disable: 4091)
#include <dbghelp.h>
#pragma comment(lib, "dbghelp.lib")
#pragma warning(pop)
namespace Components namespace Components
{ {
Utils::Hook Exception::SetFilterHook; Utils::Hook Exception::SetFilterHook;

View File

@ -342,7 +342,7 @@ namespace Components
unsigned long outLen = sizeof(FastFiles::CurrentKey); unsigned long outLen = sizeof(FastFiles::CurrentKey);
rsa_import(FastFiles::ZoneKey, sizeof(FastFiles::ZoneKey), &key); rsa_import(FastFiles::ZoneKey, sizeof(FastFiles::ZoneKey), &key);
rsa_decrypt_key_ex(encKey, 256, FastFiles::CurrentKey.data, &outLen, NULL, NULL, hash, (Zones::Version() >= 359 ? 1 : 2), &stat, &key); rsa_decrypt_key_ex(encKey, 256, FastFiles::CurrentKey.data, &outLen, nullptr, NULL, hash, (Zones::Version() >= 359 ? 1 : 2), &stat, &key);
rsa_free(&key); rsa_free(&key);
ctr_start(aes, FastFiles::CurrentKey.iv, FastFiles::CurrentKey.key, sizeof(FastFiles::CurrentKey.key), 0, 0, &FastFiles::CurrentCTR); ctr_start(aes, FastFiles::CurrentKey.iv, FastFiles::CurrentKey.key, sizeof(FastFiles::CurrentKey.key), 0, 0, &FastFiles::CurrentCTR);

View File

@ -31,7 +31,7 @@ namespace Components
Game::DB_GetRawBuffer(rawfile, const_cast<char*>(this->buffer.data()), this->buffer.size()); Game::DB_GetRawBuffer(rawfile, const_cast<char*>(this->buffer.data()), this->buffer.size());
} }
FileSystem::FileReader::FileReader(std::string file) : name(file), handle(0) FileSystem::FileReader::FileReader(std::string file) : handle(0), name(file)
{ {
this->size = Game::FS_FOpenFileReadCurrentThread(this->name.data(), &this->handle); this->size = Game::FS_FOpenFileReadCurrentThread(this->name.data(), &this->handle);
} }
@ -154,7 +154,7 @@ namespace Components
std::vector<std::string> fileList; std::vector<std::string> fileList;
int numFiles = 0; int numFiles = 0;
char** files = Game::Sys_ListFiles(path.data(), extension.data(), NULL, &numFiles, folders); char** files = Game::Sys_ListFiles(path.data(), extension.data(), nullptr, &numFiles, folders);
if (files) if (files)
{ {

View File

@ -52,7 +52,7 @@ namespace Components
class FileReader class FileReader
{ {
public: public:
FileReader() : size(-1), name(), handle(0) {}; FileReader() : handle(0), size(-1), name() {};
FileReader(std::string file); FileReader(std::string file);
~FileReader(); ~FileReader();
@ -72,7 +72,7 @@ namespace Components
class FileWriter class FileWriter
{ {
public: public:
FileWriter(std::string file, bool append = false) : filePath(file), handle(0) { this->open(append); }; FileWriter(std::string file, bool append = false) : handle(0), filePath(file) { this->open(append); };
~FileWriter() { this->close(); }; ~FileWriter() { this->close(); };
void write(std::string data); void write(std::string data);

View File

@ -27,7 +27,7 @@ namespace Components
timeout.tv_sec = msec / 1000; timeout.tv_sec = msec / 1000;
timeout.tv_usec = (msec % 1000) * 1000; timeout.tv_usec = (msec % 1000) * 1000;
int retval = select(highestfd + 1, &fdr, NULL, NULL, &timeout); int retval = select(highestfd + 1, &fdr, nullptr, nullptr, &timeout);
if (retval == SOCKET_ERROR) if (retval == SOCKET_ERROR)
{ {

View File

@ -24,7 +24,7 @@ namespace Components
this->type = IPCTYPE_CLIENT; this->type = IPCTYPE_CLIENT;
this->setName(name); this->setName(name);
this->pipe = CreateFileA(this->pipeFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); this->pipe = CreateFileA(this->pipeFile, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (INVALID_HANDLE_VALUE == this->pipe) if (INVALID_HANDLE_VALUE == this->pipe)
{ {
@ -58,7 +58,7 @@ namespace Components
this->type = IPCTYPE_SERVER; this->type = IPCTYPE_SERVER;
this->setName(name); this->setName(name);
this->pipe = CreateNamedPipeA(this->pipeFile, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, sizeof(this->packet), sizeof(this->packet), NMPWAIT_USE_DEFAULT_WAIT, NULL); this->pipe = CreateNamedPipeA(this->pipeFile, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, sizeof(this->packet), sizeof(this->packet), NMPWAIT_USE_DEFAULT_WAIT, nullptr);
if (INVALID_HANDLE_VALUE != this->pipe && this->pipe) if (INVALID_HANDLE_VALUE != this->pipe && this->pipe)
{ {
@ -97,7 +97,7 @@ namespace Components
strcpy_s(_packet.buffer, data.data()); strcpy_s(_packet.buffer, data.data());
DWORD cbBytes; DWORD cbBytes;
return (WriteFile(this->pipe, &_packet, sizeof(_packet), &cbBytes, NULL) || GetLastError() == ERROR_IO_PENDING); return (WriteFile(this->pipe, &_packet, sizeof(_packet), &cbBytes, nullptr) || GetLastError() == ERROR_IO_PENDING);
} }
void Pipe::destroy() void Pipe::destroy()
@ -140,7 +140,7 @@ namespace Components
{ {
if (!pipe || pipe->type != IPCTYPE_SERVER || pipe->pipe == INVALID_HANDLE_VALUE || !pipe->pipe) return; if (!pipe || pipe->type != IPCTYPE_SERVER || pipe->pipe == INVALID_HANDLE_VALUE || !pipe->pipe) return;
if (ConnectNamedPipe(pipe->pipe, NULL) == FALSE) if (ConnectNamedPipe(pipe->pipe, nullptr) == FALSE)
{ {
Logger::Print("Failed to initialize pipe reading.\n"); Logger::Print("Failed to initialize pipe reading.\n");
return; return;
@ -153,7 +153,7 @@ namespace Components
while (pipe->threadAttached && pipe->pipe && pipe->pipe != INVALID_HANDLE_VALUE) while (pipe->threadAttached && pipe->pipe && pipe->pipe != INVALID_HANDLE_VALUE)
{ {
BOOL bResult = ReadFile(pipe->pipe, &pipe->packet, sizeof(pipe->packet), &cbBytes, NULL); BOOL bResult = ReadFile(pipe->pipe, &pipe->packet, sizeof(pipe->packet), &cbBytes, nullptr);
if (bResult && cbBytes) if (bResult && cbBytes)
{ {
@ -167,7 +167,7 @@ namespace Components
Logger::Print("Failed to read from client through pipe\n"); Logger::Print("Failed to read from client through pipe\n");
DisconnectNamedPipe(pipe->pipe); DisconnectNamedPipe(pipe->pipe);
ConnectNamedPipe(pipe->pipe, NULL); ConnectNamedPipe(pipe->pipe, nullptr);
pipe->connectCallback(); pipe->connectCallback();
} }

View File

@ -37,8 +37,8 @@ namespace Components
cmds->buttons |= BUTTON_FLAG_LEANRIGHT; cmds->buttons |= BUTTON_FLAG_LEANRIGHT;
} }
Lean::in_leanleft.wasPressed = 0; Lean::in_leanleft.wasPressed = false;
Lean::in_leanright.wasPressed = 0; Lean::in_leanright.wasPressed = false;
} }
void __declspec(naked) Lean::CL_CmdButtonsStub() void __declspec(naked) Lean::CL_CmdButtonsStub()

View File

@ -161,7 +161,7 @@ namespace Components
{ {
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY, [] (Game::XAssetType, std::string filename) AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY, [] (Game::XAssetType, std::string filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
std::lock_guard<std::recursive_mutex> _(Localization::LocalizeMutex); std::lock_guard<std::recursive_mutex> _(Localization::LocalizeMutex);
if (Localization::TempLocalizeMap.find(filename) != Localization::TempLocalizeMap.end()) if (Localization::TempLocalizeMap.find(filename) != Localization::TempLocalizeMap.end())

View File

@ -225,7 +225,7 @@ namespace Components
} }
catch (const std::exception e) catch (const std::exception e)
{ {
MessageBoxA(0, Utils::String::VA("Invalid regular expression: %s", expression.data()), "Warning", MB_ICONEXCLAMATION); MessageBoxA(nullptr, Utils::String::VA("Invalid regular expression: %s", expression.data()), "Warning", MB_ICONEXCLAMATION);
return; return;
} }
@ -523,7 +523,7 @@ namespace Components
{ {
if (pack.index == dlc) if (pack.index == dlc)
{ {
ShellExecuteA(NULL, "open", pack.url.data(), 0, 0, SW_SHOWNORMAL); ShellExecuteA(nullptr, "open", pack.url.data(), nullptr, nullptr, SW_SHOWNORMAL);
return; return;
} }
} }

View File

@ -129,9 +129,7 @@ namespace Components
int Materials::MaterialComparePrint(Game::Material* m1, Game::Material* m2) int Materials::MaterialComparePrint(Game::Material* m1, Game::Material* m2)
{ {
static Game::Material* a,* b; //__debugbreak();
a = m1, b = m2;
return Utils::Hook::Call<int(Game::Material*, Game::Material*)>(0x5235B0)(m1, m2); return Utils::Hook::Call<int(Game::Material*, Game::Material*)>(0x5235B0)(m1, m2);
} }

View File

@ -20,7 +20,7 @@ namespace Components
return 0; return 0;
// Reserve it, if yes // Reserve it, if yes
Game::sourceFiles[i] = (Game::source_t*)1; Game::sourceFiles[i] = reinterpret_cast<Game::source_t*>(1);
return i; return i;
} }
@ -57,7 +57,6 @@ namespace Components
int handle = Menus::ReserveSourceHandle(); int handle = Menus::ReserveSourceHandle();
if (!Menus::IsValidSourceHandle(handle)) return 0; // No free source slot! if (!Menus::IsValidSourceHandle(handle)) return 0; // No free source slot!
Game::source_t *source = nullptr;
Game::script_t *script = Menus::LoadMenuScript(name, buffer); Game::script_t *script = Menus::LoadMenuScript(name, buffer);
if (!script) if (!script)
@ -66,9 +65,9 @@ namespace Components
return 0; return 0;
} }
script->next = NULL; script->next = nullptr;
source = Utils::Memory::Allocate<Game::source_t>(); Game::source_t *source = Utils::Memory::Allocate<Game::source_t>();
if (!source) if (!source)
{ {
Game::FreeMemory(script); Game::FreeMemory(script);
@ -77,11 +76,11 @@ namespace Components
strncpy_s(source->filename, 64, "string", 64); strncpy_s(source->filename, 64, "string", 64);
source->scriptstack = script; source->scriptstack = script;
source->tokens = NULL; source->tokens = nullptr;
source->defines = NULL; source->defines = nullptr;
source->indentstack = NULL; source->indentstack = nullptr;
source->skip = 0; source->skip = 0;
source->definehash = (Game::define_t**)Utils::Memory::Allocate(4096); source->definehash = static_cast<Game::define_t**>(Utils::Memory::Allocate(4096));
Game::sourceFiles[handle] = source; Game::sourceFiles[handle] = source;
@ -513,7 +512,7 @@ namespace Components
Game::XAssetHeader Menus::MenuFileLoad(Game::XAssetType type, std::string filename) Game::XAssetHeader Menus::MenuFileLoad(Game::XAssetType type, std::string filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
Game::MenuList* menuList = Game::DB_FindXAssetHeader(type, filename.data()).menuList; Game::MenuList* menuList = Game::DB_FindXAssetHeader(type, filename.data()).menuList;
header.menuList = menuList; header.menuList = menuList;
@ -602,7 +601,7 @@ namespace Components
} }
// Clear last menu // Clear last menu
dc->menus[--dc->menuCount] = 0; dc->menus[--dc->menuCount] = nullptr;
} }
} }

View File

@ -14,13 +14,13 @@ namespace Components
Minidump::~Minidump() Minidump::~Minidump()
{ {
if (this->mapFileHandle != NULL && this->mapFileHandle != INVALID_HANDLE_VALUE) if (this->mapFileHandle != nullptr && this->mapFileHandle != INVALID_HANDLE_VALUE)
{ {
CloseHandle(this->mapFileHandle); CloseHandle(this->mapFileHandle);
this->mapFileHandle = INVALID_HANDLE_VALUE; this->mapFileHandle = INVALID_HANDLE_VALUE;
} }
if (this->fileHandle != NULL && this->fileHandle != INVALID_HANDLE_VALUE) if (this->fileHandle != nullptr && this->fileHandle != INVALID_HANDLE_VALUE)
{ {
CloseHandle(this->fileHandle); CloseHandle(this->fileHandle);
this->fileHandle = INVALID_HANDLE_VALUE; this->fileHandle = INVALID_HANDLE_VALUE;
@ -29,7 +29,7 @@ namespace Components
std::string Minidump::ToString() std::string Minidump::ToString()
{ {
if (!this->EnsureFileMapping()) return false; if (!this->EnsureFileMapping()) return nullptr;
auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0); auto pBuf = MapViewOfFile(this->mapFileHandle, FILE_MAP_READ, 0, 0, 0);
if (!pBuf) if (!pBuf)
@ -44,7 +44,7 @@ namespace Components
#ifdef _WIN64 #ifdef _WIN64
fileSize |= ((size_t)fileSizeHi << 32); fileSize |= ((size_t)fileSizeHi << 32);
#endif #endif
std::string retval = std::string((const char*)pBuf, fileSize * sizeof(const char)); std::string retval = std::string(static_cast<const char*>(pBuf), fileSize * sizeof(const char));
UnmapViewOfFile(pBuf); UnmapViewOfFile(pBuf);
return retval; return retval;
} }
@ -74,7 +74,7 @@ namespace Components
PVOID stream; PVOID stream;
ULONG streamSize; ULONG streamSize;
return Minidump::GetStream(ExceptionStream, &directory, &stream, &streamSize);*/ return Minidump::GetStream(ExceptionStream, &directory, &stream, &streamSize);*/
return Minidump::GetStream(ExceptionStream, NULL, NULL, NULL); return Minidump::GetStream(ExceptionStream, nullptr, nullptr, nullptr);
} }
Minidump* Minidump::Create(std::string path, LPEXCEPTION_POINTERS exceptionInfo, int type) Minidump* Minidump::Create(std::string path, LPEXCEPTION_POINTERS exceptionInfo, int type)
@ -84,14 +84,14 @@ namespace Components
// Do the dump generation // Do the dump generation
MINIDUMP_EXCEPTION_INFORMATION ex = { GetCurrentThreadId(), exceptionInfo, FALSE }; MINIDUMP_EXCEPTION_INFORMATION ex = { GetCurrentThreadId(), exceptionInfo, FALSE };
if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), minidump->fileHandle, (MINIDUMP_TYPE)type, &ex, NULL, NULL)) if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), minidump->fileHandle, static_cast<MINIDUMP_TYPE>(type), &ex, nullptr, nullptr))
{ {
Utils::OutputDebugLastError(); Utils::OutputDebugLastError();
delete minidump; delete minidump;
return nullptr; return nullptr;
} }
if (SetFilePointer(minidump->fileHandle, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) if (SetFilePointer(minidump->fileHandle, 0, nullptr, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
{ {
Utils::OutputDebugLastError(); Utils::OutputDebugLastError();
delete minidump; delete minidump;
@ -109,10 +109,10 @@ namespace Components
bool Minidump::EnsureFileMapping() bool Minidump::EnsureFileMapping()
{ {
if (this->mapFileHandle == NULL || this->mapFileHandle == INVALID_HANDLE_VALUE) if (this->mapFileHandle == nullptr || this->mapFileHandle == INVALID_HANDLE_VALUE)
{ {
this->mapFileHandle = CreateFileMappingA(this->fileHandle, NULL, PAGE_READONLY, 0, 0, NULL); this->mapFileHandle = CreateFileMappingA(this->fileHandle, nullptr, PAGE_READONLY, 0, 0, nullptr);
if (this->mapFileHandle == NULL || this->mapFileHandle == INVALID_HANDLE_VALUE) if (this->mapFileHandle == nullptr || this->mapFileHandle == INVALID_HANDLE_VALUE)
{ {
Utils::OutputDebugLastError(); Utils::OutputDebugLastError();
return false; return false;
@ -127,9 +127,9 @@ namespace Components
minidump->fileHandle = CreateFileA(path.data(), minidump->fileHandle = CreateFileA(path.data(),
GENERIC_WRITE | GENERIC_READ, fileShare, GENERIC_WRITE | GENERIC_READ, fileShare,
NULL, (fileShare & FILE_SHARE_WRITE) > 0 ? OPEN_ALWAYS : OPEN_EXISTING, NULL, NULL); nullptr, (fileShare & FILE_SHARE_WRITE) > 0 ? OPEN_ALWAYS : OPEN_EXISTING, NULL, nullptr);
if (minidump->fileHandle == NULL || minidump->fileHandle == INVALID_HANDLE_VALUE) if (minidump->fileHandle == nullptr || minidump->fileHandle == INVALID_HANDLE_VALUE)
{ {
Utils::OutputDebugLastError(); Utils::OutputDebugLastError();
delete minidump; delete minidump;
@ -172,7 +172,7 @@ namespace Components
bool MinidumpUpload::EnsureQueuedMinidumpsFolderExists() bool MinidumpUpload::EnsureQueuedMinidumpsFolderExists()
{ {
BOOL success = CreateDirectoryA(MinidumpUpload::queuedMinidumpsFolder.data(), NULL); BOOL success = CreateDirectoryA(MinidumpUpload::queuedMinidumpsFolder.data(), nullptr);
if (success != TRUE) if (success != TRUE)
{ {
@ -187,11 +187,11 @@ namespace Components
// Note that most of the Path* functions are DEPRECATED and they have been replaced by Cch variants that only work on Windows 8+. // Note that most of the Path* functions are DEPRECATED and they have been replaced by Cch variants that only work on Windows 8+.
// If you plan to drop support for Windows 7, please upgrade these calls to prevent accidental buffer overflows! // If you plan to drop support for Windows 7, please upgrade these calls to prevent accidental buffer overflows!
if (!EnsureQueuedMinidumpsFolderExists()) return NULL; if (!EnsureQueuedMinidumpsFolderExists()) return nullptr;
// Current executable name // Current executable name
char exeFileName[MAX_PATH]; char exeFileName[MAX_PATH];
GetModuleFileNameA(NULL, exeFileName, MAX_PATH); GetModuleFileNameA(nullptr, exeFileName, MAX_PATH);
PathStripPathA(exeFileName); PathStripPathA(exeFileName);
PathRemoveExtensionA(exeFileName); PathRemoveExtensionA(exeFileName);

View File

@ -11,7 +11,7 @@ namespace Components
Game::XAssetHeader MusicalTalent::ModifyAliases(Game::XAssetType type, std::string filename) Game::XAssetHeader MusicalTalent::ModifyAliases(Game::XAssetType type, std::string filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
if (MusicalTalent::SoundAliasList.find(Utils::String::ToLower(filename)) != MusicalTalent::SoundAliasList.end()) if (MusicalTalent::SoundAliasList.find(Utils::String::ToLower(filename)) != MusicalTalent::SoundAliasList.end())
{ {

View File

@ -51,7 +51,7 @@ namespace Components
ZeroMemory(&pInfo, sizeof(pInfo)); ZeroMemory(&pInfo, sizeof(pInfo));
sInfo.cb = sizeof(sInfo); sInfo.cb = sizeof(sInfo);
CreateProcessA("updater.exe", NULL, NULL, NULL, false, NULL, NULL, NULL, &sInfo, &pInfo); CreateProcessA("updater.exe", nullptr, nullptr, nullptr, false, NULL, nullptr, nullptr, &sInfo, &pInfo);
if (pInfo.hThread && pInfo.hThread != INVALID_HANDLE_VALUE) if (pInfo.hThread && pInfo.hThread != INVALID_HANDLE_VALUE)
{ {
@ -105,7 +105,7 @@ namespace Components
Dvar::Register<int>("cl_updateoldversion", REVISION, REVISION, REVISION, Game::DVAR_FLAG_WRITEPROTECTED, "Current version number."); Dvar::Register<int>("cl_updateoldversion", REVISION, REVISION, REVISION, Game::DVAR_FLAG_WRITEPROTECTED, "Current version number.");
Dvar::Register<int>("cl_updateversion", 0, 0, -1, Game::DVAR_FLAG_WRITEPROTECTED, "New version number."); Dvar::Register<int>("cl_updateversion", 0, 0, -1, Game::DVAR_FLAG_WRITEPROTECTED, "New version number.");
Dvar::Register<bool>("cl_updateavailable", 0, Game::DVAR_FLAG_WRITEPROTECTED, "New update is available."); Dvar::Register<bool>("cl_updateavailable", false, Game::DVAR_FLAG_WRITEPROTECTED, "New update is available.");
Localization::Set("MPUI_CHANGELOG_TEXT", "Loading..."); Localization::Set("MPUI_CHANGELOG_TEXT", "Loading...");
Localization::Set("MPUI_MOTD_TEXT", NEWS_MOTD_DEFUALT); Localization::Set("MPUI_MOTD_TEXT", NEWS_MOTD_DEFUALT);

View File

@ -12,7 +12,7 @@ namespace Components
PlayerName::PlayerName() PlayerName::PlayerName()
{ {
if (0) // Disabled for now (comment out that line to enable it) #if(0) // Disabled for now
{ {
for (int i = 0; i < ARRAY_SIZE(PlayerName::PlayerNames); ++i) for (int i = 0; i < ARRAY_SIZE(PlayerName::PlayerNames); ++i)
{ {
@ -21,6 +21,7 @@ namespace Components
Utils::Hook(Game::CL_GetClientName, PlayerName::GetClientName, HOOK_JUMP).install()->quick(); Utils::Hook(Game::CL_GetClientName, PlayerName::GetClientName, HOOK_JUMP).install()->quick();
} }
#endif
} }
PlayerName::~PlayerName() PlayerName::~PlayerName()

View File

@ -453,7 +453,7 @@ namespace Components
}); });
// Dvars // Dvars
Dvar::Register<bool>("ui_streamFriendly", 0, Game::DVAR_FLAG_SAVED, "Stream friendly UI"); Dvar::Register<bool>("ui_streamFriendly", false, Game::DVAR_FLAG_SAVED, "Stream friendly UI");
// Debug patches // Debug patches
#ifdef DEBUG #ifdef DEBUG

View File

@ -165,7 +165,7 @@ namespace Components
if (!Game::Scr_LoadScript(script.data())) if (!Game::Scr_LoadScript(script.data()))
{ {
Logger::Print("Script %s encountered an error while loading. (doesn't exist?)", script.data()); Logger::Print("Script %s encountered an error while loading. (doesn't exist?)", script.data());
Logger::Error(1, (char*)0x70B810, script.data()); Logger::Error(1, reinterpret_cast<char*>(0x70B810), script.data());
} }
else else
{ {

View File

@ -26,6 +26,8 @@ namespace Components
case 3: case 3:
return Utils::String::VA("%d", ServerInfo::PlayerContainer.playerList[index].ping); return Utils::String::VA("%d", ServerInfo::PlayerContainer.playerList[index].ping);
default:
break;
} }
} }

View File

@ -121,6 +121,11 @@ namespace Components
{ {
return Utils::String::VA("%i", server->ping); return Utils::String::VA("%i", server->ping);
} }
default:
{
break;
};
} }
return ""; return "";

View File

@ -22,9 +22,9 @@ namespace Components
if (Loader::PerformingUnitTests() || Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return; if (Loader::PerformingUnitTests() || Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return;
Singleton::FirstInstance = (CreateMutexA(NULL, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS); Singleton::FirstInstance = (CreateMutexA(nullptr, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS);
if (!Singleton::FirstInstance && !ConnectProtocol::Used() && MessageBoxA(0, "Do you want to start another instance?", "Game already running", MB_ICONEXCLAMATION | MB_YESNO) == IDNO) if (!Singleton::FirstInstance && !ConnectProtocol::Used() && MessageBoxA(nullptr, "Do you want to start another instance?", "Game already running", MB_ICONEXCLAMATION | MB_YESNO) == IDNO)
{ {
ExitProcess(0); ExitProcess(0);
} }

View File

@ -73,7 +73,7 @@ namespace Components
{ {
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_STRINGTABLE, [] (Game::XAssetType, std::string filename) AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_STRINGTABLE, [] (Game::XAssetType, std::string filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
filename = Utils::String::ToLower(filename); filename = Utils::String::ToLower(filename);

View File

@ -203,7 +203,7 @@ namespace Components
info.author = metaObject["author"].string_value(); info.author = metaObject["author"].string_value();
info.gametype = metaObject["gametype"].string_value(); info.gametype = metaObject["gametype"].string_value();
info.mapname = metaObject["mapname"].string_value(); info.mapname = metaObject["mapname"].string_value();
info.length = (int)metaObject["length"].number_value(); info.length = static_cast<int>(metaObject["length"].number_value());
info.timeStamp = _atoi64(metaObject["timestamp"].string_value().data()); info.timeStamp = _atoi64(metaObject["timestamp"].string_value().data());
Theatre::Demos.push_back(info); Theatre::Demos.push_back(info);
@ -311,7 +311,7 @@ namespace Components
FileSystem::DeleteFile("demos", Utils::String::VA("%s.json", files[i].data())); FileSystem::DeleteFile("demos", Utils::String::VA("%s.json", files[i].data()));
} }
Command::Execute(Utils::String::VA("record auto_%lld", time(0)), true); Command::Execute(Utils::String::VA("record auto_%lld", time(nullptr)), true);
} }
return Utils::Hook::Call<DWORD()>(0x42BBB0)(); return Utils::Hook::Call<DWORD()>(0x42BBB0)();

View File

@ -130,7 +130,7 @@ namespace Components
__declspec(naked) void UIFeeder::HandleKeyStub() __declspec(naked) void UIFeeder::HandleKeyStub()
{ {
static int NextClickTime = 0; static int nextClickTime = 0;
__asm __asm
{ {
@ -149,12 +149,12 @@ namespace Components
call Game::Sys_Milliseconds call Game::Sys_Milliseconds
// Check if allowed to click // Check if allowed to click
cmp eax, NextClickTime cmp eax, nextClickTime
jl continueOriginal jl continueOriginal
// Set next allowed click time to current time + 300ms // Set next allowed click time to current time + 300ms
add eax, 300 add eax, 300
mov NextClickTime, eax mov nextClickTime, eax
// Get item cursor position ptr // Get item cursor position ptr
mov ecx, ebx mov ecx, ebx

View File

@ -15,14 +15,13 @@ namespace Components
class Token class Token
{ {
public: public:
Token() : token(0) {}; Token() : token(nullptr) {};
Token(const char** args) : token(0) { this->parse(args); }; Token(const char** args) : token(nullptr) { this->parse(args); };
Token(const Token &obj) { this->token = obj.token; }; Token(const Token &obj) { this->token = obj.token; };
template<typename T> T get(); template<typename T> T get();
bool isValid(); bool isValid();
private: private:
char* token; char* token;

View File

@ -4,7 +4,7 @@ namespace Components
{ {
Game::XAssetHeader Weapon::WeaponFileLoad(Game::XAssetType /*type*/, std::string filename) Game::XAssetHeader Weapon::WeaponFileLoad(Game::XAssetType /*type*/, std::string filename)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
// Try loading raw weapon // Try loading raw weapon
if (FileSystem::File(Utils::String::VA("weapons/mp/%s", filename.data())).exists()) if (FileSystem::File(Utils::String::VA("weapons/mp/%s", filename.data())).exists())

View File

@ -5,7 +5,7 @@ namespace Components
Dvar::Var Window::NoBorder; Dvar::Var Window::NoBorder;
Dvar::Var Window::NativeCursor; Dvar::Var Window::NativeCursor;
HWND Window::MainWindow = 0; HWND Window::MainWindow = nullptr;
BOOL Window::CursorVisible = TRUE; BOOL Window::CursorVisible = TRUE;
int Window::Width() int Window::Width()
@ -143,14 +143,14 @@ namespace Components
if (Window::CursorVisible) if (Window::CursorVisible)
{ {
SetCursor(LoadCursor(NULL, IDC_ARROW)); SetCursor(LoadCursor(nullptr, IDC_ARROW));
while ((value = ShowCursor(TRUE)) < 0); while ((value = ShowCursor(TRUE)) < 0) {};
while (value > 0) { value = ShowCursor(FALSE); } // Set display counter to 0 while (value > 0) { value = ShowCursor(FALSE); } // Set display counter to 0
} }
else else
{ {
while ((value = ShowCursor(FALSE)) >= 0); while ((value = ShowCursor(FALSE)) >= 0) {};
while (value < -1) { value = ShowCursor(TRUE); } // Set display counter to -1 while (value < -1) { value = ShowCursor(TRUE); } // Set display counter to -1
} }

View File

@ -9,14 +9,15 @@ namespace Components
std::vector<std::pair<Game::XAssetType, std::string>> ZoneBuilder::CommonAssets; std::vector<std::pair<Game::XAssetType, std::string>> ZoneBuilder::CommonAssets;
ZoneBuilder::Zone::Zone(std::string name) : dataMap("zone_source/" + name + ".csv"), zoneName(name), indexStart(0), externalSize(0), branding { 0 }, ZoneBuilder::Zone::Zone(std::string name) : indexStart(0), externalSize(0),
// Reserve 100MB by default. // Reserve 100MB by default.
// That's totally fine, as the dedi doesn't load images and therefore doesn't need much memory. // That's totally fine, as the dedi doesn't load images and therefore doesn't need much memory.
// That way we can be sure it won't need to reallocate memory. // That way we can be sure it won't need to reallocate memory.
// Side note: if you need a fastfile larger than 100MB, you're doing it wrong- // Side note: if you need a fastfile larger than 100MB, you're doing it wrong-
// Well, decompressed maps can get way larger than 100MB, so let's increase that. // Well, decompressed maps can get way larger than 100MB, so let's increase that.
buffer(0xC800000) buffer(0xC800000),
zoneName(name), dataMap("zone_source/" + name + ".csv"), branding { nullptr }
{} {}
ZoneBuilder::Zone::~Zone() ZoneBuilder::Zone::~Zone()
@ -268,7 +269,7 @@ namespace Components
} }
} }
return { 0 }; return { nullptr };
} }
Game::XAsset* ZoneBuilder::Zone::getAsset(int index) Game::XAsset* ZoneBuilder::Zone::getAsset(int index)
@ -431,7 +432,7 @@ namespace Components
// AssetTable // AssetTable
for (auto asset : this->loadedAssets) for (auto asset : this->loadedAssets)
{ {
Game::XAsset entry = { asset.type, 0 }; Game::XAsset entry = { asset.type, nullptr };
Utils::Stream::ClearPointer(&entry.header.data); Utils::Stream::ClearPointer(&entry.header.data);
this->buffer.save(&entry); this->buffer.save(&entry);
@ -473,7 +474,7 @@ namespace Components
void ZoneBuilder::Zone::addBranding() void ZoneBuilder::Zone::addBranding()
{ {
char* data = "FastFile built using IW4x ZoneTool!"; char* data = "FastFile built using IW4x ZoneTool!";
this->branding = { this->zoneName.data(), (int)strlen(data), 0, data }; this->branding = { this->zoneName.data(), static_cast<int>(strlen(data)), 0, data };
if (this->findAsset(Game::XAssetType::ASSET_TYPE_RAWFILE, this->branding.name) != -1) if (this->findAsset(Game::XAssetType::ASSET_TYPE_RAWFILE, this->branding.name) != -1)
{ {
@ -659,7 +660,7 @@ namespace Components
Game::XAssetHeader ZoneBuilder::GetEmptyAssetIfCommon(Game::XAssetType type, std::string name, ZoneBuilder::Zone* builder) Game::XAssetHeader ZoneBuilder::GetEmptyAssetIfCommon(Game::XAssetType type, std::string name, ZoneBuilder::Zone* builder)
{ {
Game::XAssetHeader header = { 0 }; Game::XAssetHeader header = { nullptr };
if (type >= 0 && type < Game::XAssetType::ASSET_TYPE_COUNT) if (type >= 0 && type < Game::XAssetType::ASSET_TYPE_COUNT)
{ {

View File

@ -94,7 +94,7 @@ namespace Components
~ZoneBuilder(); ~ZoneBuilder();
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS) #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() { return "ZoneBuilder"; }; const char* getName() override { return "ZoneBuilder"; };
#endif #endif
static bool IsEnabled(); static bool IsEnabled();

View File

@ -617,7 +617,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 2524) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 2524) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3044)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3044));
} }
*Game::varXString = reinterpret_cast<char**>(varWeaponCompleteDef + 2520); *Game::varXString = reinterpret_cast<char**>(varWeaponCompleteDef + 2520);
@ -628,7 +628,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 2528) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 2528) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3046)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3046));
} }
} }
else else
@ -638,7 +638,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 2556) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 2556) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + ((Zones::ZoneVersion >= 318) ? 3076 : 3040))); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + ((Zones::ZoneVersion >= 318) ? 3076 : 3040)));
} }
*Game::varXString = reinterpret_cast<char**>(varWeaponCompleteDef + 2552); *Game::varXString = reinterpret_cast<char**>(varWeaponCompleteDef + 2552);
@ -649,7 +649,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 2560) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 2560) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + ((Zones::ZoneVersion >= 318) ? 3078 : 3042))); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + ((Zones::ZoneVersion >= 318) ? 3078 : 3042)));
} }
} }
@ -833,7 +833,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 3048) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 3048) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3044)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3044));
} }
if (*reinterpret_cast<DWORD*>(varWeaponCompleteDef + 3052) == -1) if (*reinterpret_cast<DWORD*>(varWeaponCompleteDef + 3052) == -1)
@ -841,7 +841,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 3052) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 3052) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3046)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3046));
} }
} }
else else
@ -851,7 +851,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 3044) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 3044) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3040)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3040));
} }
if (*reinterpret_cast<DWORD*>(varWeaponCompleteDef + 3048) == -1) if (*reinterpret_cast<DWORD*>(varWeaponCompleteDef + 3048) == -1)
@ -859,7 +859,7 @@ namespace Components
void* vec2 = Game::DB_AllocStreamPos(3); void* vec2 = Game::DB_AllocStreamPos(3);
*reinterpret_cast<void**>(varWeaponCompleteDef + 3048) = vec2; *reinterpret_cast<void**>(varWeaponCompleteDef + 3048) = vec2;
Game::Load_Stream(true, (void*)vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3042)); Game::Load_Stream(true, vec2, 8 * *reinterpret_cast<short*>(varWeaponCompleteDef + 3042));
} }
} }
@ -1305,7 +1305,7 @@ namespace Components
static_assert(offsetof(Game::Material, stateBitsEntry) == 24, ""); static_assert(offsetof(Game::Material, stateBitsEntry) == 24, "");
Game::Material* material = (Game::Material*)buffer; Game::Material* material = reinterpret_cast<Game::Material*>(buffer);
memcpy(&material359, material, sizeof(material359)); memcpy(&material359, material, sizeof(material359));
material->name = material359.name; material->name = material359.name;

View File

@ -2,335 +2,334 @@
namespace Game namespace Game
{ {
// C-Style casts are fine here, that's where we're doing our dirty stuff anyways... BG_LoadWeaponDef_LoadObj_t BG_LoadWeaponDef_LoadObj = BG_LoadWeaponDef_LoadObj_t(0x57B5F0);
BG_LoadWeaponDef_LoadObj_t BG_LoadWeaponDef_LoadObj = (BG_LoadWeaponDef_LoadObj_t)0x57B5F0;
Cbuf_AddServerText_t Cbuf_AddServerText = Cbuf_AddServerText_t(0x4BB9B0);
Cbuf_AddServerText_t Cbuf_AddServerText = (Cbuf_AddServerText_t)0x4BB9B0; Cbuf_AddText_t Cbuf_AddText = Cbuf_AddText_t(0x404B20);
Cbuf_AddText_t Cbuf_AddText = (Cbuf_AddText_t)0x404B20;
CG_GetClientNum_t CG_GetClientNum = CG_GetClientNum_t(0x433700);
CG_GetClientNum_t CG_GetClientNum = (CG_GetClientNum_t)0x433700;
CL_GetClientName_t CL_GetClientName = CL_GetClientName_t(0x4563D0);
CL_GetClientName_t CL_GetClientName = (CL_GetClientName_t)0x4563D0; CL_IsCgameInitialized_t CL_IsCgameInitialized = CL_IsCgameInitialized_t(0x43EB20);
CL_IsCgameInitialized_t CL_IsCgameInitialized = (CL_IsCgameInitialized_t)0x43EB20; CL_ConnectFromParty_t CL_ConnectFromParty = CL_ConnectFromParty_t(0x433D30);
CL_ConnectFromParty_t CL_ConnectFromParty = (CL_ConnectFromParty_t)0x433D30; CL_DownloadsComplete_t CL_DownloadsComplete = CL_DownloadsComplete_t(0x42CE90);
CL_DownloadsComplete_t CL_DownloadsComplete = (CL_DownloadsComplete_t)0x42CE90; CL_DrawStretchPicPhysical_t CL_DrawStretchPicPhysical = CL_DrawStretchPicPhysical_t(0x4FC120);
CL_DrawStretchPicPhysical_t CL_DrawStretchPicPhysical = (CL_DrawStretchPicPhysical_t)0x4FC120; CL_HandleRelayPacket_t CL_HandleRelayPacket = CL_HandleRelayPacket_t(0x5A8C70);
CL_HandleRelayPacket_t CL_HandleRelayPacket = (CL_HandleRelayPacket_t)0x5A8C70; CL_ResetViewport_t CL_ResetViewport = CL_ResetViewport_t(0x4A8830);
CL_ResetViewport_t CL_ResetViewport = (CL_ResetViewport_t)0x4A8830; CL_SelectStringTableEntryInDvar_f_t CL_SelectStringTableEntryInDvar_f = CL_SelectStringTableEntryInDvar_f_t(0x4A4560);
CL_SelectStringTableEntryInDvar_f_t CL_SelectStringTableEntryInDvar_f = (CL_SelectStringTableEntryInDvar_f_t)0x4A4560;
Cmd_AddCommand_t Cmd_AddCommand = Cmd_AddCommand_t(0x470090);
Cmd_AddCommand_t Cmd_AddCommand = (Cmd_AddCommand_t)0x470090; Cmd_AddServerCommand_t Cmd_AddServerCommand = Cmd_AddServerCommand_t(0x4DCE00);
Cmd_AddServerCommand_t Cmd_AddServerCommand = (Cmd_AddServerCommand_t)0x4DCE00; Cmd_ExecuteSingleCommand_t Cmd_ExecuteSingleCommand = Cmd_ExecuteSingleCommand_t(0x609540);
Cmd_ExecuteSingleCommand_t Cmd_ExecuteSingleCommand = (Cmd_ExecuteSingleCommand_t)0x609540; Com_ClientPacketEvent_t Com_ClientPacketEvent = Com_ClientPacketEvent_t(0x49F0B0);
Com_ClientPacketEvent_t Com_ClientPacketEvent = (Com_ClientPacketEvent_t)0x49F0B0;
Com_Error_t Com_Error = Com_Error_t(0x4B22D0);
Com_Error_t Com_Error = (Com_Error_t)0x4B22D0; Com_Printf_t Com_Printf = Com_Printf_t(0x402500);
Com_Printf_t Com_Printf = (Com_Printf_t)0x402500; Com_PrintMessage_t Com_PrintMessage = Com_PrintMessage_t(0x4AA830);
Com_PrintMessage_t Com_PrintMessage = (Com_PrintMessage_t)0x4AA830; Com_EndParseSession_t Com_EndParseSession = Com_EndParseSession_t(0x4B80B0);
Com_EndParseSession_t Com_EndParseSession = (Com_EndParseSession_t)0x4B80B0; Com_BeginParseSession_t Com_BeginParseSession = Com_BeginParseSession_t(0x4AAB80);
Com_BeginParseSession_t Com_BeginParseSession = (Com_BeginParseSession_t)0x4AAB80; Com_SetSpaceDelimited_t Com_SetSpaceDelimited = Com_SetSpaceDelimited_t(0x4FC710);
Com_SetSpaceDelimited_t Com_SetSpaceDelimited = (Com_SetSpaceDelimited_t)0x4FC710; Com_Parse_t Com_Parse = Com_Parse_t(0x474D60);
Com_Parse_t Com_Parse = (Com_Parse_t)0x474D60; Com_SetSlowMotion_t Com_SetSlowMotion = Com_SetSlowMotion_t(0x446E20);
Com_SetSlowMotion_t Com_SetSlowMotion = (Com_SetSlowMotion_t)0x446E20;
Con_DrawMiniConsole_t Con_DrawMiniConsole = Con_DrawMiniConsole_t(0x464F30);
Con_DrawMiniConsole_t Con_DrawMiniConsole = (Con_DrawMiniConsole_t)0x464F30; Con_DrawSolidConsole_t Con_DrawSolidConsole = Con_DrawSolidConsole_t(0x5A5040);
Con_DrawSolidConsole_t Con_DrawSolidConsole = (Con_DrawSolidConsole_t)0x5A5040;
DB_AllocStreamPos_t DB_AllocStreamPos = DB_AllocStreamPos_t(0x418380);
DB_AllocStreamPos_t DB_AllocStreamPos = (DB_AllocStreamPos_t)0x418380; DB_PushStreamPos_t DB_PushStreamPos = DB_PushStreamPos_t(0x458A20);
DB_PushStreamPos_t DB_PushStreamPos = (DB_PushStreamPos_t)0x458A20; DB_PopStreamPos_t DB_PopStreamPos = DB_PopStreamPos_t(0x4D1D60);
DB_PopStreamPos_t DB_PopStreamPos = (DB_PopStreamPos_t)0x4D1D60;
DB_BeginRecoverLostDevice_t DB_BeginRecoverLostDevice = DB_BeginRecoverLostDevice_t(0x4BFF90);
DB_BeginRecoverLostDevice_t DB_BeginRecoverLostDevice = (DB_BeginRecoverLostDevice_t)0x4BFF90; DB_EndRecoverLostDevice_t DB_EndRecoverLostDevice = DB_EndRecoverLostDevice_t(0x46B660);
DB_EndRecoverLostDevice_t DB_EndRecoverLostDevice = (DB_EndRecoverLostDevice_t)0x46B660; DB_EnumXAssets_t DB_EnumXAssets = DB_EnumXAssets_t(0x4B76D0);
DB_EnumXAssets_t DB_EnumXAssets = (DB_EnumXAssets_t)0x4B76D0; DB_EnumXAssets_Internal_t DB_EnumXAssets_Internal = DB_EnumXAssets_Internal_t(0x5BB0A0);
DB_EnumXAssets_Internal_t DB_EnumXAssets_Internal = (DB_EnumXAssets_Internal_t)0x5BB0A0; DB_FindXAssetHeader_t DB_FindXAssetHeader = DB_FindXAssetHeader_t(0x407930);
DB_FindXAssetHeader_t DB_FindXAssetHeader = (DB_FindXAssetHeader_t)0x407930; DB_GetRawBuffer_t DB_GetRawBuffer = DB_GetRawBuffer_t(0x4CDC50);
DB_GetRawBuffer_t DB_GetRawBuffer = (DB_GetRawBuffer_t)0x4CDC50; DB_GetRawFileLen_t DB_GetRawFileLen = DB_GetRawFileLen_t(0x4DAA80);
DB_GetRawFileLen_t DB_GetRawFileLen = (DB_GetRawFileLen_t)0x4DAA80; DB_GetLoadedFraction_t DB_GetLoadedFraction = DB_GetLoadedFraction_t(0x468380);
DB_GetLoadedFraction_t DB_GetLoadedFraction = (DB_GetLoadedFraction_t)0x468380; DB_GetXAssetNameHandler_t* DB_GetXAssetNameHandlers = reinterpret_cast<DB_GetXAssetNameHandler_t*>(0x799328);
DB_GetXAssetNameHandler_t* DB_GetXAssetNameHandlers = (DB_GetXAssetNameHandler_t*)0x799328; DB_GetXAssetSizeHandler_t* DB_GetXAssetSizeHandlers = reinterpret_cast<DB_GetXAssetSizeHandler_t*>(0x799488);
DB_GetXAssetSizeHandler_t* DB_GetXAssetSizeHandlers = (DB_GetXAssetSizeHandler_t*)0x799488; DB_GetXAssetTypeName_t DB_GetXAssetTypeName = DB_GetXAssetTypeName_t(0x4CFCF0);
DB_GetXAssetTypeName_t DB_GetXAssetTypeName = (DB_GetXAssetTypeName_t)0x4CFCF0; DB_IsXAssetDefault_t DB_IsXAssetDefault = DB_IsXAssetDefault_t(0x48E6A0);
DB_IsXAssetDefault_t DB_IsXAssetDefault = (DB_IsXAssetDefault_t)0x48E6A0; DB_LoadXAssets_t DB_LoadXAssets = DB_LoadXAssets_t(0x4E5930);
DB_LoadXAssets_t DB_LoadXAssets = (DB_LoadXAssets_t)0x4E5930; DB_LoadXFileData_t DB_LoadXFileData = DB_LoadXFileData_t(0x445460);
DB_LoadXFileData_t DB_LoadXFileData = (DB_LoadXFileData_t)0x445460; DB_ReadXFile_t DB_ReadXFile = DB_ReadXFile_t(0x445460);
DB_ReadXFile_t DB_ReadXFile = (DB_ReadXFile_t)0x445460; DB_ReadXFileUncompressed_t DB_ReadXFileUncompressed = DB_ReadXFileUncompressed_t(0x4705E0);
DB_ReadXFileUncompressed_t DB_ReadXFileUncompressed = (DB_ReadXFileUncompressed_t)0x4705E0; DB_ReleaseXAssetHandler_t* DB_ReleaseXAssetHandlers = reinterpret_cast<DB_ReleaseXAssetHandler_t*>(0x799AB8);
DB_ReleaseXAssetHandler_t* DB_ReleaseXAssetHandlers = (DB_ReleaseXAssetHandler_t*)0x799AB8; DB_SetXAssetName_t DB_SetXAssetName = DB_SetXAssetName_t(0x453580);
DB_SetXAssetName_t DB_SetXAssetName = (DB_SetXAssetName_t)0x453580; DB_SetXAssetNameHandler_t* DB_SetXAssetNameHandlers = reinterpret_cast<DB_SetXAssetNameHandler_t*>(0x7993D8);
DB_SetXAssetNameHandler_t* DB_SetXAssetNameHandlers = (DB_SetXAssetNameHandler_t*)0x7993D8; DB_XModelSurfsFixup_t DB_XModelSurfsFixup = DB_XModelSurfsFixup_t(0x5BAC50);
DB_XModelSurfsFixup_t DB_XModelSurfsFixup = (DB_XModelSurfsFixup_t)0x5BAC50;
Dvar_RegisterBool_t Dvar_RegisterBool = Dvar_RegisterBool_t(0x4CE1A0);
Dvar_RegisterBool_t Dvar_RegisterBool = (Dvar_RegisterBool_t)0x4CE1A0; Dvar_RegisterFloat_t Dvar_RegisterFloat = Dvar_RegisterFloat_t(0x648440);
Dvar_RegisterFloat_t Dvar_RegisterFloat = (Dvar_RegisterFloat_t)0x648440; Dvar_RegisterVec2_t Dvar_RegisterVec2 = Dvar_RegisterVec2_t(0x4F6070);
Dvar_RegisterVec2_t Dvar_RegisterVec2 = (Dvar_RegisterVec2_t)0x4F6070; Dvar_RegisterVec3_t Dvar_RegisterVec3 = Dvar_RegisterVec3_t(0x4EF8E0);
Dvar_RegisterVec3_t Dvar_RegisterVec3 = (Dvar_RegisterVec3_t)0x4EF8E0; Dvar_RegisterVec4_t Dvar_RegisterVec4 = Dvar_RegisterVec4_t(0x4F28E0);
Dvar_RegisterVec4_t Dvar_RegisterVec4 = (Dvar_RegisterVec4_t)0x4F28E0; Dvar_RegisterInt_t Dvar_RegisterInt = Dvar_RegisterInt_t(0x479830);
Dvar_RegisterInt_t Dvar_RegisterInt = (Dvar_RegisterInt_t)0x479830; Dvar_RegisterEnum_t Dvar_RegisterEnum = Dvar_RegisterEnum_t(0x412E40);
Dvar_RegisterEnum_t Dvar_RegisterEnum = (Dvar_RegisterEnum_t)0x412E40; Dvar_RegisterString_t Dvar_RegisterString = Dvar_RegisterString_t(0x4FC7E0);
Dvar_RegisterString_t Dvar_RegisterString = (Dvar_RegisterString_t)0x4FC7E0; Dvar_RegisterColor_t Dvar_RegisterColor = Dvar_RegisterColor_t(0x4F28E0);//0x471500;
Dvar_RegisterColor_t Dvar_RegisterColor = (Dvar_RegisterColor_t)0x4F28E0;//0x471500;
Dvar_GetUnpackedColorByName_t Dvar_GetUnpackedColorByName = Dvar_GetUnpackedColorByName_t(0x406530);
Dvar_GetUnpackedColorByName_t Dvar_GetUnpackedColorByName = (Dvar_GetUnpackedColorByName_t)0x406530; Dvar_FindVar_t Dvar_FindVar = Dvar_FindVar_t(0x4D5390);
Dvar_FindVar_t Dvar_FindVar = (Dvar_FindVar_t)0x4D5390; Dvar_InfoString_Big_t Dvar_InfoString_Big = Dvar_InfoString_Big_t(0x4D98A0);
Dvar_InfoString_Big_t Dvar_InfoString_Big = (Dvar_InfoString_Big_t)0x4D98A0; Dvar_SetCommand_t Dvar_SetCommand = Dvar_SetCommand_t(0x4EE430);
Dvar_SetCommand_t Dvar_SetCommand = (Dvar_SetCommand_t)0x4EE430;
Encode_Init_t Encode_Init = Encode_Init_t(0x462AB0);
Encode_Init_t Encode_Init = (Encode_Init_t)0x462AB0;
Field_Clear_t Field_Clear = Field_Clear_t(0x437EB0);
Field_Clear_t Field_Clear = (Field_Clear_t)0x437EB0;
FreeMemory_t FreeMemory = FreeMemory_t(0x4D6640);
FreeMemory_t FreeMemory = (FreeMemory_t)0x4D6640;
FS_FileExists_t FS_FileExists = FS_FileExists_t(0x4DEFA0);
FS_FileExists_t FS_FileExists = (FS_FileExists_t)0x4DEFA0; FS_FreeFile_t FS_FreeFile = FS_FreeFile_t(0x4416B0);
FS_FreeFile_t FS_FreeFile = (FS_FreeFile_t)0x4416B0; FS_ReadFile_t FS_ReadFile = FS_ReadFile_t(0x4F4B90);
FS_ReadFile_t FS_ReadFile = (FS_ReadFile_t)0x4F4B90; FS_GetFileList_t FS_GetFileList = FS_GetFileList_t(0x441BB0);
FS_GetFileList_t FS_GetFileList = (FS_GetFileList_t)0x441BB0; FS_FreeFileList_t FS_FreeFileList = FS_FreeFileList_t(0x4A5DE0);
FS_FreeFileList_t FS_FreeFileList = (FS_FreeFileList_t)0x4A5DE0; FS_FOpenFileAppend_t FS_FOpenFileAppend = FS_FOpenFileAppend_t(0x410BB0);
FS_FOpenFileAppend_t FS_FOpenFileAppend = (FS_FOpenFileAppend_t)0x410BB0; FS_FOpenFileAppend_t FS_FOpenFileWrite = FS_FOpenFileAppend_t(0x4BA530);
FS_FOpenFileAppend_t FS_FOpenFileWrite = (FS_FOpenFileAppend_t)0x4BA530; FS_FOpenFileRead_t FS_FOpenFileRead = FS_FOpenFileRead_t(0x46CBF0);
FS_FOpenFileRead_t FS_FOpenFileRead = (FS_FOpenFileRead_t)0x46CBF0; FS_FOpenFileRead_t FS_FOpenFileReadDatabase = FS_FOpenFileRead_t(0x42ECA0);
FS_FOpenFileRead_t FS_FOpenFileReadDatabase = (FS_FOpenFileRead_t)0x42ECA0; FS_FOpenFileReadForThread_t FS_FOpenFileReadForThread = FS_FOpenFileReadForThread_t(0x643270);
FS_FOpenFileReadForThread_t FS_FOpenFileReadForThread = (FS_FOpenFileReadForThread_t)0x643270; FS_FCloseFile_t FS_FCloseFile = FS_FCloseFile_t(0x462000);
FS_FCloseFile_t FS_FCloseFile = (FS_FCloseFile_t)0x462000; FS_WriteFile_t FS_WriteFile = FS_WriteFile_t(0x426450);
FS_WriteFile_t FS_WriteFile = (FS_WriteFile_t)0x426450; FS_Write_t FS_Write = FS_Write_t(0x4C06E0);
FS_Write_t FS_Write = (FS_Write_t)0x4C06E0; FS_Read_t FS_Read = FS_Read_t(0x4A04C0);
FS_Read_t FS_Read = (FS_Read_t)0x4A04C0; FS_Seek_t FS_Seek = FS_Seek_t(0x4A63D0);
FS_Seek_t FS_Seek = (FS_Seek_t)0x4A63D0; FS_FTell_t FS_FTell = FS_FTell_t(0x4E6760);
FS_FTell_t FS_FTell = (FS_FTell_t)0x4E6760; FS_Remove_t FS_Remove = FS_Remove_t(0x4660F0);
FS_Remove_t FS_Remove = (FS_Remove_t)0x4660F0; FS_Restart_t FS_Restart = FS_Restart_t(0x461A50);
FS_Restart_t FS_Restart = (FS_Restart_t)0x461A50; FS_BuildPathToFile_t FS_BuildPathToFile = FS_BuildPathToFile_t(0x4702C0);
FS_BuildPathToFile_t FS_BuildPathToFile = (FS_BuildPathToFile_t)0x4702C0;
G_SpawnEntitiesFromString_t G_SpawnEntitiesFromString = G_SpawnEntitiesFromString_t(0x4D8840);
G_SpawnEntitiesFromString_t G_SpawnEntitiesFromString = (G_SpawnEntitiesFromString_t)0x4D8840;
GScr_LoadGameTypeScript_t GScr_LoadGameTypeScript = GScr_LoadGameTypeScript_t(0x4ED9A0);
GScr_LoadGameTypeScript_t GScr_LoadGameTypeScript = (GScr_LoadGameTypeScript_t)0x4ED9A0;
Image_LoadFromFileWithReader_t Image_LoadFromFileWithReader = Image_LoadFromFileWithReader_t(0x53ABF0);
Image_LoadFromFileWithReader_t Image_LoadFromFileWithReader = (Image_LoadFromFileWithReader_t)0x53ABF0; Image_Release_t Image_Release = Image_Release_t(0x51F010);
Image_Release_t Image_Release = (Image_Release_t)0x51F010;
Key_SetCatcher_t Key_SetCatcher = Key_SetCatcher_t(0x43BD00);
Key_SetCatcher_t Key_SetCatcher = (Key_SetCatcher_t)0x43BD00;
LargeLocalInit_t LargeLocalInit = LargeLocalInit_t(0x4A62A0);
LargeLocalInit_t LargeLocalInit = (LargeLocalInit_t)0x4A62A0;
Load_Stream_t Load_Stream = Load_Stream_t(0x470E30);
Load_Stream_t Load_Stream = (Load_Stream_t)0x470E30; Load_XString_t Load_XString = Load_XString_t(0x47FDA0);
Load_XString_t Load_XString = (Load_XString_t)0x47FDA0; Load_XModelPtr_t Load_XModelPtr = Load_XModelPtr_t(0x4FCA70);
Load_XModelPtr_t Load_XModelPtr = (Load_XModelPtr_t)0x4FCA70; Load_XModelSurfsFixup_t Load_XModelSurfsFixup = Load_XModelSurfsFixup_t(0x40D7A0);
Load_XModelSurfsFixup_t Load_XModelSurfsFixup = (Load_XModelSurfsFixup_t)0x40D7A0; Load_XStringArray_t Load_XStringArray = Load_XStringArray_t(0x4977F0);
Load_XStringArray_t Load_XStringArray = (Load_XStringArray_t)0x4977F0; Load_XStringCustom_t Load_XStringCustom = Load_XStringCustom_t(0x4E0DD0);
Load_XStringCustom_t Load_XStringCustom = (Load_XStringCustom_t)0x4E0DD0; Load_FxEffectDefHandle_t Load_FxEffectDefHandle = Load_FxEffectDefHandle_t(0x4D9B90);
Load_FxEffectDefHandle_t Load_FxEffectDefHandle = (Load_FxEffectDefHandle_t)0x4D9B90; Load_FxElemDef_t Load_FxElemDef = Load_FxElemDef_t(0x45AD90);
Load_FxElemDef_t Load_FxElemDef = (Load_FxElemDef_t)0x45AD90; Load_GfxImagePtr_t Load_GfxImagePtr = Load_GfxImagePtr_t(0x4C13D0);
Load_GfxImagePtr_t Load_GfxImagePtr = (Load_GfxImagePtr_t)0x4C13D0; Load_Texture_t Load_Texture = Load_Texture_t(0x51F4E0);
Load_Texture_t Load_Texture = (Load_Texture_t)0x51F4E0; Load_GfxTextureLoad_t Load_GfxTextureLoad = Load_GfxTextureLoad_t(0x4D3210);
Load_GfxTextureLoad_t Load_GfxTextureLoad = (Load_GfxTextureLoad_t)0x4D3210; Load_SndAliasCustom_t Load_SndAliasCustom = Load_SndAliasCustom_t(0x49B6B0);
Load_SndAliasCustom_t Load_SndAliasCustom = (Load_SndAliasCustom_t)0x49B6B0; Load_MaterialHandle_t Load_MaterialHandle = Load_MaterialHandle_t(0x403960);
Load_MaterialHandle_t Load_MaterialHandle = (Load_MaterialHandle_t)0x403960; Load_PhysCollmapPtr_t Load_PhysCollmapPtr = Load_PhysCollmapPtr_t(0x47E990);
Load_PhysCollmapPtr_t Load_PhysCollmapPtr = (Load_PhysCollmapPtr_t)0x47E990; Load_PhysPresetPtr_t Load_PhysPresetPtr = Load_PhysPresetPtr_t(0x4FAD30);
Load_PhysPresetPtr_t Load_PhysPresetPtr = (Load_PhysPresetPtr_t)0x4FAD30; Load_TracerDefPtr_t Load_TracerDefPtr = Load_TracerDefPtr_t(0x493090);
Load_TracerDefPtr_t Load_TracerDefPtr = (Load_TracerDefPtr_t)0x493090; Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray = Load_snd_alias_list_nameArray_t(0x4499F0);
Load_snd_alias_list_nameArray_t Load_snd_alias_list_nameArray = (Load_snd_alias_list_nameArray_t)0x4499F0;
Menus_CloseAll_t Menus_CloseAll = Menus_CloseAll_t(0x4BA5B0);
Menus_CloseAll_t Menus_CloseAll = (Menus_CloseAll_t)0x4BA5B0; Menus_OpenByName_t Menus_OpenByName = Menus_OpenByName_t(0x4CCE60);
Menus_OpenByName_t Menus_OpenByName = (Menus_OpenByName_t)0x4CCE60; Menus_FindByName_t Menus_FindByName = Menus_FindByName_t(0x487240);
Menus_FindByName_t Menus_FindByName = (Menus_FindByName_t)0x487240; Menu_IsVisible_t Menu_IsVisible = Menu_IsVisible_t(0x4D77D0);
Menu_IsVisible_t Menu_IsVisible = (Menu_IsVisible_t)0x4D77D0; Menus_MenuIsInStack_t Menus_MenuIsInStack = Menus_MenuIsInStack_t(0x47ACB0);
Menus_MenuIsInStack_t Menus_MenuIsInStack = (Menus_MenuIsInStack_t)0x47ACB0;
MSG_Init_t MSG_Init = MSG_Init_t(0x45FCA0);
MSG_Init_t MSG_Init = (MSG_Init_t)0x45FCA0; MSG_ReadData_t MSG_ReadData = MSG_ReadData_t(0x4527C0);
MSG_ReadData_t MSG_ReadData = (MSG_ReadData_t)0x4527C0; MSG_ReadLong_t MSG_ReadLong = MSG_ReadLong_t(0x4C9550);
MSG_ReadLong_t MSG_ReadLong = (MSG_ReadLong_t)0x4C9550; MSG_ReadShort_t MSG_ReadShort = MSG_ReadShort_t(0x40BDD0);
MSG_ReadShort_t MSG_ReadShort = (MSG_ReadShort_t)0x40BDD0; MSG_ReadInt64_t MSG_ReadInt64 = MSG_ReadInt64_t(0x4F1850);
MSG_ReadInt64_t MSG_ReadInt64 = (MSG_ReadInt64_t)0x4F1850; MSG_ReadString_t MSG_ReadString = MSG_ReadString_t(0x60E2B0);
MSG_ReadString_t MSG_ReadString = (MSG_ReadString_t)0x60E2B0; MSG_WriteByte_t MSG_WriteByte = MSG_WriteByte_t(0x48C520);
MSG_WriteByte_t MSG_WriteByte = (MSG_WriteByte_t)0x48C520; MSG_WriteData_t MSG_WriteData = MSG_WriteData_t(0x4F4120);
MSG_WriteData_t MSG_WriteData = (MSG_WriteData_t)0x4F4120; MSG_WriteLong_t MSG_WriteLong = MSG_WriteLong_t(0x41CA20);
MSG_WriteLong_t MSG_WriteLong = (MSG_WriteLong_t)0x41CA20; MSG_WriteBitsCompress_t MSG_WriteBitsCompress = MSG_WriteBitsCompress_t(0x4319D0);
MSG_WriteBitsCompress_t MSG_WriteBitsCompress = (MSG_WriteBitsCompress_t)0x4319D0; MSG_ReadByte_t MSG_ReadByte = MSG_ReadByte_t(0x4C1C20);
MSG_ReadByte_t MSG_ReadByte = (MSG_ReadByte_t)0x4C1C20; MSG_ReadBitsCompress_t MSG_ReadBitsCompress = MSG_ReadBitsCompress_t(0x4DCC30);
MSG_ReadBitsCompress_t MSG_ReadBitsCompress = (MSG_ReadBitsCompress_t)0x4DCC30;
NetadrToSockadr_t NetadrToSockadr = NetadrToSockadr_t(0x4B4B40);
NetadrToSockadr_t NetadrToSockadr = (NetadrToSockadr_t)0x4B4B40;
NET_AdrToString_t NET_AdrToString = NET_AdrToString_t(0x469880);
NET_AdrToString_t NET_AdrToString = (NET_AdrToString_t)0x469880; NET_CompareAdr_t NET_CompareAdr = NET_CompareAdr_t(0x4D0AA0);
NET_CompareAdr_t NET_CompareAdr = (NET_CompareAdr_t)0x4D0AA0; NET_ErrorString_t NET_ErrorString = NET_ErrorString_t(0x4E7720);
NET_ErrorString_t NET_ErrorString = (NET_ErrorString_t)0x4E7720; NET_Init_t NET_Init = NET_Init_t(0x491860);
NET_Init_t NET_Init = (NET_Init_t)0x491860; NET_IsLocalAddress_t NET_IsLocalAddress = NET_IsLocalAddress_t(0x402BD0);
NET_IsLocalAddress_t NET_IsLocalAddress = (NET_IsLocalAddress_t)0x402BD0; NET_StringToAdr_t NET_StringToAdr = NET_StringToAdr_t(0x409010);
NET_StringToAdr_t NET_StringToAdr = (NET_StringToAdr_t)0x409010; NET_OutOfBandPrint_t NET_OutOfBandPrint = NET_OutOfBandPrint_t(0x4AEF00);
NET_OutOfBandPrint_t NET_OutOfBandPrint = (NET_OutOfBandPrint_t)0x4AEF00; NET_OutOfBandData_t NET_OutOfBandData = NET_OutOfBandData_t(0x49C7E0);
NET_OutOfBandData_t NET_OutOfBandData = (NET_OutOfBandData_t)0x49C7E0;
Live_MPAcceptInvite_t Live_MPAcceptInvite = Live_MPAcceptInvite_t(0x420A6D);
Live_MPAcceptInvite_t Live_MPAcceptInvite = (Live_MPAcceptInvite_t)0x420A6D; Live_GetMapIndex_t Live_GetMapIndex = Live_GetMapIndex_t(0x4F6440);
Live_GetMapIndex_t Live_GetMapIndex = (Live_GetMapIndex_t)0x4F6440;
LoadModdableRawfile_t LoadModdableRawfile = LoadModdableRawfile_t(0x61ABC0);
LoadModdableRawfile_t LoadModdableRawfile = (LoadModdableRawfile_t)0x61ABC0;
PC_ReadToken_t PC_ReadToken = PC_ReadToken_t(0x4ACCD0);
PC_ReadToken_t PC_ReadToken = (PC_ReadToken_t)0x4ACCD0; PC_ReadTokenHandle_t PC_ReadTokenHandle = PC_ReadTokenHandle_t(0x4D2060);
PC_ReadTokenHandle_t PC_ReadTokenHandle = (PC_ReadTokenHandle_t)0x4D2060; PC_SourceError_t PC_SourceError = PC_SourceError_t(0x467A00);
PC_SourceError_t PC_SourceError = (PC_SourceError_t)0x467A00;
Party_GetMaxPlayers_t Party_GetMaxPlayers = Party_GetMaxPlayers_t(0x4F5D60);
Party_GetMaxPlayers_t Party_GetMaxPlayers = (Party_GetMaxPlayers_t)0x4F5D60; PartyHost_CountMembers_t PartyHost_CountMembers = PartyHost_CountMembers_t(0x497330);
PartyHost_CountMembers_t PartyHost_CountMembers = (PartyHost_CountMembers_t)0x497330; PartyHost_GetMemberAddressBySlot_t PartyHost_GetMemberAddressBySlot = PartyHost_GetMemberAddressBySlot_t(0x44E100);
PartyHost_GetMemberAddressBySlot_t PartyHost_GetMemberAddressBySlot = (PartyHost_GetMemberAddressBySlot_t)0x44E100; PartyHost_GetMemberName_t PartyHost_GetMemberName = PartyHost_GetMemberName_t(0x44BE90);
PartyHost_GetMemberName_t PartyHost_GetMemberName = (PartyHost_GetMemberName_t)0x44BE90;
Playlist_ParsePlaylists_t Playlist_ParsePlaylists = Playlist_ParsePlaylists_t(0x4295A0);
Playlist_ParsePlaylists_t Playlist_ParsePlaylists = (Playlist_ParsePlaylists_t)0x4295A0;
R_AddCmdDrawStretchPic_t R_AddCmdDrawStretchPic = R_AddCmdDrawStretchPic_t(0x509770);
R_AddCmdDrawStretchPic_t R_AddCmdDrawStretchPic = (R_AddCmdDrawStretchPic_t)0x509770; R_AllocStaticIndexBuffer_t R_AllocStaticIndexBuffer = R_AllocStaticIndexBuffer_t(0x51E7A0);
R_AllocStaticIndexBuffer_t R_AllocStaticIndexBuffer = (R_AllocStaticIndexBuffer_t)0x51E7A0; R_Cinematic_StartPlayback_Now_t R_Cinematic_StartPlayback_Now = R_Cinematic_StartPlayback_Now_t(0x51C5B0);
R_Cinematic_StartPlayback_Now_t R_Cinematic_StartPlayback_Now = (R_Cinematic_StartPlayback_Now_t)0x51C5B0; R_RegisterFont_t R_RegisterFont = R_RegisterFont_t(0x505670);
R_RegisterFont_t R_RegisterFont = (R_RegisterFont_t)0x505670; R_AddCmdDrawText_t R_AddCmdDrawText = R_AddCmdDrawText_t(0x509D80);
R_AddCmdDrawText_t R_AddCmdDrawText = (R_AddCmdDrawText_t)0x509D80; R_LoadGraphicsAssets_t R_LoadGraphicsAssets = R_LoadGraphicsAssets_t(0x506AC0);
R_LoadGraphicsAssets_t R_LoadGraphicsAssets = (R_LoadGraphicsAssets_t)0x506AC0; R_TextWidth_t R_TextWidth = R_TextWidth_t(0x5056C0);
R_TextWidth_t R_TextWidth = (R_TextWidth_t)0x5056C0; R_TextHeight_t R_TextHeight = R_TextHeight_t(0x505770);
R_TextHeight_t R_TextHeight = (R_TextHeight_t)0x505770; R_FlushSun_t R_FlushSun = R_FlushSun_t(0x53FB50);
R_FlushSun_t R_FlushSun = (R_FlushSun_t)0x53FB50;
Scr_LoadGameType_t Scr_LoadGameType = Scr_LoadGameType_t(0x4D9520);
Scr_LoadGameType_t Scr_LoadGameType = (Scr_LoadGameType_t)0x4D9520;
Scr_LoadScript_t Scr_LoadScript = Scr_LoadScript_t(0x45D940);
Scr_LoadScript_t Scr_LoadScript = (Scr_LoadScript_t)0x45D940; Scr_GetFunctionHandle_t Scr_GetFunctionHandle = Scr_GetFunctionHandle_t(0x4234F0);
Scr_GetFunctionHandle_t Scr_GetFunctionHandle = (Scr_GetFunctionHandle_t)0x4234F0;
Scr_GetFloat_t Scr_GetFloat = Scr_GetFloat_t(0x443140);
Scr_GetFloat_t Scr_GetFloat = (Scr_GetFloat_t)0x443140; Scr_GetNumParam_t Scr_GetNumParam = Scr_GetNumParam_t(0x4B0E90);
Scr_GetNumParam_t Scr_GetNumParam = (Scr_GetNumParam_t)0x4B0E90;
Scr_ExecThread_t Scr_ExecThread = Scr_ExecThread_t(0x4AD0B0);
Scr_ExecThread_t Scr_ExecThread = (Scr_ExecThread_t)0x4AD0B0; Scr_FreeThread_t Scr_FreeThread = Scr_FreeThread_t(0x4BD320);
Scr_FreeThread_t Scr_FreeThread = (Scr_FreeThread_t)0x4BD320;
Scr_ShutdownAllocNode_t Scr_ShutdownAllocNode = Scr_ShutdownAllocNode_t(0x441650);
Scr_ShutdownAllocNode_t Scr_ShutdownAllocNode = (Scr_ShutdownAllocNode_t)0x441650;
Script_Alloc_t Script_Alloc = (Script_Alloc_t)0x422E70; Script_Alloc_t Script_Alloc = Script_Alloc_t(0x422E70);
Script_SetupTokens_t Script_SetupTokens = (Script_SetupTokens_t)0x4E6950; Script_SetupTokens_t Script_SetupTokens = Script_SetupTokens_t(0x4E6950);
Script_CleanString_t Script_CleanString = (Script_CleanString_t)0x498220; Script_CleanString_t Script_CleanString = Script_CleanString_t(0x498220);
SE_Load_t SE_Load = (SE_Load_t)0x502A30; SE_Load_t SE_Load = SE_Load_t(0x502A30);
SEH_StringEd_GetString_t SEH_StringEd_GetString = (SEH_StringEd_GetString_t)0x44BB30; SEH_StringEd_GetString_t SEH_StringEd_GetString = SEH_StringEd_GetString_t(0x44BB30);
Dvar_SetStringByName_t Dvar_SetStringByName = (Dvar_SetStringByName_t)0x44F060; Dvar_SetStringByName_t Dvar_SetStringByName = Dvar_SetStringByName_t(0x44F060);
SL_ConvertToString_t SL_ConvertToString = (SL_ConvertToString_t)0x4EC1D0; SL_ConvertToString_t SL_ConvertToString = SL_ConvertToString_t(0x4EC1D0);
SL_GetString_t SL_GetString = (SL_GetString_t)0x4CDC10; SL_GetString_t SL_GetString = SL_GetString_t(0x4CDC10);
SND_Init_t SND_Init = (SND_Init_t)0x46A630; SND_Init_t SND_Init = SND_Init_t(0x46A630);
SND_InitDriver_t SND_InitDriver = (SND_InitDriver_t)0x4F5090; SND_InitDriver_t SND_InitDriver = SND_InitDriver_t(0x4F5090);
SockadrToNetadr_t SockadrToNetadr = (SockadrToNetadr_t)0x4F8460; SockadrToNetadr_t SockadrToNetadr = SockadrToNetadr_t(0x4F8460);
Steam_JoinLobby_t Steam_JoinLobby = (Steam_JoinLobby_t)0x49CF70; Steam_JoinLobby_t Steam_JoinLobby = Steam_JoinLobby_t(0x49CF70);
SV_GameClientNum_Score_t SV_GameClientNum_Score = (SV_GameClientNum_Score_t)0x469AC0; SV_GameClientNum_Score_t SV_GameClientNum_Score = SV_GameClientNum_Score_t(0x469AC0);
SV_GameSendServerCommand_t SV_GameSendServerCommand = (SV_GameSendServerCommand_t)0x4BC3A0; SV_GameSendServerCommand_t SV_GameSendServerCommand = SV_GameSendServerCommand_t(0x4BC3A0);
SV_Cmd_TokenizeString_t SV_Cmd_TokenizeString = (SV_Cmd_TokenizeString_t)0x4B5780; SV_Cmd_TokenizeString_t SV_Cmd_TokenizeString = SV_Cmd_TokenizeString_t(0x4B5780);
SV_Cmd_EndTokenizedString_t SV_Cmd_EndTokenizedString = (SV_Cmd_EndTokenizedString_t)0x464750; SV_Cmd_EndTokenizedString_t SV_Cmd_EndTokenizedString = SV_Cmd_EndTokenizedString_t(0x464750);
SV_DirectConnect_t SV_DirectConnect = (SV_DirectConnect_t)0x460480; SV_DirectConnect_t SV_DirectConnect = SV_DirectConnect_t(0x460480);
Sys_Error_t Sys_Error = (Sys_Error_t)0x4E0200; Sys_Error_t Sys_Error = Sys_Error_t(0x4E0200);
Sys_FreeFileList_t Sys_FreeFileList = (Sys_FreeFileList_t)0x4D8580; Sys_FreeFileList_t Sys_FreeFileList = Sys_FreeFileList_t(0x4D8580);
Sys_IsDatabaseReady_t Sys_IsDatabaseReady = (Sys_IsDatabaseReady_t)0x4CA4A0; Sys_IsDatabaseReady_t Sys_IsDatabaseReady = Sys_IsDatabaseReady_t(0x4CA4A0);
Sys_IsDatabaseReady2_t Sys_IsDatabaseReady2 = (Sys_IsDatabaseReady2_t)0x441280; Sys_IsDatabaseReady2_t Sys_IsDatabaseReady2 = Sys_IsDatabaseReady2_t(0x441280);
Sys_IsMainThread_t Sys_IsMainThread = (Sys_IsMainThread_t)0x4C37D0; Sys_IsMainThread_t Sys_IsMainThread = Sys_IsMainThread_t(0x4C37D0);
Sys_IsRenderThread_t Sys_IsRenderThread = (Sys_IsRenderThread_t)0x4B20E0; Sys_IsRenderThread_t Sys_IsRenderThread = Sys_IsRenderThread_t(0x4B20E0);
Sys_IsServerThread_t Sys_IsServerThread = (Sys_IsServerThread_t)0x4B0270; Sys_IsServerThread_t Sys_IsServerThread = Sys_IsServerThread_t(0x4B0270);
Sys_IsDatabaseThread_t Sys_IsDatabaseThread = (Sys_IsDatabaseThread_t)0x4C6020; Sys_IsDatabaseThread_t Sys_IsDatabaseThread = Sys_IsDatabaseThread_t(0x4C6020);
Sys_SendPacket_t Sys_SendPacket = (Sys_SendPacket_t)0x60FDC0; Sys_SendPacket_t Sys_SendPacket = Sys_SendPacket_t(0x60FDC0);
Sys_ShowConsole_t Sys_ShowConsole = (Sys_ShowConsole_t)0x4305E0; Sys_ShowConsole_t Sys_ShowConsole = Sys_ShowConsole_t(0x4305E0);
Sys_ListFiles_t Sys_ListFiles = (Sys_ListFiles_t)0x45A660; Sys_ListFiles_t Sys_ListFiles = Sys_ListFiles_t(0x45A660);
Sys_Milliseconds_t Sys_Milliseconds = (Sys_Milliseconds_t)0x42A660; Sys_Milliseconds_t Sys_Milliseconds = Sys_Milliseconds_t(0x42A660);
TeleportPlayer_t TeleportPlayer = (TeleportPlayer_t)0x496850; TeleportPlayer_t TeleportPlayer = TeleportPlayer_t(0x496850);
UI_AddMenuList_t UI_AddMenuList = (UI_AddMenuList_t)0x4533C0; UI_AddMenuList_t UI_AddMenuList = UI_AddMenuList_t(0x4533C0);
UI_CheckStringTranslation_t UI_CheckStringTranslation = (UI_CheckStringTranslation_t)0x4FB010; UI_CheckStringTranslation_t UI_CheckStringTranslation = UI_CheckStringTranslation_t(0x4FB010);
UI_LoadMenus_t UI_LoadMenus = (UI_LoadMenus_t)0x641460; UI_LoadMenus_t UI_LoadMenus = UI_LoadMenus_t(0x641460);
UI_UpdateArenas_t UI_UpdateArenas = (UI_UpdateArenas_t)0x4A95B0; UI_UpdateArenas_t UI_UpdateArenas = UI_UpdateArenas_t(0x4A95B0);
UI_DrawHandlePic_t UI_DrawHandlePic = (UI_DrawHandlePic_t)0x4D0EA0; UI_DrawHandlePic_t UI_DrawHandlePic = UI_DrawHandlePic_t(0x4D0EA0);
UI_GetContext_t UI_GetContext = (UI_GetContext_t)0x4F8940; UI_GetContext_t UI_GetContext = UI_GetContext_t(0x4F8940);
UI_TextWidth_t UI_TextWidth = (UI_TextWidth_t)0x6315C0; UI_TextWidth_t UI_TextWidth = UI_TextWidth_t(0x6315C0);
UI_DrawText_t UI_DrawText = (UI_DrawText_t)0x49C0D0; UI_DrawText_t UI_DrawText = UI_DrawText_t(0x49C0D0);
Win_GetLanguage_t Win_GetLanguage = (Win_GetLanguage_t)0x45CBA0; Win_GetLanguage_t Win_GetLanguage = Win_GetLanguage_t(0x45CBA0);
Vec3UnpackUnitVec_t Vec3UnpackUnitVec = (Vec3UnpackUnitVec_t)0x45CA90; Vec3UnpackUnitVec_t Vec3UnpackUnitVec = Vec3UnpackUnitVec_t(0x45CA90);
XAssetHeader* DB_XAssetPool = (XAssetHeader*)0x7998A8; XAssetHeader* DB_XAssetPool = reinterpret_cast<XAssetHeader*>(0x7998A8);
unsigned int* g_poolSize = (unsigned int*)0x7995E8; unsigned int* g_poolSize = reinterpret_cast<unsigned int*>(0x7995E8);
DWORD* cmd_id = (DWORD*)0x1AAC5D0; DWORD* cmd_id = reinterpret_cast<DWORD*>(0x1AAC5D0);
DWORD* cmd_argc = (DWORD*)0x1AAC614; DWORD* cmd_argc = reinterpret_cast<DWORD*>(0x1AAC614);
char*** cmd_argv = (char***)0x1AAC634; char*** cmd_argv = reinterpret_cast<char***>(0x1AAC634);
DWORD* cmd_id_sv = (DWORD*)0x1ACF8A0; DWORD* cmd_id_sv = reinterpret_cast<DWORD*>(0x1ACF8A0);
DWORD* cmd_argc_sv = (DWORD*)0x1ACF8E4; DWORD* cmd_argc_sv = reinterpret_cast<DWORD*>(0x1ACF8E4);
char*** cmd_argv_sv = (char***)0x1ACF904; char*** cmd_argv_sv = reinterpret_cast<char***>(0x1ACF904);
cmd_function_t** cmd_functions = (cmd_function_t**)0x1AAC658; cmd_function_t** cmd_functions = reinterpret_cast<cmd_function_t**>(0x1AAC658);
source_t **sourceFiles = (source_t **)0x7C4A98; source_t **sourceFiles = reinterpret_cast<source_t **>(0x7C4A98);
keywordHash_t **menuParseKeywordHash = (keywordHash_t **)0x63AE928; keywordHash_t **menuParseKeywordHash = reinterpret_cast<keywordHash_t **>(0x63AE928);
int* svs_numclients = (int*)0x31D938C; int* svs_numclients = reinterpret_cast<int*>(0x31D938C);
client_t* svs_clients = (client_t*)0x31D9390; client_t* svs_clients = reinterpret_cast<client_t*>(0x31D9390);
UiContext *uiContext = (UiContext *)0x62E2858; UiContext *uiContext = reinterpret_cast<UiContext *>(0x62E2858);
int* arenaCount = (int*)0x62E6930; int* arenaCount = reinterpret_cast<int*>(0x62E6930);
mapArena_t* arenas = (mapArena_t*)0x62E6934; mapArena_t* arenas = reinterpret_cast<mapArena_t*>(0x62E6934);
int* gameTypeCount = (int*)0x62E50A0; int* gameTypeCount = reinterpret_cast<int*>(0x62E50A0);
gameTypeName_t* gameTypes = (gameTypeName_t*)0x62E50A4; gameTypeName_t* gameTypes = reinterpret_cast<gameTypeName_t*>(0x62E50A4);
searchpath_t* fs_searchpaths = (searchpath_t*)0x63D96E0; searchpath_t* fs_searchpaths = reinterpret_cast<searchpath_t*>(0x63D96E0);
XBlock** g_streamBlocks = (XBlock**)0x16E554C; XBlock** g_streamBlocks = reinterpret_cast<XBlock**>(0x16E554C);
int* g_streamPos = (int*)0x16E5554; int* g_streamPos = reinterpret_cast<int*>(0x16E5554);
int* g_streamPosIndex = (int*)0x16E5578; int* g_streamPosIndex = reinterpret_cast<int*>(0x16E5578);
bool* g_lobbyCreateInProgress = (bool*)0x66C9BC2; bool* g_lobbyCreateInProgress = reinterpret_cast<bool*>(0x66C9BC2);
party_t** partyIngame = (party_t**)0x1081C00; party_t** partyIngame = reinterpret_cast<party_t**>(0x1081C00);
PartyData_s** partyData = (PartyData_s**)0x107E500; PartyData_s** partyData = reinterpret_cast<PartyData_s**>(0x107E500);
int* numIP = (int*)0x64A1E68; int* numIP = reinterpret_cast<int*>(0x64A1E68);
netIP_t* localIP = (netIP_t*)0x64A1E28; netIP_t* localIP = reinterpret_cast<netIP_t*>(0x64A1E28);
int* demoFile = (int*)0xA5EA1C; int* demoFile = reinterpret_cast<int*>(0xA5EA1C);
int* demoPlaying = (int*)0xA5EA0C; int* demoPlaying = reinterpret_cast<int*>(0xA5EA0C);
int* demoRecording = (int*)0xA5EA08; int* demoRecording = reinterpret_cast<int*>(0xA5EA08);
int* serverMessageSequence = (int*)0xA3E9B4; int* serverMessageSequence = reinterpret_cast<int*>(0xA3E9B4);
gentity_t* g_entities = (gentity_t*)0x18835D8; gentity_t* g_entities = reinterpret_cast<gentity_t*>(0x18835D8);
netadr_t* connectedHost = (netadr_t*)0xA1E888; netadr_t* connectedHost = reinterpret_cast<netadr_t*>(0xA1E888);
SOCKET* ip_socket = (SOCKET*)0x64A3008; SOCKET* ip_socket = reinterpret_cast<SOCKET*>(0x64A3008);
uint32_t* com_frameTime = (uint32_t*)0x1AD8F3C; uint32_t* com_frameTime = reinterpret_cast<uint32_t*>(0x1AD8F3C);
SafeArea* safeArea = (SafeArea*)0xA15F3C; SafeArea* safeArea = reinterpret_cast<SafeArea*>(0xA15F3C);
SpawnVar* spawnVars = (SpawnVar*)0x1A83DE8; SpawnVar* spawnVars = reinterpret_cast<SpawnVar*>(0x1A83DE8);
MapEnts** marMapEntsPtr = (MapEnts**)0x112AD34; MapEnts** marMapEntsPtr = reinterpret_cast<MapEnts**>(0x112AD34);
IDirect3D9** d3d9 = (IDirect3D9**)0x66DEF84; IDirect3D9** d3d9 = reinterpret_cast<IDirect3D9**>(0x66DEF84);
IDirect3DDevice9** dx_ptr = (IDirect3DDevice9**)0x66DEF88; IDirect3DDevice9** dx_ptr = reinterpret_cast<IDirect3DDevice9**>(0x66DEF88);
mapname_t* mapnames = (mapname_t*)0x7471D0; mapname_t* mapnames = reinterpret_cast<mapname_t*>(0x7471D0);
char*** varXString = (char***)0x112B340; char*** varXString = reinterpret_cast<char***>(0x112B340);
TracerDef*** varTracerDefPtr = (TracerDef***)0x112B3BC; TracerDef*** varTracerDefPtr = reinterpret_cast<TracerDef***>(0x112B3BC);
XModel*** varXModelPtr = (XModel***)0x112A934; XModel*** varXModelPtr = reinterpret_cast<XModel***>(0x112A934);
XModel** varXModel = (XModel**)0x112AE14; XModel** varXModel = reinterpret_cast<XModel**>(0x112AE14);
PathData** varPathData = (PathData**)0x112AD7C; PathData** varPathData = reinterpret_cast<PathData**>(0x112AD7C);
const char** varConstChar = (const char**)0x112A774; const char** varConstChar = reinterpret_cast<const char**>(0x112A774);
Material*** varMaterialHandle = (Material***)0x112A878; Material*** varMaterialHandle = reinterpret_cast<Material***>(0x112A878);
FxEffectDef*** varFxEffectDefHandle = (FxEffectDef***)0x112ACC0; FxEffectDef*** varFxEffectDefHandle = reinterpret_cast<FxEffectDef***>(0x112ACC0);
PhysCollmap*** varPhysCollmapPtr = (PhysCollmap***)0x112B440; PhysCollmap*** varPhysCollmapPtr = reinterpret_cast<PhysCollmap***>(0x112B440);
PhysPreset*** varPhysPresetPtr = (PhysPreset***)0x112B378; PhysPreset*** varPhysPresetPtr = reinterpret_cast<PhysPreset***>(0x112B378);
Game::MaterialPass** varMaterialPass = (Game::MaterialPass**)0x112A960; Game::MaterialPass** varMaterialPass = reinterpret_cast<Game::MaterialPass**>(0x112A960);
snd_alias_list_t*** varsnd_alias_list_name = (snd_alias_list_t***)0x112AF38; snd_alias_list_t*** varsnd_alias_list_name = reinterpret_cast<snd_alias_list_t***>(0x112AF38);
FxElemField* s_elemFields = (FxElemField*)0x73B848; FxElemField* s_elemFields = reinterpret_cast<FxElemField*>(0x73B848);
XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize) XAssetHeader ReallocateAssetPool(XAssetType type, unsigned int newSize)
{ {

View File

@ -1,3 +1,5 @@
#pragma once
namespace Game namespace Game
{ {
typedef void*(__cdecl * BG_LoadWeaponDef_LoadObj_t)(const char* filename); typedef void*(__cdecl * BG_LoadWeaponDef_LoadObj_t)(const char* filename);
@ -147,10 +149,10 @@ namespace Game
typedef void(__cdecl * DB_XModelSurfsFixup_t)(XModel* model); typedef void(__cdecl * DB_XModelSurfsFixup_t)(XModel* model);
extern DB_XModelSurfsFixup_t DB_XModelSurfsFixup; extern DB_XModelSurfsFixup_t DB_XModelSurfsFixup;
typedef dvar_t* (__cdecl * Dvar_RegisterBool_t)(const char* name, bool default, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterBool_t)(const char* name, bool defaultVal, int flags, const char* description);
extern Dvar_RegisterBool_t Dvar_RegisterBool; extern Dvar_RegisterBool_t Dvar_RegisterBool;
typedef dvar_t* (__cdecl * Dvar_RegisterFloat_t)(const char* name, float default, float min, float max, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterFloat_t)(const char* name, float defaultVal, float min, float max, int flags, const char* description);
extern Dvar_RegisterFloat_t Dvar_RegisterFloat; extern Dvar_RegisterFloat_t Dvar_RegisterFloat;
typedef dvar_t* (__cdecl * Dvar_RegisterVec2_t)(const char* name, float defx, float defy, float min, float max, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterVec2_t)(const char* name, float defx, float defy, float min, float max, int flags, const char* description);
@ -162,13 +164,13 @@ namespace Game
typedef dvar_t* (__cdecl * Dvar_RegisterVec4_t)(const char* name, float defx, float defy, float defz, float defw, float min, float max, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterVec4_t)(const char* name, float defx, float defy, float defz, float defw, float min, float max, int flags, const char* description);
extern Dvar_RegisterVec4_t Dvar_RegisterVec4; extern Dvar_RegisterVec4_t Dvar_RegisterVec4;
typedef dvar_t* (__cdecl * Dvar_RegisterInt_t)(const char* name, int default, int min, int max, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterInt_t)(const char* name, int defaultVal, int min, int max, int flags, const char* description);
extern Dvar_RegisterInt_t Dvar_RegisterInt; extern Dvar_RegisterInt_t Dvar_RegisterInt;
typedef dvar_t* (__cdecl * Dvar_RegisterEnum_t)(const char* name, char** enumValues, int default, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterEnum_t)(const char* name, char** enumValues, int defaultVal, int flags, const char* description);
extern Dvar_RegisterEnum_t Dvar_RegisterEnum; extern Dvar_RegisterEnum_t Dvar_RegisterEnum;
typedef dvar_t* (__cdecl * Dvar_RegisterString_t)(const char* name, const char* default, int, const char*); typedef dvar_t* (__cdecl * Dvar_RegisterString_t)(const char* name, const char* defaultVal, int, const char*);
extern Dvar_RegisterString_t Dvar_RegisterString; extern Dvar_RegisterString_t Dvar_RegisterString;
typedef dvar_t* (__cdecl * Dvar_RegisterColor_t)(const char* name, float r, float g, float b, float a, int flags, const char* description); typedef dvar_t* (__cdecl * Dvar_RegisterColor_t)(const char* name, float r, float g, float b, float a, int flags, const char* description);
@ -470,7 +472,7 @@ namespace Game
typedef float(__cdecl * Scr_GetFloat_t)(int); typedef float(__cdecl * Scr_GetFloat_t)(int);
extern Scr_GetFloat_t Scr_GetFloat; extern Scr_GetFloat_t Scr_GetFloat;
typedef int(__cdecl * Scr_GetNumParam_t)(void); typedef int(__cdecl * Scr_GetNumParam_t)();
extern Scr_GetNumParam_t Scr_GetNumParam; extern Scr_GetNumParam_t Scr_GetNumParam;
typedef int(__cdecl * Scr_GetFunctionHandle_t)(const char*, const char*); typedef int(__cdecl * Scr_GetFunctionHandle_t)(const char*, const char*);

View File

@ -1,3 +1,5 @@
#pragma once
#define PROTOCOL 0x92 #define PROTOCOL 0x92
// This allows us to compile our structures in IDA, for easier reversing :3 // This allows us to compile our structures in IDA, for easier reversing :3

View File

@ -7,11 +7,10 @@ namespace Main
void SetEnvironment() void SetEnvironment()
{ {
wchar_t exeName[512]; wchar_t exeName[512];
GetModuleFileName(GetModuleHandle(NULL), exeName, sizeof(exeName) / 2); GetModuleFileName(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2);
wchar_t* exeBaseName = wcsrchr(exeName, L'\\'); wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
exeBaseName[0] = L'\0'; exeBaseName[0] = L'\0';
exeBaseName++;
SetCurrentDirectory(exeName); SetCurrentDirectory(exeName);
} }
@ -59,7 +58,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
} }
DWORD oldProtect; DWORD oldProtect;
std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(NULL)); std::uint8_t* module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(nullptr));
//VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process //VirtualProtect(module, 0x6C73000, PAGE_EXECUTE_READWRITE, &oldProtect); // Unprotect the entire process
VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class Friends class Friends
{ {
protected:
~Friends() = default;
public: public:
virtual const char *GetPersonaName(); virtual const char *GetPersonaName();
virtual void SetPersonaName(const char *pchPersonaName); virtual void SetPersonaName(const char *pchPersonaName);

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class GameServer class GameServer
{ {
protected:
~GameServer() = default;
public: public:
virtual void LogOn(); virtual void LogOn();
virtual void LogOff(); virtual void LogOff();

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class MasterServerUpdater class MasterServerUpdater
{ {
protected:
~MasterServerUpdater() = default;
public: public:
virtual void SetActive(bool bActive); virtual void SetActive(bool bActive);
virtual void SetHeartbeatInterval(int iHeartbeatInterval); virtual void SetHeartbeatInterval(int iHeartbeatInterval);

View File

@ -23,6 +23,9 @@ namespace Steam
class Matchmaking class Matchmaking
{ {
protected:
~Matchmaking() = default;
public: public:
virtual int GetFavoriteGameCount(); virtual int GetFavoriteGameCount();
virtual bool GetFavoriteGame(int iGame, unsigned int *pnAppID, unsigned int *pnIP, unsigned short *pnConnPort, unsigned short *pnQueryPort, unsigned int *punFlags, unsigned int *pRTime32LastPlayedOnServer); virtual bool GetFavoriteGame(int iGame, unsigned int *pnAppID, unsigned int *pnIP, unsigned short *pnConnPort, unsigned short *pnQueryPort, unsigned int *punFlags, unsigned int *pRTime32LastPlayedOnServer);

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class Networking class Networking
{ {
protected:
~Networking() = default;
public: public:
virtual bool SendP2PPacket(SteamID steamIDRemote, const void *pubData, unsigned int cubData, int eP2PSendType); virtual bool SendP2PPacket(SteamID steamIDRemote, const void *pubData, unsigned int cubData, int eP2PSendType);
virtual bool IsP2PPacketAvailable(unsigned int *pcubMsgSize); virtual bool IsP2PPacketAvailable(unsigned int *pcubMsgSize);

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class RemoteStorage class RemoteStorage
{ {
protected:
~RemoteStorage() = default;
public: public:
virtual bool FileWrite(const char *pchFile, const void *pvData, int cubData); virtual bool FileWrite(const char *pchFile, const void *pvData, int cubData);
virtual int GetFileSize(const char *pchFile); virtual int GetFileSize(const char *pchFile);

View File

@ -24,7 +24,7 @@ namespace Steam
{ {
if (Components::Dedicated::IsEnabled() || Components::ZoneBuilder::IsEnabled()) // Dedi guid if (Components::Dedicated::IsEnabled() || Components::ZoneBuilder::IsEnabled()) // Dedi guid
{ {
idBits = *reinterpret_cast<unsigned __int64*>("DEDICATE"); idBits = *reinterpret_cast<unsigned __int64*>(static_cast<char*>("DEDICATE"));
} }
else if (Components::Singleton::IsFirstInstance()) // ECDSA guid else if (Components::Singleton::IsFirstInstance()) // ECDSA guid
{ {

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class User class User
{ {
protected:
~User() = default;
public: public:
virtual int GetHSteamUser(); virtual int GetHSteamUser();
virtual bool LoggedOn(); virtual bool LoggedOn();

View File

@ -4,6 +4,9 @@ namespace Steam
{ {
class Utils class Utils
{ {
protected:
~Utils() = default;
public: public:
virtual unsigned int GetSecondsSinceAppActive(); virtual unsigned int GetSecondsSinceAppActive();
virtual unsigned int GetSecondsSinceComputerActive(); virtual unsigned int GetSecondsSinceComputerActive();

View File

@ -131,7 +131,7 @@ namespace Steam
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, STEAM_REGISTRY_PATH, 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS) if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, STEAM_REGISTRY_PATH, 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS)
{ {
DWORD dwLength = sizeof(SteamPath); DWORD dwLength = sizeof(SteamPath);
RegQueryValueExA(hRegKey, "InstallPath", NULL, NULL, reinterpret_cast<BYTE*>(SteamPath), &dwLength); RegQueryValueExA(hRegKey, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(SteamPath), &dwLength);
RegCloseKey(hRegKey); RegCloseKey(hRegKey);
return SteamPath; return SteamPath;

View File

@ -14,6 +14,9 @@ namespace Steam
{ {
class ISteamClient008 class ISteamClient008
{ {
protected:
~ISteamClient008() = default;
public: public:
virtual void* CreateSteamPipe() = 0; virtual void* CreateSteamPipe() = 0;
virtual bool ReleaseSteamPipe(void* hSteamPipe) = 0; virtual bool ReleaseSteamPipe(void* hSteamPipe) = 0;
@ -40,6 +43,9 @@ namespace Steam
class IClientUser class IClientUser
{ {
protected:
~IClientUser() = default;
public: public:
virtual int32_t GetHSteamUser() = 0; virtual int32_t GetHSteamUser() = 0;
virtual void LogOn(bool bInteractive, SteamID steamID) = 0; virtual void LogOn(bool bInteractive, SteamID steamID) = 0;
@ -262,6 +268,9 @@ namespace Steam
class IClientEngine class IClientEngine
{ {
protected:
~IClientEngine() = default;
public: public:
virtual void* CreateSteamPipe() = 0; virtual void* CreateSteamPipe() = 0;
virtual bool BReleaseSteamPipe(void* hSteamPipe) = 0; virtual bool BReleaseSteamPipe(void* hSteamPipe) = 0;

View File

@ -32,14 +32,14 @@ struct GameID_t
#pragma pack( pop ) #pragma pack( pop )
#include "Interfaces\SteamUser.hpp" #include "Interfaces/SteamUser.hpp"
#include "Interfaces\SteamUtils.hpp" #include "Interfaces/SteamUtils.hpp"
#include "Interfaces\SteamFriends.hpp" #include "Interfaces/SteamFriends.hpp"
#include "Interfaces\SteamGameServer.hpp" #include "Interfaces/SteamGameServer.hpp"
#include "Interfaces\SteamNetworking.hpp" #include "Interfaces/SteamNetworking.hpp"
#include "Interfaces\SteamMatchmaking.hpp" #include "Interfaces/SteamMatchmaking.hpp"
#include "Interfaces\SteamRemoteStorage.hpp" #include "Interfaces/SteamRemoteStorage.hpp"
#include "Interfaces\SteamMasterServerUpdater.hpp" #include "Interfaces/SteamMasterServerUpdater.hpp"
#include "Proxy.hpp" #include "Proxy.hpp"
@ -61,6 +61,8 @@ namespace Steam
void SetICallback(int iCallback) { Callback = iCallback; } void SetICallback(int iCallback) { Callback = iCallback; }
protected: protected:
~Base() = default;
unsigned char Flags; unsigned char Flags;
int Callback; int Callback;
}; };

View File

@ -20,12 +20,12 @@ namespace Utils
bool isValid() bool isValid()
{ {
return (this->Object.use_count() > 0); return (this->object.use_count() > 0);
} }
void set(T object) void set(T object)
{ {
this->object = std::shared_ptr<T>(new T()); this->object = std::make_shared<T>();
*this->object.get() = object; *this->object.get() = object;
} }
@ -84,10 +84,10 @@ namespace Utils
{ {
std::lock_guard<std::mutex> _(this->mutex); std::lock_guard<std::mutex> _(this->mutex);
if (!this->Empty()) if (!this->empty())
{ {
// Create new chain entry // Create new chain entry
std::shared_ptr<Entry> currentObject = std::shared_ptr<Entry>(new Entry); std::shared_ptr<Entry> currentObject = std::make_shared<Entry>();
*currentObject.get() = this->object; *currentObject.get() = this->object;
// Add it to the chain // Add it to the chain

View File

@ -37,7 +37,7 @@ namespace Utils
return ""; return "";
} }
int ret = 0; int ret;
Utils::Memory::Allocator allocator; Utils::Memory::Allocator allocator;
uint8_t* dest = allocator.allocateArray<uint8_t>(CHUNK); uint8_t* dest = allocator.allocateArray<uint8_t>(CHUNK);

View File

@ -37,7 +37,7 @@ namespace Utils
{ {
ltc_mp = ltm_desc; ltc_mp = ltm_desc;
register_prng(&fortuna_desc); register_prng(&fortuna_desc);
rng_make_prng(128, find_prng("fortuna"), &Rand::State, NULL); rng_make_prng(128, find_prng("fortuna"), &Rand::State, nullptr);
} }
#pragma endregion #pragma endregion
@ -52,7 +52,7 @@ namespace Utils
ltc_mp = ltm_desc; ltc_mp = ltm_desc;
ecc_make_key(NULL, find_prng("sprng"), bits / 8, key.getKeyPtr()); ecc_make_key(nullptr, find_prng("sprng"), bits / 8, key.getKeyPtr());
return key; return key;
} }
@ -68,7 +68,7 @@ namespace Utils
ltc_mp = ltm_desc; ltc_mp = ltm_desc;
ecc_sign_hash(reinterpret_cast<const uint8_t*>(message.data()), message.size(), buffer, &length, NULL, find_prng("sprng"), key.getKeyPtr()); ecc_sign_hash(reinterpret_cast<const uint8_t*>(message.data()), message.size(), buffer, &length, nullptr, find_prng("sprng"), key.getKeyPtr());
return std::string(reinterpret_cast<char*>(buffer), length); return std::string(reinterpret_cast<char*>(buffer), length);
} }
@ -96,7 +96,7 @@ namespace Utils
ltc_mp = ltm_desc; ltc_mp = ltm_desc;
rsa_make_key(NULL, find_prng("sprng"), bits / 8, 65537, key.getKeyPtr()); rsa_make_key(nullptr, find_prng("sprng"), bits / 8, 65537, key.getKeyPtr());
return key; return key;
} }

View File

@ -114,7 +114,7 @@ namespace Utils
return std::string(this->tokenString.begin(), this->tokenString.end()); return std::string(this->tokenString.begin(), this->tokenString.end());
} }
const std::string toString() const std::string toString() const
{ {
return std::string(this->tokenString.begin(), this->tokenString.end()); return std::string(this->tokenString.begin(), this->tokenString.end());
} }

View File

@ -22,7 +22,7 @@ namespace Utils
{ {
Hook::Signature::Container* container = &containers[k]; Hook::Signature::Container* container = &containers[k];
unsigned int j = 0; unsigned int j;
for (j = 0; j < strlen(container->mask); ++j) for (j = 0; j < strlen(container->mask); ++j)
{ {
if (container->mask[j] != '?' &&container->signature[j] != address[j]) if (container->mask[j] != '?' &&container->signature[j] != address[j])

View File

@ -46,7 +46,7 @@ namespace Utils
static void* PopReturn(void* place); static void* PopReturn(void* place);
}; };
Hook() : place(nullptr), stub(nullptr), initialized(false), installed(false), original(0), useJump(false), protection(0) { ZeroMemory(this->buffer, sizeof(this->buffer)); } Hook() : initialized(false), installed(false), place(nullptr), stub(nullptr), original(nullptr), useJump(false), protection(0) { ZeroMemory(this->buffer, sizeof(this->buffer)); }
Hook(void* place, void* stub, bool useJump = true) : Hook() { this->initialize(place, stub, useJump); } Hook(void* place, void* stub, bool useJump = true) : Hook() { this->initialize(place, stub, useJump); }
Hook(void* place, void(*stub)(), bool useJump = true) : Hook(place, reinterpret_cast<void*>(stub), useJump) {} Hook(void* place, void(*stub)(), bool useJump = true) : Hook(place, reinterpret_cast<void*>(stub), useJump) {}

View File

@ -32,18 +32,17 @@ namespace Utils
if (FileExists(file)) if (FileExists(file))
{ {
std::streamsize size = 0;
std::ifstream stream(file, std::ios::binary); std::ifstream stream(file, std::ios::binary);
if (!stream.is_open()) return buffer; if (!stream.is_open()) return buffer;
stream.seekg(0, std::ios::end); stream.seekg(0, std::ios::end);
size = stream.tellg(); std::streamsize size = stream.tellg();
stream.seekg(0, std::ios::beg); stream.seekg(0, std::ios::beg);
if (size > -1) if (size > -1)
{ {
buffer.clear(); buffer.clear();
buffer.resize((uint32_t)size); buffer.resize(static_cast<uint32_t>(size));
stream.read(const_cast<char*>(buffer.data()), size); stream.read(const_cast<char*>(buffer.data()), size);
} }

View File

@ -2,9 +2,9 @@
namespace Utils namespace Utils
{ {
Library::Library(std::string buffer, bool _freeOnDestroy) : freeOnDestroy(_freeOnDestroy), module(nullptr) Library::Library(std::string buffer, bool _freeOnDestroy) : module(nullptr), freeOnDestroy(_freeOnDestroy)
{ {
this->module = LoadLibraryExA(buffer.data(), NULL, 0); this->module = LoadLibraryExA(buffer.data(), nullptr, 0);
} }
Library::~Library() Library::~Library()

View File

@ -17,7 +17,7 @@ namespace Utils
{ {
if (!this->valid()) if (!this->valid())
{ {
throw new std::runtime_error("Library not loaded!"); throw std::runtime_error("Library not loaded!");
} }
return reinterpret_cast<T*>(GetProcAddress(this->getModule(), process.data())); return reinterpret_cast<T*>(GetProcAddress(this->getModule(), process.data()));

View File

@ -64,7 +64,7 @@ namespace Utils
void* pointer = this->read<void*>(); void* pointer = this->read<void*>();
if (!this->hasPointer(pointer)) if (!this->hasPointer(pointer))
{ {
this->pointerMap[pointer] = 0; this->pointerMap[pointer] = nullptr;
} }
return pointer; return pointer;
} }
@ -103,7 +103,7 @@ namespace Utils
if (this->criticalSectionState != 0) if (this->criticalSectionState != 0)
{ {
MessageBoxA(0, Utils::String::VA("Invalid critical section state '%i' for stream destruction!", this->criticalSectionState), "WARNING", MB_ICONEXCLAMATION); MessageBoxA(nullptr, Utils::String::VA("Invalid critical section state '%i' for stream destruction!", this->criticalSectionState), "WARNING", MB_ICONEXCLAMATION);
} }
}; };
@ -137,7 +137,7 @@ namespace Utils
if (this->isCriticalSection() && this->length() + (size * count) > this->capacity()) if (this->isCriticalSection() && this->length() + (size * count) > this->capacity())
{ {
MessageBoxA(0, Utils::String::VA("Potential stream reallocation during critical operation detected! Writing data of the length 0x%X exceeds the allocated stream size of 0x%X\n", (size * count), this->capacity()), "ERROR", MB_ICONERROR); MessageBoxA(nullptr, Utils::String::VA("Potential stream reallocation during critical operation detected! Writing data of the length 0x%X exceeds the allocated stream size of 0x%X\n", (size * count), this->capacity()), "ERROR", MB_ICONERROR);
__debugbreak(); __debugbreak();
} }
@ -145,7 +145,7 @@ namespace Utils
if (this->data() != data && this->isCriticalSection()) if (this->data() != data && this->isCriticalSection())
{ {
MessageBoxA(0, "Stream reallocation during critical operations not permitted!\nPlease increase the initial memory size or reallocate memory during non-critical sections!", "ERROR", MB_ICONERROR); MessageBoxA(nullptr, "Stream reallocation during critical operations not permitted!\nPlease increase the initial memory size or reallocate memory during non-critical sections!", "ERROR", MB_ICONERROR);
__debugbreak(); __debugbreak();
} }
@ -337,7 +337,7 @@ namespace Utils
{ {
if (this->criticalSectionState < 0) if (this->criticalSectionState < 0)
{ {
MessageBoxA(0, "CriticalSectionState in stream has been overrun!", "ERROR", MB_ICONERROR); MessageBoxA(nullptr, "CriticalSectionState in stream has been overrun!", "ERROR", MB_ICONERROR);
__debugbreak(); __debugbreak();
} }

View File

@ -24,7 +24,7 @@ namespace Utils
class Reader class Reader
{ {
public: public:
Reader(Utils::Memory::Allocator* _allocator, std::string _buffer) : buffer(_buffer), allocator(_allocator), position(0) {} Reader(Utils::Memory::Allocator* _allocator, std::string _buffer) : position(0), buffer(_buffer), allocator(_allocator) {}
std::string readString(); std::string readString();
const char* readCString(); const char* readCString();

View File

@ -157,7 +157,7 @@ namespace Utils
double bytesPerSecond = (1000.0 / milliseconds) * bytes; double bytesPerSecond = (1000.0 / milliseconds) * bytes;
int i = 0; int i;
for (i = 0; bytesPerSecond > 1000 && i < ARRAY_SIZE(sizes); ++i) // 1024 or 1000? for (i = 0; bytesPerSecond > 1000 && i < ARRAY_SIZE(sizes); ++i) // 1024 or 1000?
{ {
bytesPerSecond /= 1000; bytesPerSecond /= 1000;
@ -172,7 +172,7 @@ namespace Utils
unsigned long outlen = long(inputSize + (inputSize / 3.0) + 16); unsigned long outlen = long(inputSize + (inputSize / 3.0) + 16);
unsigned char* outbuf = new unsigned char[outlen]; //Reserve output memory unsigned char* outbuf = new unsigned char[outlen]; //Reserve output memory
base64_encode(reinterpret_cast<unsigned char*>(const_cast<char*>(input)), inputSize, outbuf, &outlen); base64_encode(reinterpret_cast<unsigned char*>(const_cast<char*>(input)), inputSize, outbuf, &outlen);
std::string ret((char*)outbuf, outlen); std::string ret(reinterpret_cast<char*>(outbuf), outlen);
delete[] outbuf; delete[] outbuf;
return ret; return ret;
} }

View File

@ -5,7 +5,7 @@ namespace Utils
std::string GetMimeType(std::string url) std::string GetMimeType(std::string url)
{ {
wchar_t* mimeType = nullptr; wchar_t* mimeType = nullptr;
FindMimeFromData(NULL, std::wstring(url.begin(), url.end()).data(), NULL, 0, NULL, 0, &mimeType, 0); FindMimeFromData(nullptr, std::wstring(url.begin(), url.end()).data(), nullptr, 0, nullptr, 0, &mimeType, 0);
if (mimeType) if (mimeType)
{ {
@ -28,7 +28,7 @@ namespace Utils
DWORD errorMessageID = ::GetLastError(); DWORD errorMessageID = ::GetLastError();
LPSTR messageBuffer = nullptr; LPSTR messageBuffer = nullptr;
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL); nullptr, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPSTR>(&messageBuffer), 0, nullptr);
std::string message(messageBuffer, size); std::string message(messageBuffer, size);
OutputDebugStringA(Utils::String::VA("Last error code: 0x%08X (%s)\n", errorMessageID, message)); OutputDebugStringA(Utils::String::VA("Last error code: 0x%08X (%s)\n", errorMessageID, message));

View File

@ -26,7 +26,7 @@ namespace Utils
void WebIO::openSession(std::string useragent) void WebIO::openSession(std::string useragent)
{ {
this->hSession = InternetOpenA(useragent.data(), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); this->hSession = InternetOpenA(useragent.data(), INTERNET_OPEN_TYPE_DIRECT, nullptr, nullptr, 0);
} }
void WebIO::closeSession() void WebIO::closeSession()
@ -271,7 +271,7 @@ namespace Utils
//InternetSetOption(WebIO::m_hConnect, INTERNET_OPTION_RECEIVE_TIMEOUT, &m_timeout, sizeof(m_timeout)); //InternetSetOption(WebIO::m_hConnect, INTERNET_OPTION_RECEIVE_TIMEOUT, &m_timeout, sizeof(m_timeout));
//InternetSetOption(WebIO::m_hConnect, INTERNET_OPTION_SEND_TIMEOUT, &m_timeout, sizeof(m_timeout)); //InternetSetOption(WebIO::m_hConnect, INTERNET_OPTION_SEND_TIMEOUT, &m_timeout, sizeof(m_timeout));
this->hFile = HttpOpenRequestA(this->hConnect, command, this->url.document.data(), NULL, NULL, acceptTypes, dwFlag, 0); this->hFile = HttpOpenRequestA(this->hConnect, command, this->url.document.data(), nullptr, nullptr, acceptTypes, dwFlag, 0);
if (!this->hFile || this->hFile == INVALID_HANDLE_VALUE) if (!this->hFile || this->hFile == INVALID_HANDLE_VALUE)
{ {
@ -301,7 +301,7 @@ namespace Utils
DWORD statusCode = 404; DWORD statusCode = 404;
DWORD length = sizeof(statusCode); DWORD length = sizeof(statusCode);
if (HttpQueryInfo(this->hFile, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE, &statusCode, &length, NULL) == FALSE || (statusCode != 200 && statusCode != 201)) if (HttpQueryInfo(this->hFile, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE, &statusCode, &length, nullptr) == FALSE || (statusCode != 200 && statusCode != 201))
{ {
this->closeConnection(); this->closeConnection();
return ""; return "";