Infer.Archive (Infer v0.1.0) View Source

Archive type matchers based on the magic number

Link to this section Summary

Functions

Takes the binary file contents as arguments. Returns true if it's a 7z archive.

Takes the binary file contents as arguments. Returns true if it's a ar archive.

Takes the binary file contents as arguments. Returns true if it's a bzip archive.

Takes the binary file contents as arguments. Returns true if it's a CAB.

Takes the binary file contents as arguments. Returns true if it's a Google Chrome Extension.

Takes the binary file contents as arguments. Returns true if it's a dcm archive.

Takes the binary file contents as arguments. Returns true if it's a deb archive.

Takes the binary file contents as arguments. Returns true if it's a eot octet stream.

Takes the binary file contents as arguments. Returns true if it's a gzip archive.

Takes the binary file contents as arguments. Returns true if it's a lzip archive.

Takes the binary file contents as arguments. Returns true if it's a MSI windows installer archive.

Takes the binary file contents as arguments. Returns true if it's a Nintendo NES ROM.

Takes the binary file contents as arguments. Returns true if it's a pdf.

Takes the binary file contents as arguments. Returns true if it's a postscript.

Takes the binary file contents as arguments. Returns true if it's a rar archive.

Takes the binary file contents as arguments. Returns true if it's a RPM.

Takes the binary file contents as arguments. Returns true if it's a rtf.

Takes the binary file contents as arguments. Returns true if it's a sqlite3 database.

Takes the binary file contents as arguments. Returns true if it's a swf.

Takes the binary file contents as arguments. Returns true if it's a tar archive.

Takes the binary file contents as arguments. Returns true if it's a xz archive.

Takes the binary file contents as arguments. Returns true if it's a z archive.

Takes the binary file contents as arguments. Returns true if it's a zip archive.

Takes the binary file contents as arguments. Returns true if it's a Zstd archive.

Link to this section Functions

Specs

is_7z(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a 7z archive.

Specs

is_ar(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a ar archive.

Specs

is_bz2(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a bzip archive.

Specs

is_cab(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a CAB.

Specs

is_crx(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a Google Chrome Extension.

Specs

is_dcm(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a dcm archive.

Specs

is_deb(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a deb archive.

Specs

is_eot(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a eot octet stream.

See Infer.Book.is_epub/1.

Specs

is_gz(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a gzip archive.

Specs

is_lz(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a lzip archive.

Specs

is_msi(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a MSI windows installer archive.

Specs

is_nes(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a Nintendo NES ROM.

Specs

is_pdf(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a pdf.

Examples

iex> binary = File.read!("test/archives/sample.pdf")
iex> Infer.Archive.is_pdf(binary)
true

Specs

is_ps(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a postscript.

Specs

is_rar(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a rar archive.

Specs

is_rpm(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a RPM.

Specs

is_rtf(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a rtf.

Specs

is_sqlite(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a sqlite3 database.

Examples

iex> binary = File.read!("test/archives/sample.db")
iex> Infer.Archive.is_sqlite(binary)
true

Specs

is_swf(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a swf.

Specs

is_tar(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a tar archive.

Specs

is_xz(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a xz archive.

Specs

is_z(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a z archive.

Specs

is_zip(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a zip archive.

See: https://en.wikipedia.org/wiki/List_of_file_signatures

Examples

iex> binary = File.read!("test/archives/sample.zip")
iex> Infer.Archive.is_zip(binary)
true

Specs

is_zst(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a Zstd archive.

## Examples

iex> binary = File.read!("test/archives/sample.tar.zst")
iex> Infer.Archive.is_zst(binary)
true