libPeConv
A library to load, manipulate, dump PE files.
function_resolver.cpp
Go to the documentation of this file.
2
3#include <iostream>
4
5FARPROC peconv::default_func_resolver::resolve_func(LPSTR lib_name, LPSTR func_name)
6{
7 HMODULE libBasePtr = LoadLibraryA(lib_name);
8 if (libBasePtr == NULL) {
9 std::cerr << "Could not load the library!" << std::endl;
10 return NULL;
11 }
12 FARPROC hProc = GetProcAddress(libBasePtr, func_name);
13 if (hProc == NULL) {
14 std::cerr << "Could not load the function!" << std::endl;
15 return NULL;
16 }
17 return hProc;
18}
virtual FARPROC resolve_func(LPSTR lib_name, LPSTR func_name)
Definitions of basic Imports Resolver classes. They can be used for filling imports when the PE is lo...