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
|
|
|
{
|
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
|
|
|
|
|
|
|
extern CCommandLine* g_pCmdLine;
|
2022-04-16 00:30:46 +02:00
|
|
|
CCommandLine* CommandLine(void);
|
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
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| VAR: g_pCmdLine : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pCmdLine));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2022-01-10 01:20:44 +01:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetFun(void) const { }
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2022-08-09 03:02:00 +02:00
|
|
|
g_pCmdLine = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>(
|
2022-04-18 03:35:08 +02:00
|
|
|
"\x40\x55\x48\x83\xEC\x20\x48\x8D\x6C\x24\x00\x48\x89\x5D\x10\x49\xC7\xC0\x00\x00\x00\x00"),
|
|
|
|
"xxxxxxxxxx?xxxxxxx????").FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 250).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CCommandLine*>();
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
2022-01-10 01:20:44 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VCommandLine);
|