我正在尝试拆分此 udp 数据包,我想要特定数据包 conating “xx ff”
0000 xx ff 3a 31 89 c3 ff 00 58 00 20 41 aa aa 03 00 >.:1....X. A....
0010 02 de 01 11 05 00 02 00 00 ff 3c ff 00 00 34 2d .........K<....-
0020 00 44 00 00 00 00 00 00 0a x3 00 01 00 60 00 00 ................
0030 00 00 89 70 62 00 02 00 00 76 98 05 8b ..i.b....v...
所以:
if '0 ' in line:print line;
line = line.split('0 ')[1]
产量:
0000 xx ff 3a 31 89 c3 ff 00 58 00 20 41 aa aa 03 0 >.:1....X. A....
0010 02 de 01 11 05 00 02 00 00 ff 3c ff 00 00 34 2d .........K<....-
0020 00 44 00 00 00 00 00 00 0a x3 00 01 00 60 00 0 ................
0030 00 00 89 70 62 00 02 00 00 76 98 05 8b ..i.b....v...\
每行中缺少尾随零