-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support raw output #219
Comments
That sounds like an interesting idea! I think it would be a nice feature to have, if it can be cleanly integrated into the code base. We should maybe also research what other tools do (hexdump, xxd). I think they provide options to turn their output back into binary? which might be even more powerful. Because you can build pipelines and integrate other tools as well. |
So I did a bit more digging on how other tools do it. With xxd, it supports it by the
Basically the expectation is that you feed the output of a previous xxd input | xxd -r
xxd -b input | xxd -br Hexdump on the other hand has a very powerful output formatting syntax. It provides a way to split output into groups of bytes, and consume/format some number of groups. This is how you'd output the raw binary: hexdump input -ve '1/1 "%c"' # Number of groups / Number of bytes
hexdump input -ve '"%c"' # 1/1 elided Hexdump output formatting is powerful (see some examples in a Suse blog post), though it seems like it'd be more practical to write a python script than a hexdump format file these days for most uses. I think having a |
Not sure if this makes sense for Hexyl to support, but because it already has -s and -c, it'd be really nice to be able to output raw binary data to trim down a large binary to a small one quickly; after locating the portion wanted. If there's interest in a
--raw
flag, I'd be happy to implement it.The text was updated successfully, but these errors were encountered: