r5sdk/r5dev/public/utility/sigcache.h
Kawe Mazidjatari b90d6f929c Finish Signature Cache Map implementation
* Fixed bug where the system still added entries after we are initialized (file has already been written to the disk).
* Moved loading logic to CSigCache class.
* Dedicated and Host/Client now have their own cache files.
2022-12-02 12:12:13 +01:00

36 lines
668 B
C++

#ifndef SIGCACHE_H
#define SIGCACHE_H
#include "protoc/sig_map.pb.h"
#define SIGDB_MAGIC (('p'<<24)+('a'<<16)+('M'<<8)+'S')
#define SIGDB_VERSION 0x1
#ifdef DEDICATED
#define SIGDB_FILE "cfg\\server\\startup.bin"
#else
#define SIGDB_FILE "cfg\\client\\startup.bin"
#endif
class CSigCache
{
public:
void AddEntry(const string& svPattern, const uint64_t nRVA);
bool FindEntry(const string& svPattern, uint64_t& nRVA) const;
bool LoadCache(const string& svCacheFile);
bool WriteCache(const string& svCacheFile);
SigMap_Pb m_Cache;
bool m_bInitialized;
};
struct SigDBHeader_t
{
int m_nMagic;
int m_nVersion;
FILETIME m_FileTime;
};
#endif // !SIGCACHE_H