比如我加载user32,获取MessageBox的地址,为空;
但是加载msvcrt.dll,获取system的地址就能正确得到地址。(打开注释部分的代码)同样的问题还出现在kernel32
============
#include <windows.h>
#include <winbase.h>
#include <winuser.h>
#include <stdio.h>typedef void (*MYPROC)(LPTSTR);
int main()
{// char lib_func_name[]="system";
char lib_func_name[]="MessageBox"; HINSTANCE LibHandle;
MYPROC ProcAdd;

LibHandle = LoadLibrary("user32.dll");
// LibHandle = LoadLibrary("msvcrt.dll");

if(LibHandle != NULL){
printf("%s LibHandle = x%x\n",lib_func_name, LibHandle); ProcAdd=(MYPROC)GetProcAddress(LibHandle,lib_func_name);
if (ProcAdd != NULL){
printf("%s = x%x\n", lib_func_name,ProcAdd);
}else {
printf("%s = not found\n", lib_func_name);
}
}
return 0;