'My getprocaddress function returns 0000 I've read that it's because I have to compile for ANSI instead of Unicode how do I do this?
#include <Windows.h>
#include <stdio.h>
int main() {
HMODULE hModule = LoadLibrary(L"kernel32.dll");
FARPROC func = GetProcAddress(hModule, "LoadLibraryA");
FARPROC func2 = GetProcAddress(hModule, "GetProcAddress");
FARPROC func3 = GetProcAddress(hModule, "ExitProcess");
printf("LoadLibraryA 0x%08x\n", (unsigned int)func);
printf("GetProcAddress 0x%08x\n", (unsigned int)func2);
printf("ExitProcess 0x%08x\n", (unsigned int)func3);
FreeLibrary(hModule);
}
output:
LoadLibraryA 0x00000000
GetProcAddress 0x00000000
ExitProcess 0x00000000
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
