-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish basic structure, but needs more improvement
- Loading branch information
0 parents
commit f451566
Showing
8 changed files
with
2,470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Project-specific generated files | ||
docs/build/ | ||
|
||
bench/results/ | ||
bench/env/ | ||
bench/trio/ | ||
|
||
# Byte-compiled / optimized / DLL files / editor temp files | ||
__pycache__/ | ||
*.py[cod] | ||
*~ | ||
\#* | ||
.#* | ||
*.swp | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
/build/ | ||
/develop-eggs/ | ||
/dist/ | ||
/eggs/ | ||
/lib/ | ||
/lib64/ | ||
/parts/ | ||
/sdist/ | ||
/var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
/.pybuild | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.venv/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.pytest_cache/ | ||
.mypy_cache/ | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# Rope | ||
.ropeproject | ||
|
||
# Django stuff: | ||
*.log | ||
*.pot | ||
|
||
# Sphinx documentation | ||
doc/_build/ | ||
|
||
# vscode config file | ||
.vscode/* |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Nu plugin binary reader | ||
A general binary parser based on [kaitai struct](https://formats.kaitai.io/). | ||
|
||
## Require python version | ||
python3.7+ | ||
|
||
## Usage | ||
1. register the plugin to nushell | ||
``` | ||
register -e json plugin.py | ||
``` | ||
|
||
It will introduce a new command: `from-binary`. So you can just play with it. | ||
|
||
## Usage example | ||
1. read and parse png file: | ||
``` | ||
open capture.PNG | from-binary png | get ihdr | ||
``` | ||
|
||
2. read and parse ttf file: | ||
``` | ||
open FiraCode-VF.ttf | from-binary ttf | get directory_table | ||
``` | ||
|
||
## Note | ||
The `kaitaistruct.py` is just a copy of [kaitai struct python runtime](https://github.com/kaitai-io/kaitai_struct_python_runtime), put it directly here, so we don't need extra requirements. | ||
And `reader/*.py` are just a copy of auto-generated parser, DON'T CHANGE IT. |
Oops, something went wrong.