Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r12f/bondinspector
A simple tool to check the binary data that Bond serializes
https://github.com/r12f/bondinspector
Last synced: 7 days ago
JSON representation
A simple tool to check the binary data that Bond serializes
- Host: GitHub
- URL: https://github.com/r12f/bondinspector
- Owner: r12f
- Created: 2023-09-13T15:30:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-13T15:39:41.000Z (about 1 year ago)
- Last Synced: 2023-09-14T05:58:36.815Z (about 1 year ago)
- Language: C#
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BondInspector
This is a very simple tool to inspect the content of [Bond](https://github.com/microsoft/bond) binary data. It is useful when you get a binary bond data, but some failing to parsing it and would like to see what is inside of it.
It is currently supporting only the tagged protocol - [Compact Binary](http://microsoft.github.io/bond/manual/bond_cs.html#compact-binary) and [Fast Binary](http://microsoft.github.io/bond/manual/bond_cs.html#fast-binary), because there is no generic way to inspect the untagged protocol.
## Usage
To check the binary data, simply run the tool with the binary file as the argument. And by default, we will use the Compact Binary protocol to parse the data.
```bash
BondInspector.exe compact-binary.bin
```If you want to use the Fast Binary protocol, you can specify the protocol with the `-f Fast` option.
```bash
BondInspector.exe fast-binary.bin -f Fast
```Also we can pipe the binary data into the inspector.
```bash
cat compact-binary.bin | BondInspector.exe
```Then we will get the output like this:
```bash
> BondInspector.exe "binary.bin"
0: Struct
0: BT_UINT32 - 105
1: BT_WSTRING - abc
2: BT_WSTRING - test-data
3: BT_LIST - 15 items
0: Struct
0: Struct
0: BT_UINT16 - 123
1: BT_UINT16 - 456
1: Struct
0: BT_INT32 - 1
1: BT_UINT16 - 2
2: BT_UINT16 - 3
1: Struct
0: Struct
0: BT_UINT16 - 456
1: BT_UINT16 - 789
1: Struct
0: BT_INT32 - 4
1: BT_UINT16 - 5
2: BT_UINT16 - 6
...
```## Build
To build the project, we need to install the [.NET Core SDK](https://dotnet.microsoft.com/download) first. Then run the following command to build the project.
```bash
cd BondInspector
dotnet build
```## Known issues
In powershell, pipe data into the inspector will not work, because powershell pipe will corrupt the binary data. Please see this issue: .