python
halimac
这个作者很懒,什么都没留下…
展开
-
python读取二进制文件
#读取二进制文件,并以16进制形式打印import structimport osos.chdir(r'/users/halimac/Desktop/test')myfile = open('a.out','rb')mystring = myfile.read(16)while(mystring): mystring = map(ord,mystring) for原创 2014-11-24 20:15:15 · 515 阅读 · 0 评论 -
python搜索二进制文件特定字节序
dest = [0x11,0x11,0x23,0x22]print destmyfile = open('mytest','rb')count = 0index = 0mystring = myfile.read(16)while(mystring): for x in mystring: count原创 2014-11-24 21:04:34 · 3044 阅读 · 0 评论