This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/script_local.cpp
yubie 062c95b374
feat(anticheat): Anticheat bypass improvements (#2463)
- Add more metrics to bad_metrics set
- Add MM Filtering (This metric shouldnt be normally called anyway)
- Improve QD Hook to increase AC verifier delay when detected
- Removed gameskeleton hook in favor of patching ac at init
- Added tamperactions check to gameskeleton patcher
2023-11-30 10:47:39 +01:00

51 lines
1.0 KiB
C++

#include "script_local.hpp"
#include "common.hpp"
#include "gta/script_thread.hpp"
#include "pointers.hpp"
namespace big
{
script_local::script_local(rage::scrThread* thread, std::size_t index) :
m_index(index),
m_stack(thread->m_stack)
{
}
script_local::script_local(PVOID stack, std::size_t index) :
m_index(index),
m_stack(stack)
{
}
script_local::script_local(std::size_t index) :
m_index(index),
m_stack(nullptr)
{
}
script_local script_local::set(rage::scrThread* thread)
{
return script_local(thread, m_index);
}
script_local script_local::set(void* stack)
{
return script_local(stack, m_index);
}
script_local script_local::at(std::ptrdiff_t index)
{
return script_local(m_stack, m_index + index);
}
script_local script_local::at(std::ptrdiff_t index, std::size_t size)
{
return script_local(m_stack, m_index + 1 + (index * size));
}
void* script_local::get()
{
return reinterpret_cast<uintptr_t*>((uintptr_t)m_stack + (m_index * sizeof(uintptr_t)));
}
}