
* Complete player and network UI redesign, meant to show all features instead of stuffing them into tiny boxes * Added option to delete player vehicles * Better clone player (now clones head blend too) * Better host token spoofing, with an option to enter your own * Better host token spoofing detection * Better desync kick prot detections * A script blocker for the entire session (per-player options will be added later) * Added option to spoof data/DLC hashes * Logging framework that allows developers to easily debug false positives * Major protection improvements
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
#include "core/scr_globals.hpp"
|
|
#include "hooking/hooking.hpp"
|
|
#include "pointers.hpp"
|
|
#include "services/script_patcher/script_patcher_service.hpp"
|
|
|
|
#include <script/globals/GlobalPlayerBD.hpp>
|
|
#include <script/scrProgram.hpp>
|
|
|
|
static int old_cayo_flags;
|
|
static int old_shop_index;
|
|
|
|
namespace big
|
|
{
|
|
class script_vm_guard
|
|
{
|
|
rage::scrProgram* m_program;
|
|
uint8_t** m_orig_bytecode;
|
|
|
|
public:
|
|
script_vm_guard(rage::scrProgram* program) :
|
|
m_program(program)
|
|
{
|
|
m_orig_bytecode = program->m_code_blocks;
|
|
|
|
if (auto bytecode = g_script_patcher_service->get_script_bytecode(program->m_name_hash))
|
|
program->m_code_blocks = bytecode;
|
|
|
|
if (g_pointers->m_gta.m_script_globals[0xA])
|
|
{
|
|
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CurrentShopIndex = old_shop_index;
|
|
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CayoPericoFlags = old_cayo_flags;
|
|
}
|
|
|
|
g.in_script_vm = true;
|
|
}
|
|
|
|
~script_vm_guard()
|
|
{
|
|
m_program->m_code_blocks = m_orig_bytecode;
|
|
|
|
if (g_pointers->m_gta.m_script_globals[0xA])
|
|
{
|
|
old_shop_index = scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CurrentShopIndex;
|
|
old_cayo_flags = scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CayoPericoFlags;
|
|
|
|
if (g.spoofing.hide_from_player_list)
|
|
{
|
|
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CurrentShopIndex = -1;
|
|
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].CayoPericoFlags = 1;
|
|
}
|
|
}
|
|
|
|
g.in_script_vm = false;
|
|
}
|
|
};
|
|
|
|
rage::eThreadState hooks::script_vm(uint64_t* start_stack, uint64_t** scr_globals, rage::scrProgram* program, rage::scrThreadContext* ctx)
|
|
{
|
|
script_vm_guard guard(program);
|
|
return g_hooking->get_original<hooks::script_vm>()(start_stack, scr_globals, program, ctx);
|
|
}
|
|
} |