This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t GetCurrentToc() | |
{ | |
uint32_t* entry_point = *reinterpret_cast<uint32_t**>(0x1001C); // ElfHeader->e_entry | |
return entry_point[1]; | |
} | |
template <typename R, typename... TArgs> | |
inline R GameCall(std::uint32_t addr, TArgs... args) | |
{ | |
volatile opd_s opd = { addr, GetCurrentToc() }; |