52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
|
|
struct Il2cppSlotDefinition {
|
|
uintptr_t slot_offset;
|
|
uintptr_t gameassembly_offset;
|
|
const char* name;
|
|
};
|
|
|
|
extern const std::array<Il2cppSlotDefinition, 71> kIl2cppSlotMap;
|
|
|
|
void Log(const char* fmt, ...);
|
|
void ResolveGABypassSlots();
|
|
void* GetIl2cppSlot(uintptr_t slot_offset);
|
|
uintptr_t GetGameAssemblyBase();
|
|
bool WaitForGameAssembly(uint32_t timeout_ms = 0, uint32_t poll_ms = 100);
|
|
bool EnsureIl2CppThreadAttached();
|
|
bool WaitForIl2CppThreadAttach(uint32_t timeout_ms = 15000, uint32_t poll_ms = 100);
|
|
void DetachIl2CppThreadIfAttached();
|
|
void SetGameThreadContext(bool enabled);
|
|
bool IsGameThreadContext();
|
|
|
|
std::wstring Utf8ToWide(const std::string& value);
|
|
std::string WideToUtf8(const std::wstring& value);
|
|
|
|
bool IsWindowsBuildAtLeast(uint32_t build_number);
|
|
void ToggleConsole(bool enabled);
|
|
bool ScanLoadedModulesForInjectionMarkers();
|
|
|
|
void InitializeI18N();
|
|
const char* Tr(const char* key);
|
|
void SetLanguage(Language language);
|
|
|
|
void ApplyThemeDefault();
|
|
void ApplyThemeEvangelionUnit01();
|
|
void ApplyThemeEvangelionUnit02();
|
|
void ApplyThemeMatrix();
|
|
|
|
bool IsKeyPressedOnce(int vk);
|
|
|
|
template <typename Fn>
|
|
Fn GetIl2cppFn(uintptr_t slot_offset) {
|
|
if (!IsGameThreadContext()) {
|
|
return nullptr;
|
|
}
|
|
if (!EnsureIl2CppThreadAttached()) {
|
|
return nullptr;
|
|
}
|
|
return reinterpret_cast<Fn>(GetIl2cppSlot(slot_offset));
|
|
}
|