Skip to content
23 changes: 22 additions & 1 deletion Documentation/command-dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ UnityDataTool dump <path> [options]
|--------|-------------|---------|
| `<path>` | Path to file to dump | *(required)* |
| `-o, --output-path <path>` | Output folder | Current folder |
| `--stdout` | Write the dump to stdout (status and errors go to stderr). Mutually exclusive with `-o`. | `false` |
| `-f, --output-format <format>` | Output format | `text` |
| `-s, --skip-large-arrays` | Skip dumping large arrays | `false` |
| `-i, --objectid <id>` | Only dump object with this ID | All objects |
Expand Down Expand Up @@ -55,6 +56,26 @@ Dump the AssetBundle manifest object:
UnityDataTool dump mybundle -t AssetBundle
```

Write the dump to stdout and pipe it through another tool:
```bash
UnityDataTool dump /path/to/file --stdout | grep "ClassID: 114"
```

---

## Writing to stdout

Use `--stdout` to send the dump to standard output instead of writing a `.txt` file. Status messages (the `Processing ...` line, errors, and stack traces) are routed to stderr so the dump on stdout is clean for piping or redirecting.

```bash
UnityDataTool dump /path/to/file --stdout > my-dump.txt
```

Restrictions:

- `--stdout` and `-o` are mutually exclusive.
- For Unity archives that contain more than one SerializedFile, `--stdout` is refused — there is no unambiguous way to deliver multiple files on a single stream. Pass an individual SerializedFile, or omit `--stdout` to get one `.txt` per SerializedFile in the output folder.
Comment thread
SkowronskiAndrew marked this conversation as resolved.

---

## Filtering by Type
Expand Down Expand Up @@ -124,7 +145,7 @@ UnityDataTool dump /path/to/file.bundle --typetree-data /path/to/typetree.bin

## Output Format

The output is similar to Unity's `binary2text` tool. Each file begins with external references:
The output is similar to Unity's `binary2text` tool. Unfiltered dumps begin with external references (when filtering with `-i` or `-t` this section is omitted — use the [`serialized-file externalrefs`](#) command if you want them separately):

```
External References
Expand Down
11 changes: 4 additions & 7 deletions Documentation/textdumper.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ file (AssetBundle or SerializedFile) into human-readable yaml-style text file.

## How to use

The library consists of a single class called [TextDumperTool](../TextDumper/TextDumperTool.cs). It has a method named Dump and takes five parameters:
* path (string): path of the data file.
* outputPath (string): path where the output files will be created.
* skipLargeArrays (bool): if true, the content of arrays larger than 1KB won't be dumped.
* objectId (long, optional): if specified and not 0, only the object with this signed 64-bit id will be dumped. If 0 (default), all objects are dumped.
* typeFilter (string, optional): if specified, only objects matching this type are dumped. Accepts a numeric ClassID (e.g. 114) or a type name (e.g. MonoBehaviour, case-insensitive).
The library consists of a single class called [TextDumperTool](../TextDumper/TextDumperTool.cs). Call its `Dump` method, passing a `TextDumperTool.DumpOptions` object that specify the path of the file to dump and various flags and options.

The library is used to implement the [`UnityDataTool dump` command](command-dump.md).

## How to interpret the output files

There will be one output file per SerializedFile. Depending on the type of the input file, there can
be more than one output file (e.g. AssetBundles are archives that can contain several
SerializedFiles).

The first lines of the output file looks like this:
For an unfiltered dump, the first lines of the output file look like this (when `ObjectId` or `TypeFilter` are set the External References section is omitted, and the output starts directly with the matching object entries):

External References
path(1): "Library/unity default resources" GUID: 0000000000000000e000000000000000 Type: 0
Expand Down
Loading
Loading