iff.c

Include dependency graph for iff.c:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="stdbool.h" tooltip="stdbool.h"]
    "5" [label="utils.h" tooltip="utils.h"]
    "4" [label="stdint.h" tooltip="stdint.h"]
    "8" [label="stdlib.h" tooltip="stdlib.h"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/iff.c" fillcolor="#BFBFBF"]
    "2" [label="iff.h" tooltip="iff.h"]
    "6" [label="stddef.h" tooltip="stddef.h"]
    "9" [label="string.h" tooltip="string.h"]
    "7" [label="stdio.h" tooltip="stdio.h"]
    "5" -> "6" [dir=forward tooltip="include"]
    "5" -> "7" [dir=forward tooltip="include"]
    "5" -> "8" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "5" [dir=forward tooltip="include"]
    "1" -> "7" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
    "1" -> "9" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "4" [dir=forward tooltip="include"]
}

Functions

static uint32_t iff_align(uint32_t size)
bool iff_is_valid_beam(const void *beam_data)

Returns true if pointed binary is valid BEAM IFF.

Checks if the pointed binary has a valid BEAM IFF header.

Parameters:
  • beam_data – a pointer to the beam_data binary

Returns:

true if beam_data points to a valid binary, otherwise false is returned.

void scan_iff(const void *iff_binary, int buf_size, unsigned long *offsets, unsigned long *sizes)

parse a BEAM/IFF file and build a sections offsets table

Read a buffer containing a BEAM module file and set all found IFF sections into offsets array.

Parameters:
  • iff_binary – is BEAM module data.

  • file_size – is the BEAM module size in bytes.

  • offsets – all the relative offsets, each entry will be set to the offset of a different IFF section.

  • sizes – the computed sections sizes.

struct IFFRecord

Public Members

const char name[4]
uint32_t size