Giter VIP home page Giter VIP logo

bitv's Introduction

bitv - A viewer for hexadecimal data

Convert hex input to a binary output in command line

Options:

  • {-v} : print vertical[default horizontal]
  • {-h} : this help
  • {-r} : inverted order [default is incremental]
  • {-s [8|16|32|64]} : input and display is 8, 16, 32 or 64 bits wide[default is 32bits]
  • {-B} : short hand for input/output as 8 bits
  • {-S} : short hand for input/output as 16 bits
  • {-W} : short hand for input/output as 32 bits
  • {-L} : short hand for input/output as 64 bits
  • {-i [val]} : input value - if provided, will exit, else will repeat for multiple entries

Defaults to interactive mode, where you provide inputs unless -i is provided.

Some examples:

  • Interactive mode

without providing a -i data, the application continues in a while loop waiting for user input. Ctrl+c breaks the loop.

bitv -S
Enter Data(CTRL+C will quit)-size 16 bits: 0xdead
-----------------------------------------------------------------
| 15| 14| 13| 12| 11| 10| 09| 08| 07| 06| 05| 04| 03| 02| 01| 00|
-----------------------------------------------------------------
| 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
-----------------------------------------------------------------
|            0xd|            0xe|            0xa|            0xd|
-----------------------------------------------------------------
Enter Data(CTRL+C will quit)-size 16 bits: 0xcafe
-----------------------------------------------------------------
| 15| 14| 13| 12| 11| 10| 09| 08| 07| 06| 05| 04| 03| 02| 01| 00|
-----------------------------------------------------------------
| 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
-----------------------------------------------------------------
|            0xc|            0xa|            0xf|            0xe|
-----------------------------------------------------------------
Enter Data(CTRL+C will quit)-size 16 bits: 0xbeef
-----------------------------------------------------------------
| 15| 14| 13| 12| 11| 10| 09| 08| 07| 06| 05| 04| 03| 02| 01| 00|
-----------------------------------------------------------------
| 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
-----------------------------------------------------------------
|            0xb|            0xe|            0xe|            0xf|
-----------------------------------------------------------------
Enter Data(CTRL+C will quit)-size 16 bits:

  • bitv -i 0xa5
---------------------------------------------------------------------------------------------------------------------------------
| 31| 30| 29| 28| 27| 26| 25| 24| 23| 22| 21| 20| 19| 18| 17| 16| 15| 14| 13| 12| 11| 10| 09| 08| 07| 06| 05| 04| 03| 02| 01| 00|
---------------------------------------------------------------------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
---------------------------------------------------------------------------------------------------------------------------------
|            0x0|            0x0|            0x0|            0x0|            0x0|            0x0|            0xa|            0x5|
---------------------------------------------------------------------------------------------------------------------------------

  • bitv -B -r -i 0xa5
---------------------------------
| 00| 01| 02| 03| 04| 05| 06| 07|
---------------------------------
| 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
---------------------------------
|            0x5|            0xa|
---------------------------------
  • bitv -B -v -i 0xa5
[07] - 1
[06] - 0
[05] - 1
[04] - 0
-- 0xa --
[03] - 0
[02] - 1
[01] - 0
[00] - 1
-- 0x5 --
  • bitv -B -r -v -i 0xa5
[00] - 1
[01] - 0
[02] - 1
[03] - 0
-- 0x5 --
[04] - 0
[05] - 1
[06] - 0
[07] - 1
-- 0xa --
  • bitv -s 64 -i 0x0123456789ABCDEF
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 63| 62| 61| 60| 59| 58| 57| 56| 55| 54| 53| 52| 51| 50| 49| 48| 47| 46| 45| 44| 43| 42| 41| 40| 39| 38| 37| 36| 35| 34| 33| 32| 31| 30| 29| 28| 27| 26| 25| 24| 23| 22| 21| 20| 19| 18| 17| 16| 15| 14| 13| 12| 11| 10| 09| 08| 07| 06| 05| 04| 03| 02| 01| 00|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|            0x0|            0x1|            0x2|            0x3|            0x4|            0x5|            0x6|            0x7|            0x8|            0x9|            0xa|            0xb|            0xc|            0xd|            0xe|            0xf|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Building

This is a simple file.. anyways.. make and make clean are supported.. you just need a compiler like gcc or something.

make

Cross Comiling

Just override CC with your compiler of choice.

make CC=aarch64-linux-gnu-gcc

bitv's People

Contributors

nmenon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.