zeam v0.0.3 Zeam

Zeam is a module of ZEAM. ZEAM is ZACKY’s Elixir Abstract Machine, which is aimed at being BEAM compatible. Zeam now provides bytecode analyzing functions.

Link to this section Summary

Functions

This converts a binary into a list

This bundles three values away from each value of a list

This concats a list of integer in the manner of big endian

This concats a list of integer in the manner of little endian

This dumps binary files to stdard output

This dumps binary data to String

This dumps binary files to String

This dumps binary files to String

Hello world

This slices the last 2 chars

This reverses a list

This reads binary (a sequence of bytes) and generates a list of integers that each value is regarded as a 24 bits (3 bytes) in big endian

This reads binary (a sequence of bytes) and generates a list of integers that each value is regarded as a 24 bits (3 bytes) in little endian

Link to this section Functions

Link to this function bin2list(binary)
bin2list(binary()) :: list()

This converts a binary into a list.

Parameter

  • binary: is a binary to convert into a list.

Examples

iex> Zeam.bin2list(<<0, 1, 2, 3>>) [0, 1, 2, 3]

Link to this function bundle3Values(list)
bundle3Values(list()) :: list()

This bundles three values away from each value of a list.

Parameter

  • list: is a list to bundle.

Examples

iex> Zeam.bundle3Values([0, 1, 2, 3]) [[0, 1, 2], [1, 2, 3]]

Link to this function concatBigEndian(list)
concatBigEndian(list()) :: integer()

This concats a list of integer in the manner of big endian.

Parameter

  • list: is a list of integer to concat

Examples

iex> Integer.to_string(Zeam.concatBigEndian([0, 1, 2]), 16) “102”

Link to this function concatLittleEndian(list)
concatLittleEndian(list()) :: integer()

This concats a list of integer in the manner of little endian.

Parameter

  • list: is a list of integer to concat

Examples

iex> Integer.to_string(Zeam.concatLittleEndian([0, 1, 2]), 16) “20100”

Link to this function dump(path)
dump(Path.t()) :: String.t()

This dumps binary files to stdard output.

Parameter

  • path: is data or a binary file path to dump.
Link to this function dump_d(data)
dump_d(binary()) :: String.t()

This dumps binary data to String.

Parameters

  • data: is binary data to dump.

Examples

iex> Zeam.dump_d(<<0, 1, 2, 3>>) “00 01 02 03”

Link to this function dump_f(file)
dump_f(File.t()) :: String.t()

This dumps binary files to String.

Parameter

  • file: is data or a binary file path to dump.
Link to this function dump_p(path)
dump_p(Path.t()) :: String.t()

This dumps binary files to String.

Parameter

  • path: is data or a binary file path to dump.

Examples

iex> Zeam.dump_p(“./test/sample”) “41 42 43 44 45 46 47 48\n49 4A 4B 4C 4D 4E\n\n”

Hello world.

Examples

iex> Zeam.hello
"ZEAM is ZACKY's Elixir Abstract Machine, which is aimed at being BEAM compatible."
Link to this function last2(string)
last2(String.t()) :: String.t()

This slices the last 2 chars.

Parameters

  • string: is string to slice.

Examples

iex> Zeam.last2(“0123”) “23”

Link to this function reverseList(list)
reverseList(list()) :: list()

This reverses a list.

Parameter

  • list: is a list to reverse

Examples

iex> Zeam.reverseList([0, 1, 2]) [2, 1, 0]

Link to this function toAddressInBigEndian(binary)
toAddressInBigEndian(binary()) :: list()

This reads binary (a sequence of bytes) and generates a list of integers that each value is regarded as a 24 bits (3 bytes) in big endian.

Parameter

  • binary: is a binary to read

Examples

iex> Zeam.toAddressInBigEndian(<<0, 1, 2, 3>>) [258, 66051]

Link to this function toAddressInLittleEndian(binary)
toAddressInLittleEndian(binary()) :: list()

This reads binary (a sequence of bytes) and generates a list of integers that each value is regarded as a 24 bits (3 bytes) in little endian.

Parameter

  • binary: is a binary to read

Examples

iex> Zeam.toAddressInLittleEndian(<<0, 1, 2, 3>>) [131328, 197121]