-
Автор темы
- #1
I was wondering if someone could help me converting this into legendware :D
C++:
void* fn_get_account_data = reinterpret_cast<decltype(fn_get_account_data)>(relative_to_absolute(pattern_scan("client.dll",
{0xE8, 0, 0, 0, 0, 0x85, 0xC0, 0x74, 0xEE }) + 1)); // E8 ? ? ? ? 83 F8 06 77 42 + 1 [relative]
// original typedef: int(__thiscall* get_account_data)(void*);
enum class account_status_t : int
{
none = 0,
not_identifying,
awaiting_cooldown,
eligible,
eligible_with_takeover,
elevated, // prime
account_cooldown
};
int __fastcall get_account_data(void* _this, void* edx) noexcept
{
const auto ret = original::get_account_data(_this);
account_status_t& account_status = *reinterpret_cast<account_status_t*>(ret + 24);
static const bool is_originally_prime_account = account_status == account_status_t::elevated; // not good fix
if (!is_originally_prime_account)
{
account_status = config::fake_prime ? account_status_t::elevated : account_status_t::none;
}
return ret;
}