wiki.icculus.org
[ front page | index | search | recent changes | git repo | offline html ]

MOJOELF_dlsym

Lookup a symbol in an ELF binary.

Header File

Defined in <mojoelf.h>

Syntax

void * MOJOELF_dlsym(void *lib, const char *sym);

Function Parameters

void * lib a handle from a MojoELF-opened ELF binary.
const char * sym the symbol to look up.

Return Value

(void *) Returns non-NULL address of the symbol if found, NULL if not found. On failure, a human-readable error message may be obtained by calling MOJOELF_dlerror().

Remarks

The lib param must be a pointer returned from MOJOELF_dlopen_mem() or MOJOELF_dlopen_file(). You can not use a handle returned from the C runtime's dlopen() function here!

A NULL return value means the symbol was not found. Strictly speaking, though, a symbol could have a valid address of NULL--zero--but this is not allowed in MojoELF, and would be extremely foolish anyhow.

Thread Safety

this function is not thread-safe.

Version

This function is available since MojoELF 1.0.0.


CategoryAPI, CategoryAPIFunction, CategoryMojoELF


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.