libexe(3)

πŸ“¦ in opensuse-leap 16.0

πŸ’… libexe(3) β€” the EXE library page, but make it cute πŸ’…

Hey bestie! This is the libexe(3) page from the Library Functions Manual (section 3, if you're keeping track). It's all about libexe.h, the library for accessing the executable (EXE) format. Grab a strawberry πŸ“ and let's go.


✨ NAME ✨

libexe.h β€” Library to access the executable (EXE) format.

That's the name. That's the vibe. πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

First, the include, because obviously:

#include <libexe.h>

πŸ’– Support functions

const char *
libexe_get_version(void);

int
libexe_get_access_flags_read(void);

int
libexe_get_codepage(int *codepage, libexe_error_t **error);

int
libexe_set_codepage(int codepage, libexe_error_t **error);

int
libexe_check_file_signature(const char *filename,
    libexe_error_t **error);

Available when compiled with wide character string support:

int
libexe_check_file_signature_wide(const wchar_t *filename,
    libexe_error_t **error);

Available when compiled with libbfio support:

int
libexe_check_file_signature_file_io_handle(libbfio_handle_t *file_io_handle,
    libexe_error_t **error);

πŸŽ€ Notify functions

void
libexe_notify_set_verbose(int verbose);

int
libexe_notify_set_stream(FILE *stream, libexe_error_t **error);

int
libexe_notify_stream_open(const char *filename, libexe_error_t **error);

int
libexe_notify_stream_close(libexe_error_t **error);

😭 Error functions

void
libexe_error_free(libexe_error_t **error);

int
libexe_error_fprint(libexe_error_t *error, FILE *stream);

int
libexe_error_sprint(libexe_error_t *error, char *string, size_t size);

int
libexe_error_backtrace_fprint(libexe_error_t *error, FILE *stream);

int
libexe_error_backtrace_sprint(libexe_error_t *error, char *string,
    size_t size);

🫢 File functions

int
libexe_file_initialize(libexe_file_t **file, libexe_error_t **error);

int
libexe_file_free(libexe_file_t **file, libexe_error_t **error);

int
libexe_file_signal_abort(libexe_file_t *file, libexe_error_t **error);

int
libexe_file_open(libexe_file_t *file, const char *filename,
    int access_flags, libexe_error_t **error);

int
libexe_file_close(libexe_file_t *file, libexe_error_t **error);

int
libexe_file_get_ascii_codepage(libexe_file_t *file, int *ascii_codepage,
    libexe_error_t **error);

int
libexe_file_set_ascii_codepage(libexe_file_t *file, int ascii_codepage,
    libexe_error_t **error);

int
libexe_file_get_number_of_sections(libexe_file_t *file,
    int *number_of_sections, libexe_error_t **error);

int
libexe_file_get_section_by_index(libexe_file_t *file, int section_index,
    libexe_section_t **section, libexe_error_t **error);

int
libexe_file_get_section_by_name(libexe_file_t *file, const char *string,
    size_t string_length, libexe_section_t **section,
    libexe_error_t **error);

Available when compiled with wide character string support:

int
libexe_file_open_wide(libexe_file_t *file, const wchar_t *filename,
    int access_flags, libexe_error_t **error);

Available when compiled with libbfio support:

int
libexe_file_open_file_io_handle(libexe_file_t *file,
    libbfio_handle_t *file_io_handle, int access_flags,
    libexe_error_t **error);

🌸 Section functions

int
libexe_section_free(libexe_section_t **section, libexe_error_t **error);

int
libexe_section_get_name_size(libexe_section_t *section,
    size_t *string_size, libexe_error_t **error);

int
libexe_section_get_name(libexe_section_t *section, char *string,
    size_t string_size, libexe_error_t **error);

int
libexe_section_get_utf8_name_size(libexe_section_t *section,
    size_t *utf8_string_size, libexe_error_t **error);

int
libexe_section_get_utf8_name(libexe_section_t *section,
    uint8_t *utf8_string, size_t utf8_string_size,
    libexe_error_t **error);

int
libexe_section_get_utf16_name_size(libexe_section_t *section,
    size_t *utf16_string_size, libexe_error_t **error);

int
libexe_section_get_utf16_name(libexe_section_t *section,
    uint16_t *utf16_string, size_t utf16_string_size,
    libexe_error_t **error);

ssize_t
libexe_section_read_buffer(libexe_section_t *section, void *buffer,
    size_t buffer_size, libexe_error_t **error);

ssize_t
libexe_section_read_buffer_at_offset(libexe_section_t *section,
    void *buffer, size_t buffer_size, off64_t offset,
    libexe_error_t **error);

off64_t
libexe_section_seek_offset(libexe_section_t *section, off64_t offset,
    int whence, libexe_error_t **error);

int
libexe_section_get_offset(libexe_section_t *section, off64_t *offset,
    libexe_error_t **error);

int
libexe_section_get_size(libexe_section_t *section, size64_t *size,
    libexe_error_t **error);

int
libexe_section_get_start_offset(libexe_section_t *section,
    off64_t *start_offset, libexe_error_t **error);

int
libexe_section_get_virtual_address(libexe_section_t *section,
    uint32_t *virtual_address, libexe_error_t **error);

Available when compiled with libbfio support:

int
libexe_section_get_data_file_io_handle(libexe_section_t *section,
    libbfio_handle_t **file_io_handle, libexe_error_t **error);

πŸ’œ DESCRIPTION πŸ’œ

libexe_get_version() is used to retrieve the library version. That's it β€” that's the function. It's giving "short and iconic" and we respect it. πŸ’…

πŸ”₯ RETURN VALUES πŸ”₯

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values, see "libexe.h". No cap, that's where the real tea is. 🍡

🌈 ENVIRONMENT 🌈

None.

🧚 FILES 🧚

None.

πŸ‘‘ NOTES πŸ‘‘

  • libexe can be compiled with wide character support (wchar_t).
  • To compile libexe with wide character support use:
./configure --enable-wide-character-type=yes

or define _UNICODE or UNICODE during compilation.

  • LIBEXE_WIDE_CHARACTER_TYPE in libexe/features.h can be used to determine if libexe was compiled with wide character support.

That's the whole notes section, bestie. Short, sweet, and very wchar_t coded. 🫢

πŸ’€ BUGS πŸ’€

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libexe/issues

πŸŽ€ AUTHOR πŸŽ€

These man pages are generated from "libexe.h".

Copyright (C) 2011-2021, Joachim Metz <joachim.metz@gmail.com>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

🌟 SEE ALSO 🌟

the libexe.h include file


xoxo, libexe β€” April 14, 2019 β€” libexe(3) πŸ’–

πŸ“¦ where this page comes from