LibPE (LibPE v1.2.3) View Source

Implementation of the Windows PE executable format for reading and writing PE binaries.

Most struct member names are taken directly from the windows documentation: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format

This library has been created specifically to archieve the following:

Link to this section Summary

Link to this section Functions

Specs

encode(%LibPE{
  coff_flags: term(),
  coff_header: term(),
  coff_sections: term(),
  format: term(),
  machine: term(),
  meta: term(),
  meta2: term(),
  msdos_stub: term(),
  object_entry_count: term(),
  object_offset: term(),
  rest: term(),
  timestamp: term()
}) :: binary()

Specs

parse_file(binary()) ::
  {:ok,
   %LibPE{
     coff_flags: term(),
     coff_header: term(),
     coff_sections: term(),
     format: term(),
     machine: term(),
     meta: term(),
     meta2: term(),
     msdos_stub: term(),
     object_entry_count: term(),
     object_offset: term(),
     rest: term(),
     timestamp: term()
   }}
Link to this function

parse_string(full_image)

View Source

Specs

parse_string(binary()) ::
  {:ok,
   %LibPE{
     coff_flags: term(),
     coff_header: term(),
     coff_sections: term(),
     format: term(),
     machine: term(),
     meta: term(),
     meta2: term(),
     msdos_stub: term(),
     object_entry_count: term(),
     object_offset: term(),
     rest: term(),
     timestamp: term()
   }}
Link to this function

set_resource(pe, resource_type, data, codepage \\ 0, language \\ 1033)

View Source
Link to this function

set_resources(pe, resources)

View Source

Update the PE image checksum of a PE file.

Update the section & certificate layout after a section size has been changed