So, I'm trying to use a function from DLL file and for some reason I can't open the DLL file: when I'm using the LoadLibrary
function it returns as NULL
I'm freaking out that I can't find this bug
typedef unsigned int (WINAPI* AvVersion)(void);
void secret()
{
HMODULE dll = LoadLibrary("Secret.dll");
if (dll == NULL)
{
std::cout << "coudlnt open ""secret.dll""\nError Code:" << GetLastError() << std::endl;
return;
}
AvVersion function = (AvVersion)GetProcAddress(dll, "TheAnswerToLifeTheUniverseAndEverything");
std::cout << "result:" << function() << std::endl;
}
The code number is 126
and the name of the function is TheAnswerToLifeTheUniverseAndEverything