yuv420p10le 2a003b95ba v1.40.3.8555+ support and other quirks.
* Now works with v1.40.3.8555 (inlined) and older versions too.
* Added a whitelist of features now rather than a global-enable.
* Refactored some code to use std::optional.
* Linux: Wrote proper hooking function. No unhooking support as it's unneeded.
* Windows: Now uses SafetyHook as we need trampolines.
* Windows: When building for debug, you can see queried features and their caller (return address offset from PMS base address); reverse on your own or query me.
2024-06-11 20:41:05 +03:00

34 lines
979 B
C++

#pragma once
#include <cstdint>
#include <string>
#include <optional>
#include <tuple>
#ifndef member_at
#define member_at(T, offset, name) \
__forceinline auto &name() \
{ \
return *reinterpret_cast<T *>(reinterpret_cast<uintptr_t>(this) + offset); \
} \
__forceinline auto &name() const \
{ \
return *reinterpret_cast<const T *>(reinterpret_cast<uintptr_t>(this) + offset); \
}
#endif
class FeatureManager
{
public:
static inline size_t m_map_offset{};
member_at(uintptr_t, m_map_offset, m_feature_map);
};
uintptr_t get_current_process_handle();
std::optional<std::tuple<uintptr_t, uintptr_t>> get_section_info(std::string_view name);
std::optional<uintptr_t> sig_scan(const uintptr_t start, const uintptr_t end, std::string_view pattern);
uint64_t hook_is_feature_available(uintptr_t rcx, const char* guid);
uint64_t* hook_map_find(uintptr_t* rcx, uintptr_t rdx, const char** str);
FeatureManager* hook_feature_manager_init(FeatureManager* rcx);
void hook();