rfmonk

struct_unpack.py

Jan 13th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import struct
  5. import binascii
  6.  
  7. packed_data = binascii.unhexlify('0100000061620000cdcc2c40')
  8.  
  9. s = struct.Struct('I 2s f')
  10. unpacked_data = s.unpack(packed_data)
  11. print 'Unpacked Values:', unpacked_data
Advertisement
Add Comment
Please, Sign In to add comment