Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labatata101/grep_bin
Search a sequence of bytes in a binary file
https://github.com/labatata101/grep_bin
bgrep binary cli command-line command-line-tool grep recursively-search rust search
Last synced: about 2 months ago
JSON representation
Search a sequence of bytes in a binary file
- Host: GitHub
- URL: https://github.com/labatata101/grep_bin
- Owner: LaBatata101
- License: mit
- Created: 2021-07-29T00:33:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-02T19:39:40.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T11:57:55.637Z (2 months ago)
- Topics: bgrep, binary, cli, command-line, command-line-tool, grep, recursively-search, rust, search
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grep_bin
`grep_bin` can search recursively a directory or multiple files for a sequence of bytes or ascii string.## Usage
### Searching for a byte sequence in a file
`$ grep_bin fffe test.bin`### Searching recursively a directory for a byte sequence
`$ grep_bin FFFE ~/Downloads`### Filtering the filetypes
`$ grep_bin -f mp3 FFfe0000 ~/Downloads`### Search for an ASCII string inside the binary
`$ grep_bin '"Hello World"' test.bin`Search for an ASCII string with quotes included: `$ grep_bin '"This is a \"quote\""' test.bin`
### Search a byte sequence in multiple files
`$ grep_bin fFFe test1.bin test2.bin`### Specify the number of bytes per line in the output
`$ grep_bin -c 32 "information" README.md`Output:
README.md
00000320: 73 20 68 65 6C 70 20 69 6E 66 6F 72 6D 61 74 69 6F 6E 0A 0A 20 20 20 20 2D 56 2C 20 2D 2D 76 65 |s help information.. -V, --ve|
00000360: 73 69 6F 6E 20 69 6E 66 6F 72 6D 61 74 69 6F 6E 0A 0A 0A 4F 50 54 49 4F 4E 53 3A 0A 20 20 20 20 |sion information...OPTIONS:. |
* the characters in bold represent the colored match
### Help
```
$ grep_bin -hgrep_bin 2.0.0
LaBatata101
Searches recursively a directory or multiple files for a sequence of bytes or ASCII string.USAGE:
grep_bin [OPTIONS] ...ARGS:
Ascii strings should be passed inside quotes like so '"This is a string"'
Escaping quotes '"This is a \"quoted string\""'
All of these byte sequence are valid: f9b4ca, F9B4CA and f9B4Ca
... The filepathOPTIONS:
-c Defines the number of bytes that will be printed in each line.
[default: 16]
-f Filter the search by the file extensions.
Examples of input: jpg, mp3, exe
-h, --help Print help information
-o, --print-offset Prints only the offsets of the match.
-p, --print-only Prints only the filename that contais the match.
-s, --skip-bytes Skip n bytes before searching. [default: 0]
-V, --version Print version information
```# Building Manually
## Dependencies
- rustc(latest version)
- cargo`$ git clone https://github.com/LaBatata101/grep_bin`
`$ cd grep_bin/`
`$ cargo build --release`
The final binary will be in `target/release/`
# Installing with Cargo
`cargo install grep_bin`