added some little stuff

removes "no work" string for Aniyah Incursion map
adds an unlock all cmd
and moved some code
This commit is contained in:
Sku-111 2023-10-25 19:26:27 +02:00
parent 7cbdc462df
commit 8fcf87e2d0
11 changed files with 71 additions and 22 deletions

View File

@ -52,8 +52,11 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid)
printf("Base Address: %p\n", base);
addCustomDvars();
addCustomCmds();
patchGame();
printf("Discord: discord.gg/donetsk\n");
cmd_args = (CmdArgs*)(0x14D20CBD0_g);
clientUIActives = (clientUIActive_t*)(0x14EEF1280_g);

View File

@ -3,22 +3,7 @@
void addCustomDvars()
{
Cmd_AddCommandInternal("set_byte", set_byte_f, &set_byte_f_VAR);
Cmd_AddCommandInternal("set_short", set_short_f, &set_short_f_VAR);
Cmd_AddCommandInternal("set_int", set_int_f, &set_int_f_VAR);
Cmd_AddCommandInternal("set_float", set_float_f, &set_float_f_VAR);
Cmd_AddCommandInternal("set_pointer", set_pointer_f, &set_pointer_f_VAR);
Cmd_AddCommandInternal("quit", Cmd_Quit_f, &quit_f_VAR);
Cmd_AddCommandInternal("openmenu", Cmd_OpenMenu_f, &openmenu_f_VAR);
Cmd_AddCommandInternal("addbot", Cmd_AddBot_f, &addbot_f_VAR);
Cmd_AddCommandInternal("ddldump", Cmd_DDLDump_f, &ddldump_f_VAR);
Cmd_AddCommandInternal("weapondefdump", Cmd_WeaponDefDump_f, &weapondefdump_f_VAR);
//Cmd_AddCommandInternal("view_vehicle_ents", Cmd_ViewVehicleEnts_f, &view_vehicle_ents_f_VAR);
// Cmd_AddCommandInternal("save_inventory", Cmd_LoadoutSave_f, &loadout_save_f_VAR);
Cmd_AddCommandInternal("map_restart", SV_CmdsMP_MapRestart_f, &MapRestart_f_VAR);
Cmd_AddCommandInternal("fast_restart", SV_CmdsMP_FastRestart_f, &FastRestart_f_VAR);
Cmd_AddCommandInternal("setOmnvar", Cmd_Omnvar_Set_f, &omnvar_set_f_VAR);
// Cmd_AddCommandInternal("dumpomnvars", Cmd_Omnvars_Dump_f, &omnvar_dump_f_VAR);
}
dvar_t* Dvar_RegisterBool_Detour(const char* dvarName, bool value, unsigned int flags, const char* description)
@ -45,3 +30,4 @@ dvar_t* Dvar_FindVarByName_Detour(const char* dvarName)
dvar_t* ret = dvar_findvarbyname.stub<dvar_t*>(dvarName);
return ret;
}

View File

@ -17,3 +17,8 @@ int DB_PollFastfileState_Detour(const char* zoneName)
return db_pollfastfilestate.stub<int>(zoneName);
}
bool DB_CheckXFileVersion_Detour()
{
return true;
}

View File

