Advertisement

将LTE-NB NAS消息转换为Wireshark文件格式进行解析

阅读量:

主要完成十六进制字符形式的NAS消息数据,借助Python脚本将其转换为Wireshark可识别的pcap文件格式。在使用Wireshark打开生成的文件后,即可获取对应的信元配置信息。

原始数据

转换脚本

复制代码
 class ConvertEngine(object):

    
     ''''''
    
     def __init__(self):
    
     self.outfile = open("nas.pcap",'wb')
    
     #general global header
    
     b = 0xa1b2c3d4
    
     covertValue = struct.pack("L",b)
    
     self.outfile.write(covertValue)
    
     
    
     b = 0x00040002
    
     covertValue = struct.pack("L",b)
    
     self.outfile.write(covertValue)

全部评论 (0)

还没有任何评论哟~