libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
libpeconv
src
function_resolver.cpp
Go to the documentation of this file.
1
#include "
peconv/function_resolver.h
"
2
3
#include <iostream>
4
5
FARPROC
peconv::default_func_resolver::resolve_func
(
LPCSTR
lib_name
,
LPCSTR
func_name
)
6
{
7
HMODULE
libBasePtr
=
LoadLibraryA
(
lib_name
);
8
if
(
libBasePtr
==
NULL
) {
9
std::cerr <<
"Could not load the library: "
<<
lib_name
<< std::endl;
10
return
NULL
;
11
}
12
FARPROC
hProc
=
GetProcAddress
(
libBasePtr
,
func_name
);
13
if
(
hProc
==
NULL
) {
14
ULONGLONG
func_val
= (
ULONGLONG
)
func_name
;
15
//is only the first WORD filled?
16
bool
is_ord
= (
func_val
& (0x0FFFF)) ==
func_val
;
17
std::cerr <<
"Could not load the function: "
<<
lib_name
<<
"."
;
18
if
(
is_ord
) {
19
std::cerr << std::hex <<
"0x"
<<
func_val
;
20
}
21
else
{
22
std::cerr <<
func_name
;
23
}
24
std::cerr << std::endl;
25
return
NULL
;
26
}
27
return
hProc
;
28
}
peconv::default_func_resolver::resolve_func
virtual FARPROC resolve_func(LPCSTR lib_name, LPCSTR func_name)
Definition
function_resolver.cpp:5
parse_delayed_desc
bool parse_delayed_desc(BYTE *modulePtr, const size_t moduleSize, const ULONGLONG img_base, LPSTR lib_name, const T_FIELD ordinal_flag, IMAGE_DELAYLOAD_DESCRIPTOR *desc, peconv::t_function_resolver *func_resolver)
Definition
delayed_imports_loader.cpp:26
function_resolver.h
Definitions of basic Imports Resolver classes. They can be used for filling imports when the PE is lo...
Generated on Thu Apr 11 2024 16:32:36 for libPeConv by
1.10.0