You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve dump command: add --stdout, refactors, more tests (#69)
Usability improvements for the case of examining a single object, easier pipe support etc.
Also extensive cleanup of the implementation, and more extensive test coverage, to put us in better position to add other improvements in upcoming PRs (hex, array hashing, JSON support etc)
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.
- 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.
The output is similar to Unity's `binary2text` tool. Each file begins with external references:
148
+
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):
Copy file name to clipboardExpand all lines: Documentation/textdumper.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,17 @@ file (AssetBundle or SerializedFile) into human-readable yaml-style text file.
5
5
6
6
## How to use
7
7
8
-
The library consists of a single class called [TextDumperTool](../TextDumper/TextDumperTool.cs). It has a method named Dump and takes five parameters:
9
-
* path (string): path of the data file.
10
-
* outputPath (string): path where the output files will be created.
11
-
* skipLargeArrays (bool): if true, the content of arrays larger than 1KB won't be dumped.
12
-
* 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.
13
-
* 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).
8
+
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.
9
+
10
+
The library is used to implement the [`UnityDataTool dump` command](command-dump.md).
14
11
15
12
## How to interpret the output files
16
13
17
14
There will be one output file per SerializedFile. Depending on the type of the input file, there can
18
15
be more than one output file (e.g. AssetBundles are archives that can contain several
19
16
SerializedFiles).
20
17
21
-
The first lines of the output file looks like this:
18
+
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):
0 commit comments