# QuickReference If you want to paste this into a text editor that can't handle the fancy Unicode section headers, try using [QuickReferenceNoUnicode](QuickReferenceNoUnicode) instead. ```c // MojoELF API Quick Reference // // https://github.com/icculus/mojoelf // // The latest version of this document can be found at https://wiki.icculus.org/MojoELF/QuickReference // Based on MojoELF version 0.0.9 // // This can be useful in an IDE with search and syntax highlighting. // // Original idea for this document came from Dan Bechard (thanks!) // ASCII art generated by: https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow (with modified 'S' for readability) // ███╗ ███╗ ██████╗ ██╗ ██████╗ ███████╗ ██╗ ███████╗ // ████╗ ████║ ██╔═══██╗ ██║ ██╔═══██╗ ██╔════╝ ██║ ██╔════╝ // ██╔████╔██║ ██║ ██║ ██║ ██║ ██║ █████╗ ██║ █████╗ // ██║╚██╔╝██║ ██║ ██║ ██ ██║ ██║ ██║ ██╔══╝ ██║ ██╔══╝ // ██║ ╚═╝ ██║ ╚██████╔╝ ╚█████╔╝ ╚██████╔╝ ███████╗ ███████╗ ██║ // ╚═╝ ╚═╝ ╚═════╝ ╚════╝ ╚═════╝ ╚══════╝ ╚══════╝ ╚═╝ #define MOJOELF_DECL // A macro to tag a symbol as a public API. #define MOJOELF_CALL // The calling conventions for MojoELF entry points. #define MOJOELF_MAJOR_VERSION // The current major version of MojoELF headers. #define MOJOELF_MINOR_VERSION // The current minor version of the MojoELF headers. #define MOJOELF_MICRO_VERSION // The current micro (or patchlevel) version of the MojoELF headers. void * MOJOELF_dlopen_mem(const void *buf, const long buflen, const MOJOELF_Callbacks *cb); // Dynamically load an ELF binary from memory. void * MOJOELF_dlopen_file(const char *fname, const MOJOELF_Callbacks *cb); // Dynamically load an ELF binary from a path on the filesystem. void * MOJOELF_dlsym(void *lib, const char *sym); // Lookup a symbol in an ELF binary. void MOJOELF_dlclose(void *lib); // Dispose of a previously-loaded ELF binary. const char * MOJOELF_dlerror(void); // Obtain a human-readable error message for MojoELF problems. const void * MOJOELF_getentry(void *lib); // Obtain an ELF binary's official entry point. void MOJOELF_getmmaprange(void *lib, void **addr, unsigned long *len); // Determine the full address space of a loaded ELF binary. ```