|
2 | 2 | ## Documentation
|
3 | 3 | The MachOStructure class makes it easy to describe binary chunks by using the #field method. This method generates the byte size and format strings necessary to parse a chunk of binary data. It also automatically generates the constructor and readers for all fields as well.
|
4 | 4 |
|
5 |
| -The fields are created in order so you will be expected to pass those arguements to the constructor in the same order. Fields with no arguments should be defined last and fields with default arguments should be defined right before them. |
| 5 | +The fields are created in order so you will be expected to pass those arguments to the constructor in the same order. Fields with no arguments should be defined last and fields with default arguments should be defined right before them. |
6 | 6 |
|
7 | 7 | The type and options of inherited fields can be changed but their argument position and the number of arguments (used to calculate min_args) will also not change.
|
8 | 8 |
|
9 |
| -Usually, endianness is handled by the Utils#specialize_format method but occasionally a field needs to specifiy that beforehand. That is what the :endian option is for. If not specified, a placeholder is used so that can be specified later. |
| 9 | +Usually, endianness is handled by the Utils#specialize_format method but occasionally a field needs to specify that beforehand. That is what the :endian option is for. If not specified, a placeholder is used so that can be specified later. |
10 | 10 |
|
11 | 11 | ## Syntax
|
12 | 12 | ```ruby
|
|
36 | 36 | - an unsigned 32 bit integer
|
37 | 37 | - `:uint64 `
|
38 | 38 | - an unsigned 64 bit integer
|
39 |
| -- `:view` [initalized] |
| 39 | +- `:view` [initialized] |
40 | 40 | - an instance of the MachOView class (lib/macho/view.rb)
|
41 |
| -- `:lcstr` [NOT initalized] |
| 41 | +- `:lcstr` [NOT initialized] |
42 | 42 | - an instance of the LCStr class (lib/macho/load_commands.rb)
|
43 |
| -- `:two_level_hints_table` [NOT initalized] [NO argument] |
| 43 | +- `:two_level_hints_table` [NOT initialized] [NO argument] |
44 | 44 | - an instance of the TwoLevelHintsTable class (lib/macho/load_commands.rb)
|
45 |
| -- `:tool_entries` [NOT initalized] |
| 45 | +- `:tool_entries` [NOT initialized] |
46 | 46 | - an instance of the ToolEntries class (lib/macho/load_commands.rb)
|
47 | 47 |
|
48 | 48 | ## Option Types
|
|
58 | 58 | - `:size` [Integer] size in bytes
|
59 | 59 | - `:padding` [Symbol] optionally specify `:null` padding
|
60 | 60 |
|
61 |
| -## More Infomation |
| 61 | +## More Information |
62 | 62 | Hop over to lib/macho/structure.rb to see the class itself.
|
0 commit comments