获取system和LoadLibraryA函数的地址

GetLoadSysAdd.cpp

#include <windows.h>
#include <stdio.h>
typedef void (*MYPROC)(LPTSTR);
int main()

  HINSTANCE LibHandle;
  MYPROC ProcAdd;
    LibHandle = LoadLibrary("msvcrt");
  printf("msvcrt LibHandle = //x%x/n", LibHandle);
  ProcAdd=(MYPROC)GetProcAddress(LibHandle,"system"); 
  printf("system = //x%x/n", ProcAdd);

  LibHandle = LoadLibrary("kernel32");
  printf("kernel32 LibHandle = //x%x/n", LibHandle);
  ProcAdd=(MYPROC)GetProcAddress(LibHandle,"LoadLibraryA"); 
  printf("LoadLibrary = //x%x/n", ProcAdd);
  return 0;
}
 

posted @ 2008-01-20 09:33  y0umer  阅读(623)  评论(0编辑  收藏  举报