@ -6,3 +6,6 @@ int DB_LoadXFile_Detour(const char* zoneName, uintptr_t zoneMem, uintptr_t asset
inline utils::hook::detour db_pollfastfilestate;
int DB_PollFastfileState_Detour(const char* zoneName);
inline utils::hook::detour db_checkxfileversion;
bool DB_CheckXFileVersion_Detour();

View File

@ -511,6 +511,7 @@ cmd_function_s FastRestart_f_VAR;
cmd_function_s MapRestart_f_VAR;
cmd_function_s omnvar_set_f_VAR;
cmd_function_s omnvar_dump_f_VAR;
cmd_function_s unlockall_f_VAR;
CmdArgs* cmd_args;

View File

@ -130,6 +130,7 @@ extern cmd_function_s FastRestart_f_VAR;
extern cmd_function_s MapRestart_f_VAR;
extern cmd_function_s omnvar_set_f_VAR;
extern cmd_function_s omnvar_dump_f_VAR;
extern cmd_function_s unlockall_f_VAR;
extern CmdArgs* cmd_args;
void* RtlAddVectoredExceptionHandler(LONG First, PVECTORED_EXCEPTION_HANDLER Handler);

View File

@ -1,6 +1,27 @@
#include "g_cmds.h"
#include "game_inc.h"
void addCustomCmds()
{
Cmd_AddCommandInternal("set_byte", set_byte_f, &set_byte_f_VAR);
Cmd_AddCommandInternal("set_short", set_short_f, &set_short_f_VAR);
Cmd_AddCommandInternal("set_int", set_int_f, &set_int_f_VAR);
Cmd_AddCommandInternal("set_float", set_float_f, &set_float_f_VAR);
Cmd_AddCommandInternal("set_pointer", set_pointer_f, &set_pointer_f_VAR);
Cmd_AddCommandInternal("quit", Cmd_Quit_f, &quit_f_VAR);
Cmd_AddCommandInternal("openmenu", Cmd_OpenMenu_f, &openmenu_f_VAR);
Cmd_AddCommandInternal("addbot", Cmd_AddBot_f, &addbot_f_VAR);
Cmd_AddCommandInternal("ddldump", Cmd_DDLDump_f, &ddldump_f_VAR);
Cmd_AddCommandInternal("weapondefdump", Cmd_WeaponDefDump_f, &weapondefdump_f_VAR);
//Cmd_AddCommandInternal("view_vehicle_ents", Cmd_ViewVehicleEnts_f, &view_vehicle_ents_f_VAR);
// Cmd_AddCommandInternal("save_inventory", Cmd_LoadoutSave_f, &loadout_save_f_VAR);
Cmd_AddCommandInternal("map_restart", SV_CmdsMP_MapRestart_f, &MapRestart_f_VAR);
Cmd_AddCommandInternal("fast_restart", SV_CmdsMP_FastRestart_f, &FastRestart_f_VAR);
Cmd_AddCommandInternal("setOmnvar", Cmd_Omnvar_Set_f, &omnvar_set_f_VAR);
// Cmd_AddCommandInternal("dumpomnvars", Cmd_Omnvars_Dump_f, &omnvar_dump_f_VAR);
Cmd_AddCommandInternal("unlockAll", Cmd_UnlockAll_f, &unlockall_f_VAR);
}
void G_CmdsMP_ClientCommand_Detour(int clientNum)
{
g_entities = *reinterpret_cast<gentity_s**>(0x14BC20F00_g);
@ -376,3 +397,8 @@ void Cmd_LoadoutSave_f()
{
SaveInventory();
}
void Cmd_UnlockAll_f()
{
Cbuf_AddText("seta unlockAllItems 1");
}

View File

@ -1,6 +1,8 @@
#pragma once
#include "Main.hpp"
void addCustomCmds();
inline utils::hook::detour g_cmdsmp_clientcommand;
void G_CmdsMP_ClientCommand_Detour(int clientNum);
@ -31,3 +33,5 @@ void Cmd_WeaponDefDump_f();
void Cmd_ViewVehicleEnts_f();
void Cmd_LoadoutSave_f();
void Cmd_UnlockAll_f();

View File

@ -8,4 +8,6 @@ void PartyHost_StartPrivateParty_Detour(int localClientNum, int localControllerI
partyhost_startprivateparty.stub<void>(localClientNum, localControllerIndex, currentlyActive, hostType);
LoadInventory();
Cbuf_AddText("set cl_textChatEnabled 1");
}

View File

@ -5,11 +5,15 @@ int iTick = 0;
bool bFinished;
bool btoggle;
dvar_t* cl_textChatEnabled = reinterpret_cast<dvar_t*>(0x14EEB0738_g);
dvar_t* com_timescale = reinterpret_cast<dvar_t*>(0x14D3865E8_g);
uintptr_t xuid_generated;
int collision_ticker;
void R_EndFrame_Detour()
{
if (strcmp(Dvar_GetStringSafe("NSQLTTMRMP"), "mp_donetsk") == 0) {
if (strcmp(Dvar_GetStringSafe("NSQLTTMRMP"), "mp_donetsk") == 0)
{
*reinterpret_cast<int*>(0x14E385A68_g) = 80;
*reinterpret_cast<int*>(0x14E385A78_g) = 80;
if (collision_ticker == 60) {
@ -140,6 +144,9 @@ void hooks()
com_gamemode_supportsfeature.create(0x1410C8980_g, Com_GameMode_SupportsFeature_Detour);
lui_cod_luacall_getblueprintdata_impl.create(0x140F58A00_g, LUI_CoD_LuaCall_GetBlueprintData_impl_Detour);
// remove FF Header version check
// db_checkxfileversion.create(0x1411A7840_g, DB_CheckXFileVersion_Detour);
}
void patchGame()
@ -181,4 +188,10 @@ void patchGame()
utils::hook::nop(0x14165E660_g, 5);
utils::hook::nop(0x141665289_g, 5);
utils::hook::nop(0x14166567D_g, 5);
// set com_timescale dvar to read only
utils::hook::set<unsigned int>(0x1412B26CF_g, 8192);
// remove FF Header version check
// utils::hook::set<byte>(0x1411A776B_g, 0xEB);
}

View File

@ -15,8 +15,13 @@ const char* SEH_StringEd_GetString_Detour(const char* pszReference)
GamerProfile_SetDataByName(0, "acceptedEULA", 1);
GamerProfile_SetDataByName(0, "hasEverPlayed_MainMenu", 1);
if (strstr(pszReference, "LUA_MENU/MAPNAME_ANIYAH") ||
strstr(pszReference, "LUA_MENU/MAPNAME_DEADZONE") ||
// LUA_MENU/MAPNAME_ANIYAH // Aniyah Palace
if (std::string(pszReference) == "LUA_MENU/MAPNAME_ANIYAH")
{
return "^1no work";
}
if (strstr(pszReference, "LUA_MENU/MAPNAME_DEADZONE") ||
strstr(pszReference, "LUA_MENU/MAPNAME_M_CAGE") ||
strstr(pszReference, "LUA_MENU/MAPNAME_CAVE_AM") ||
strstr(pszReference, "LUA_MENU/MAPNAME_CAVE") ||