2022-01-10 01:20:44 +01:00
|
|
|
#pragma once
|
2022-08-09 17:18:07 +02:00
|
|
|
#include "public/icommandline.h"
|
2022-01-10 01:20:44 +01:00
|
|
|
|
2022-06-24 02:42:28 +02: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
|
|
|
{
|
2023-06-30 21:59:16 +02:00
|
|
|
public:
|
2023-07-01 02:11:39 +02:00
|
|
|
static void StaticCreateCmdLine(CCommandLine* thisptr, const char* pszCommandLine);
|
2023-06-30 21:59:16 +02:00
|
|
|
void AppendParametersFromFile(const char* const pszConfig);
|
|
|
|
|
2022-06-24 02:42:28 +02:00
|
|
|
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.
|
2022-06-24 02:42:28 +02:00
|
|
|
int m_nParmCount;
|
|
|
|
char* m_ppParms[MAX_PARAMETERS];
|
2022-01-10 01:20:44 +01:00
|
|
|
};
|
2022-04-18 03:35:08 +02:00
|
|
|
|
2023-07-01 02:11:39 +02:00
|
|
|
extern bool g_bCommandLineCreated;
|
2022-04-18 03:35:08 +02:00
|
|
|
extern CCommandLine* g_pCmdLine;
|
2023-06-30 21:59:16 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Instance singleton and expose interface to rest of code
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
inline CCommandLine* CommandLine(void)
|
|
|
|
{
|
|
|
|
return g_pCmdLine;
|
|
|
|
}
|
2022-01-10 01:20:44 +01:00
|
|
|
|
2024-01-02 15:21:36 +01:00
|
|
|
inline void(*CCommandLine__CreateCmdLine)(CCommandLine* thisptr, const char* pszCommandLine);
|
2023-07-01 02:11:39 +02:00
|
|
|
|
2022-01-10 01:20:44 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VCommandLine : public IDetour
|
2022-01-10 01:20:44 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-01-10 01:20:44 +01:00
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
LogFunAdr("CCommandLine::CreateCmdLine", CCommandLine__CreateCmdLine);
|
2022-01-10 01:20:44 +01:00
|
|
|
}
|
2023-07-01 02:11:39 +02:00
|
|
|
virtual void GetFun(void) const
|
2022-04-18 03:35:08 +02:00
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
g_GameDll.FindPatternSIMD("48 89 54 24 ?? 48 89 4C 24 ?? 53 41 55 B8 ?? ?? ?? ??").GetPtr(CCommandLine__CreateCmdLine);
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2023-07-01 02:11:39 +02:00
|
|
|
virtual void GetVar(void) const { }
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
2023-11-26 13:21:20 +01:00
|
|
|
virtual void Detour(const bool bAttach) const;
|
2022-01-10 01:20:44 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|