Atlantiraptor Docs

parse_binary

Type: Function · Category: parsers

Parse a binary file into a data structure using a profile.

This plugin extract binary data from strings. It works by applying a profile to the binary string and generating an object from that. Profiles are a json structure describing the binary format. For example a profile might be:

[
  ["StructName", 10, [
     ["field1", 2, "unsigned int"],
     ["field2", 6, "unsigned long long"],
   ]]]
]

The profile is compiled and overlaid on top of the offset specified, then the object is emitted with its required fields.

Please refer to Binary Parsing for a background in parsing binary data for forensic purposes and for instructions on how to construct profiles like the example above.

More detailed information about profiles and their implementation can be found in the vfilter module documentation.

Argument Type Description
filename accessors.OSPath (required) Binary file to open.
accessor string The accessor to use
profile string Profile to use (see vfilter).
struct string (required) Name of the struct in the profile to instantiate.
offset int64 Start parsing from this offset
env ordereddict.Dict Additional environment variables to make available to the profile

Required permissions: FILESYSTEM_READ

Platforms: macOS, Linux, Windows

Source: vql/parsers/binary.go