API Hooking
O Que é API Hooking?
Exemplos Praticos:
Inclusão da biblioteca libMinHook:
#pragma comment(lib, "libMinHook.x64.lib")
PNT_QUERY_SYSTEM_INFORMATION Original_NtQuerySystemInformation; // Ponteiro para a função NtQuerySystemInformation original
PNT_QUERY_SYSTEM_INFORMATION New_NtQuerySystemInformation; // Novo ponteiro para a função NtQuerySystemInformation
wchar_t* process;Função de gancho para NtQuerySystemInformation:
NTSTATUS WINAPI Hooked_NtQuerySystemInformation(
SYSTEM_INFORMATION_CLASS SystemInformationClass,
PVOID SystemInformation,
ULONG SystemInformationLength,
PULONG ReturnLength)Chama a função NtQuerySystemInformation original através do novo ponteiro:
Verificação e manipulação da lista de processos:
Configuração do gancho para NtQuerySystemInformation:
Função principal para DLL:
Interceptação e Modificação da Função NtQuerySystemInformation
Variáveis Importantes
Função Hooked_NtQuerySystemInformation
Configuração do Gancho
Função DllMain
Resumo
Prova de Conceito:

Last updated