- Статус
- Оффлайн
- Регистрация
- 21 Июн 2022
- Сообщения
- 148
- Реакции
- 368
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Пытаюсь хукнуть функцию, внутри хука вывожу инфу типа "here!", но она не выводится, хотя, как можете увидеть, все данные валидны.
C++:
find_sig - def.
ctx::m_spotify_image = GetModuleHandleA(nullptr);
bool hooks::hook(const LPVOID target, const LPVOID detour, LPVOID og)
{
if (MH_CreateHook(target, detour, &og) == MH_OK && MH_EnableHook(target) == MH_OK)
{
printf("[ hook ] created target: 0x%p, detour: 0x%p, og: 0x%p\n", target, detour, og);
m_targets.emplace_back(target);
printf("[ hook ] targets size: %u\n", m_targets.size());
return true;
}
return false;
}
void __fastcall hooks::create_track(void* ecx, void* edx, char a2)
{
printf("here!\n");
og::m_create_track(ecx, edx, a2);
}
void hooks::instance()
{
if (MH_Initialize() == MH_OK)
{
static const auto f = static_cast<void*>(utils::find_sig(ctx::m_spotify_image,
"68 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 8B F1 8B 8E ? ? ? ? 8A 5D 08"));
hook(f, create_track, og::m_create_track);
}
}