Giter VIP home page Giter VIP logo

a2b's Introduction

a2b

a hex string to binary converter in perl and python.

usage

a2b [-hd|-tcpdump|-gdb|-h]

for example,

% echo "74 65 73 74 0A" | ./a2b
test

string format

any combination of 1-byte hex string. the following delimiters are acceptable.

. (priod)
, (comma)
- (hyphen)
: (colon)

e.g. the followings are going to be all same output.

74 65 73 74 0A
746573740A
7465 7374 0A
74.65.73.74.0A
74:65:73:74:0A
74-65-73-74-0A
0x7465,0x7374,0x0A
0x74-0x65-0x73-0x74-0x0A

hexdump output

the -hd option specify the input is the output of hexdump(1) like below:

% hexdump -C test.txt
00000000  30 30 30 31 30 32 30 33  30 34 30 35 30 36 30 37  |0001020304050607|
00000010  30 38 30 39 30 61 30 62  30 63 30 64 30 65 30 66  |08090a0b0c0d0e0f|
00000020  31 30 31 31 31 32 31 33  31 34 31 35 31 36 31 37  |1011121314151617|
00000030  31 38 31 39 31 61 31 62  31 63 31 64 31 65 31 66  |18191a1b1c1d1e1f|
00000040  32 30 32 31 32 32 32 33  32 34 32 35 32 36 32 37  |2021222324252627|

tcpdump output

the -hd option specify the input is the output of tcpdump(1) like below:

% tcpdump -nqxi lo0
07:12:38.197522 IP 127.0.0.1.56622 > 127.0.0.1.2056: UDP, length 8
        0x0000:  4500 0024 87d3 0000 4011 0000 7f00 0001
        0x0010:  7f00 0001 dd2e 0808 0010 fe23 0800 0102
        0x0020:  b201 0000

the following format is treated in the default parser.

% tcpdump -sx 1500 -nqti lnc0
92.168.246.128.4158 > 203.178.141.195.110: tcp 0 (DF)
                        4500 003c 7474 4000 4006 b5a8 c0a8 f680
                        cbb2 8dc3 103e 006e e8c8 6f7c 0000 0000
                        a002 e000 5204 0000 0204 05b4 0103 0300
                        0101 080a 05ee 9984 0000 0000

dgb output

the -gdb option specify the input is the output of the command x of gdb(1) like below:

(gdb) x/128b &ac
0xbfbff328:     0x01    0x00    0x00    0x00    0x70    0xf3    0xbf    0xbf
0xbfbff330:     0x78    0xf3    0xbf    0xbf    0x68    0xf3    0xbf    0xbf
0xbfbff338:     0x82    0xa7    0x04    0x08    0xd3    0xb3    0x04    0x08
0xbfbff340:     0x2c    0x3f    0x08    0x08    0x00    0x00    0x00    0x00
0xbfbff348:     0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
0xbfbff350:     0x64    0xf3    0xbf    0xbf    0x00    0x00    0x00    0x00

a2b's People

Contributors

tanupoo avatar

Watchers

 avatar James Cloos 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.