r5sdk/r5dev/tier0/commandline.h

51 lines
1.5 KiB
C
Raw Normal View History

2022-01-10 01:20:44 +01:00
#pragma once
#include "public/icommandline.h"
2022-01-10 01:20:44 +01:00
class CCommandLine : public ICommandLine // VTABLE @0x141369C78 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
2022-01-10 01:20:44 +01:00
{
public:
static void StaticCreateCmdLine(CCommandLine* thisptr, const char* pszCommandLine);
void AppendParametersFromFile(const char* const pszConfig);
private:
enum
{
MAX_PARAMETER_LEN = 128,
MAX_PARAMETERS = 256,
};
char* m_pszCmdLine;
2022-06-24 12:10:46 +02:00
char m_Pad[0x18]; // <-- thread/mutex stuff.
int m_nParmCount;
char* m_ppParms[MAX_PARAMETERS];
2022-01-10 01:20:44 +01:00
};
extern bool g_bCommandLineCreated;
extern CCommandLine* g_pCmdLine;
//-----------------------------------------------------------------------------
// Instance singleton and expose interface to rest of code
//-----------------------------------------------------------------------------
inline CCommandLine* CommandLine(void)
{
return g_pCmdLine;
}
2022-01-10 01:20:44 +01:00
inline void(*CCommandLine__CreateCmdLine)(CCommandLine* thisptr, const char* pszCommandLine);
2022-01-10 01:20:44 +01:00
///////////////////////////////////////////////////////////////////////////////
class VCommandLine : public IDetour
2022-01-10 01:20:44 +01:00
{
virtual void GetAdr(void) const
2022-01-10 01:20:44 +01:00
{
LogFunAdr("CCommandLine::CreateCmdLine", CCommandLine__CreateCmdLine);
2022-01-10 01:20:44 +01:00
}
virtual void GetFun(void) const
{
g_GameDll.FindPatternSIMD("48 89 54 24 ?? 48 89 4C 24 ?? 53 41 55 B8 ?? ?? ?? ??").GetPtr(CCommandLine__CreateCmdLine);
}
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Detour(const bool bAttach) const;
2022-01-10 01:20:44 +01:00
};
///////////////////////////////////////////////////////////////////////////////