Pycrate移动网络数据结构编码解码库
Pycrate是一个法语单词,用于鉴定糟糕的葡萄酒。 而这个软件库与坏酒无关,它只是一个Python库,可以轻松地操作各种数字格式。 它是libmich的辉煌继承者。
Pycrate 提供了用于运行时对各种数据结构进行编码和解码,包括CSN.1和ASN.1。 此外,它还具有3G和LTE移动核心网络。
示例用法:
$ ./tools/pycrate_showmedia.py --help
usage: pycrate_showmedia.py [-h] [-bl BL] [-wt] input
print the internal structure of the input media file,supported formats are:
BMP, GIF, JPEG, MP3, MPEG4, PNG, TIFF
positional arguments:
input input media file
optional arguments:
-h, --help show this help message and exit
-bl BL maximum length for buffer representation
-wt show also absent / transparent fields
$ ./tools/pycrate_showmedia.py ./test/res/xkcd_wireless_signal.png
### PNG ###
<sig [PNG signature] : '\x89PNG\r\n\x1a\n'>
### PNGBody ###
### PNGChunk ###
<len : 13>
<type : 'IHDR'>
### IHDR ###
<width : 238>
<height : 415>
<depth [bit depth] : 8>
<color [color type] : 0 (Greyscale)>
<comp [compression method] : 0 (inflate/deflate with sliding window)>
<filter [filter method] : 0 (no interlace)>
<interlace [interlace method] : 0 (no interlace)>
<crc : 0x7d8cb12e>
### PNGChunk ###
<len : 9>
<type : 'pHYs'>
<data :
00 00 0c 4e 00 00 0c 4e 01 | '\x00\x00\x0cN\x00\x00\x0cN\x01'>
<crc : 0x7f778c23>
### PNGChunk ###
<len : 792>
<type : 'iCCP'>
<data :
50 68 6f 74 6f 73 68 6f 70 20 49 43 43 20 70 72 | 'Photoshop ICC pr'
6f 66 69 6c 65 00 00 78 da 63 60 60 9e e0 e8 e2 | 'ofile\x00\x00x\xdac``\x9e\xe0\xe8\xe2'
[...]
32 fd fc ea eb 82 ef e1 3f 05 7e 9d fa d3 fa cf | '2\xfd\xfc\xea\xeb\x82\xef\xe1?\x05~\x9d\xfa\xd3\xfa\xcf'
f1 ff 7f 00 0d 00 0f 34 | '\xf1\xff\x7f\x00\r\x00\x0f4'>
<crc : 0xfa96f15d>
### PNGChunk ###
<len : 32>
<type : 'cHRM'>
<data :
00 00 6e 27 00 00 73 af 00 00 df f2 00 00 83 30 | "\x00\x00n'\x00\x00s\xaf\x00\x00\xdf\xf2\x00\x00\x830"
00 00 77 43 00 00 c8 0a 00 00 34 95 00 00 2e dc | '\x00\x00wC\x00\x00\xc8\n\x00\x004\x95\x00\x00.\xdc'>
<crc : 0x20bf171a>
### PNGChunk ###
<len : 21130>
<type : 'IDAT'>
<data :
78 da ed bd 79 50 8d fd 1f ff ff bc ce 39 73 4e | 'x\xda\xed\xbdyP\x8d\xfd\x1f\xff\xff\xbc\xce9sN'
db b4 37 95 32 b4 19 94 06 2d 7e 11 26 b2 fc 10 | '\xdb\xb47\x952\xb4\x19\x94\x06-~\x11&\xb2\xfc\x10'
[...]
91 a3 d8 5b fc e1 cb 51 fd ab fb c9 cc ec ee 21 | '\x91\xa3\xd8[\xfc\xe1\xcbQ\xfd\xab\xfb\xc9\xcc\xec\xee!'
7d 70 6e f3 18 ce c1 c1 6d 8c 81 44 32 cf 51 ba | '}pn\xf3\x18\xce\xc1\xc1m\x8c\x81D2\xcfQ\xba'
...>
<crc : 0xa9fbdd38>
### PNGChunk ###
<len : 0>
<type : 'IEND'>
<data : >
<crc : 0xae426082>评论
