AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
dlfcn.c File Reference
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "dlfcn.h"
Include dependency graph for dlfcn.c:

Data Structures

struct  local_object

Macros

#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS   0x4
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT   0x2
#define IMAGE_NT_OPTIONAL_HDR_MAGIC   0x10b
#define IMAGE_DIRECTORY_ENTRY_IAT   12
#define LOAD_WITH_ALTERED_SEARCH_PATH   0x8
#define _ReturnAddress()
#define DLFCN_NOINLINE

Typedefs

typedef ULONG ULONG_PTR
typedef struct local_object local_object

Functions

static local_objectlocal_search (HMODULE hModule)
static BOOL local_add (HMODULE hModule)
static void local_rem (HMODULE hModule)
static void save_err_str (const char *str, DWORD dwMessageId)
static void save_err_ptr_str (const void *ptr, DWORD dwMessageId)
static UINT MySetErrorMode (UINT uMode)
static HMODULE MyGetModuleHandleFromAddress (const void *addr)
static BOOL MyEnumProcessModules (HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded)
DLFCN_EXPORT void * dlopen (const char *file, int mode)
DLFCN_EXPORT int dlclose (void *handle)
DLFCN_NOINLINE DLFCN_EXPORT void * dlsym (void *handle, const char *name)
DLFCN_EXPORT char * dlerror (void)
static BOOL get_image_section (HMODULE module, int index, void **ptr, DWORD *size)
static const char * get_export_symbol_name (HMODULE module, IMAGE_EXPORT_DIRECTORY *ied, const void *addr, void **func_address)
static BOOL is_valid_address (const void *addr)
static BOOL is_import_thunk (const void *addr)
static void * get_address_from_import_address_table (void *iat, DWORD iat_size, const void *addr)
static BOOL fill_info (const void *addr, Dl_info *info)
DLFCN_EXPORT int dladdr (const void *addr, Dl_info *info)

Variables

static local_object first_object
static char error_buffer [65535]
static BOOL error_occurred
static char module_filename [2 *MAX_PATH]

Macro Definition Documentation

◆ _ReturnAddress

#define _ReturnAddress ( )
Value:
( __builtin_extract_return_addr( __builtin_return_address( 0 ) ) )

◆ DLFCN_NOINLINE

#define DLFCN_NOINLINE

◆ GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS

#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS   0x4

◆ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT

#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT   0x2

◆ IMAGE_DIRECTORY_ENTRY_IAT

#define IMAGE_DIRECTORY_ENTRY_IAT   12

◆ IMAGE_NT_OPTIONAL_HDR_MAGIC

#define IMAGE_NT_OPTIONAL_HDR_MAGIC   0x10b

◆ LOAD_WITH_ALTERED_SEARCH_PATH

#define LOAD_WITH_ALTERED_SEARCH_PATH   0x8

Typedef Documentation

◆ local_object

typedef struct local_object local_object

◆ ULONG_PTR

typedef ULONG ULONG_PTR

Function Documentation

◆ dladdr()

DLFCN_EXPORT int dladdr ( const void * addr,
Dl_info * info )
Here is the call graph for this function:

◆ dlclose()

DLFCN_EXPORT int dlclose ( void * handle)
Here is the call graph for this function:

◆ dlerror()

DLFCN_EXPORT char * dlerror ( void )

◆ dlopen()

DLFCN_EXPORT void * dlopen ( const char * file,
int mode )
Here is the call graph for this function:

◆ dlsym()

DLFCN_NOINLINE DLFCN_EXPORT void * dlsym ( void * handle,
const char * name )
Here is the call graph for this function:

◆ fill_info()

BOOL fill_info ( const void * addr,
Dl_info * info )
static
Here is the call graph for this function:

◆ get_address_from_import_address_table()

void * get_address_from_import_address_table ( void * iat,
DWORD iat_size,
const void * addr )
static
Here is the call graph for this function:

◆ get_export_symbol_name()

const char * get_export_symbol_name ( HMODULE module,
IMAGE_EXPORT_DIRECTORY * ied,
const void * addr,
void ** func_address )
static

◆ get_image_section()

BOOL get_image_section ( HMODULE module,
int index,
void ** ptr,
DWORD * size )
static

◆ is_import_thunk()

BOOL is_import_thunk ( const void * addr)
static

◆ is_valid_address()

BOOL is_valid_address ( const void * addr)
static

◆ local_add()

BOOL local_add ( HMODULE hModule)
static
Here is the call graph for this function:

◆ local_rem()

void local_rem ( HMODULE hModule)
static
Here is the call graph for this function:

◆ local_search()

local_object * local_search ( HMODULE hModule)
static

◆ MyEnumProcessModules()

BOOL MyEnumProcessModules ( HANDLE hProcess,
HMODULE * lphModule,
DWORD cb,
LPDWORD lpcbNeeded )
static
Here is the call graph for this function:

◆ MyGetModuleHandleFromAddress()

HMODULE MyGetModuleHandleFromAddress ( const void * addr)
static

◆ MySetErrorMode()

UINT MySetErrorMode ( UINT uMode)
static

◆ save_err_ptr_str()

void save_err_ptr_str ( const void * ptr,
DWORD dwMessageId )
static
Here is the call graph for this function:

◆ save_err_str()

void save_err_str ( const char * str,
DWORD dwMessageId )
static

Variable Documentation

◆ error_buffer

char error_buffer[65535]
static

◆ error_occurred

BOOL error_occurred
static

◆ first_object

local_object first_object
static

◆ module_filename

char module_filename[2 *MAX_PATH]
static