mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback. In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure. This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool. This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work). Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way. The gather props functions are kind of daunting NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
35 lines
1.4 KiB
C
35 lines
1.4 KiB
C
#pragma once
|
|
#include <thirdparty/spdlog/include/sinks/basic_file_sink.h>
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// Internals
|
|
BOOL IsBadReadPtrV2(void* ptr);
|
|
BOOL FileExists(const char* szPath);
|
|
MODULEINFO GetModuleInfo(const char* szModule);
|
|
DWORD64 FindPatternSIMD(const char* szModule, const unsigned char* szPattern, const char* szMask);
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// Utility
|
|
void DbgPrint(LPCSTR sFormat, ...);
|
|
void PrintLastError(void);
|
|
void HexDump(const char* szHeader, const char* szLogger, const void* pData, int nSize);
|
|
|
|
string CreateDirectories(string svFilePath);
|
|
string ConvertToWinPath(const string& svInput);
|
|
string ConvertToUnixPath(const string& svInput);
|
|
|
|
string Base64Encode(const string& svInput);
|
|
string Base64Decode(const string& svInput);
|
|
|
|
bool CompareStringAlphabetically(const string& svA, const string& svB);
|
|
bool CompareStringLexicographically(const string& svA, const string& svB);
|
|
|
|
bool StringReplace(string& svInput, const string& svFrom, const string& svTo);
|
|
string StringEscape(const string& svInput);
|
|
string StringUnescape(const string& svInput);
|
|
vector<int> StringToBytes(const string& svInput, bool bNullTerminator);
|
|
vector<int> PatternToBytes(const string& svInput);
|
|
vector<int> IntToDigits(int value);
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|