This program will print the address Beepin kernel32:
#include <windows.h>
#include <stdio.h>
int main(void)
{
HMODULE hMod = GetModuleHandle("kernel32.dll");
void* fn = GetProcAddress(hMod, "Beep");
printf("%p", fn);
}
I skipped error checking for simplicity. In a real program, you would not do that.
source
share