Better hooked function calling.
This commit is contained in:
parent
9aec8b2a1b
commit
8fb298ed16
@ -26,7 +26,7 @@ namespace Components
|
||||
memcpy((void*)0x66E1CB0, &fastfiles, sizeof(fastfiles));
|
||||
Game::LoadInitialFF();
|
||||
|
||||
Utils::Hook::Call<void>(0x4F84C0);
|
||||
Utils::Hook::Call<void()>(0x4F84C0)();
|
||||
}
|
||||
|
||||
void Dedicated::MapRotate()
|
||||
@ -129,7 +129,7 @@ namespace Components
|
||||
callback();
|
||||
}
|
||||
|
||||
Utils::Hook::Call<void>(0x5A8E80);
|
||||
Utils::Hook::Call<void()>(0x5A8E80)();
|
||||
}
|
||||
|
||||
Dedicated::Dedicated()
|
||||
|
@ -27,14 +27,8 @@ namespace Components
|
||||
DWORD Playlist::StorePlaylistStub(const char** buffer)
|
||||
{
|
||||
Playlist::CurrentPlaylistBuffer = *buffer;
|
||||
//return Utils::Hook::Call<DWORD>(0x4C0350);
|
||||
__asm
|
||||
{
|
||||
push buffer
|
||||
mov eax, 4C0350h
|
||||
call eax
|
||||
add esp, 4h
|
||||
}
|
||||
|
||||
return Utils::Hook::Call<DWORD(const char**)>(0x4C0350)(buffer);
|
||||
}
|
||||
|
||||
void Playlist::PlaylistRequest(Network::Address address, std::string data)
|
||||
|
@ -23,13 +23,9 @@ namespace Utils
|
||||
void* GetAddress();
|
||||
void Quick();
|
||||
|
||||
template <typename T> static T Call(DWORD function)
|
||||
template <typename T> static std::function<T> Call(DWORD function)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, function
|
||||
call eax
|
||||
}
|
||||
return std::function<T>((T*)function);
|
||||
}
|
||||
|
||||
static void SetString(void* place, const char* string, size_t length);
|
||||
|
Loading…
Reference in New Issue
Block a user