Changes between Version 9 and Version 10 of StructuredBinaryData
- Timestamp:
- 2012-06-22T05:40:30Z (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StructuredBinaryData
v9 v10 43 43 44 44 The initial goals for the project are an interactive browser for filesystem 45 structures a nda debugger backend that can interpret core dumps and task45 structures as well as a debugger backend that can interpret core dumps and task 46 46 memory. 47 47 … … 63 63 64 64 Bithenge represents all data in the form of a data structure called a “tree,” 65 similar to the data structure used by JSON. A tree consists of a boolean node,66 integer node, string node, or blob node, or an internal node with children. A 67 boolean node holds a boolean value, an integer node holds a signed integer, and68 a string holds a Unicode string.65 similar to the data structure represented by JSON. A tree consists of a boolean 66 node, integer node, string node, or blob node, or an internal node with 67 children. A boolean node holds a boolean value, an integer node holds a signed 68 integer, and a string holds a Unicode string. 69 69 70 70 A blob node represents an arbitrary sequence of raw bytes. Blob nodes are 71 71 polymorphic, allowing any source of raw binary data to be used. Bithenge 72 72 includes blob node implementations for in‐memory buffers, files, and block 73 devices. An implementation has been written that reads another task’s virtual74 memory, but it hasn’t been committed because it’s unclear whether it will be 75 useful.76 77 An internal node has an arbitrary number of children, each associated with a78 unique key. The key can be any node other than an internal node. An array can 79 b e represented by an internal node with integer keys starting at 0. The tree80 node can provide children in an arbitrary order; the order will be used when 81 displaying the tree, but should have no semantic significance. Internal nodes 82 a re polymorphic and can delay creation of child nodes until necessary, so83 keeping the wholetree in memory can be avoided.73 devices. An implementation has also been written that reads another task’s 74 virtual memory, but it hasn’t been committed because it’s unclear whether it 75 will be useful in its current form. 76 77 An internal node has an arbitrary number of children, each with a unique key. 78 The key can be any node other than an internal node. Arrays can be represented 79 by internal nodes with integer keys starting at 0. The tree node can provide 80 children in an arbitrary order; the order will be used when displaying the 81 tree, but should have no semantic significance. Internal nodes are polymorphic 82 and can delay creation of child nodes until necessary, so keeping the whole 83 tree in memory can be avoided. 84 84 85 85 Internal nodes are currently responsible for freeing their own children. In the … … 89 89 90 90 Note that all interpreted data is represented in Bithenge with nodes. 91 Therefore, the word “blob” usually refers to a blob node, &c. 92 91 Therefore, the word “blob” usually refers to a blob node, and so on. 92 93 A decoded tree for a FAT filesystem might look something like this: 93 94 {{{ 94 95 95 ○───bits─▶16 96 96 │ … … 110 110 }}} 111 111 112 == Programs ==113 114 The only program currently available is a simple test that prints some trees as115 JSON and Python literals.116 117 112 == Transforms == 118 113 … … 133 128 == Built‐in transforms == 134 129 135 These transforms are implemented in C and included with Bithenge. Note that136 fully specific names are preferred; scripts can definealiases if necessary.130 These transforms will be implemented in C and included with Bithenge. Note that 131 precise names are preferred; scripts can define shorter aliases if necessary. 137 132 138 133 ||= name =||= input =||= output =||= description =||= example =|| … … 144 139 == Basic syntax == 145 140 146 Script files used to define newtransforms.141 Script files are used to define complicated transforms. 147 142 148 143 Transforms (including built‐in transforms) can be referenced by name: … … 166 161 combines the results to create an internal node. The result of each 167 162 subtransform is either assigned a key or has its keys and values merged into 168 the final internal node. Each subtransform must support `prefix_length`, so the169 lengthsand positions of the data fields can be determined.163 the final tree. Each subtransform must support `prefix_length`, so the lengths 164 and positions of the data fields can be determined. 170 165 171 166 === Example ===