- Timestamp:
- Aug 28, 2011, 9:01:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/netstumbler.py
r9601 r9602 14 14 15 15 def get_int32(size=1): 16 return unpack('<' + 'i'*size,fh.read(4*size)) 16 v = unpack('<' + 'i'*size,fh.read(4*size)) 17 return v[0] if size == 1 else v 17 18 18 19 def get_uint32(size=1): 19 return unpack('<' + 'I'*size,fh.read(4*size)) 20 v = unpack('<' + 'I'*size,fh.read(4*size)) 21 return v[0] if size == 1 else v 20 22 21 23 def get_uint64(size=1): 22 return unpack('<' + 'Q'*size,fh.read(8*size)) 24 v = unpack('<' + 'Q'*size,fh.read(8*size)) 25 return v[0] if size == 1 else v 23 26 24 27 def get_uint8(size=1): 25 return unpack('<' + 'B'*size,fh.read(1*size)) 28 v = unpack('<' + 'B'*size,fh.read(1*size)) 29 return v[0] if size == 1 else v 26 30 27 31 def get_filetime(): … … 36 40 37 41 def get_double(size=1): 38 return unpack('<' + 'd'*size,fh.read(8*size)) 42 v = unpack('<' + 'd'*size,fh.read(8*size)) 43 return v[0] if size == 1 else v 39 44 40 45 data = {} … … 42 47 data["dwSignature"] = get_char(4) 43 48 data["dwFileVerunpack"] = get_uint32() 44 ApCount = get_uint32() [0]49 ApCount = get_uint32() 45 50 data["ApCount"] = ApCount 46 51 … … 48 53 for a in range(0,ApCount): 49 54 ap = {} 50 SSIDLength = get_uint8() [0]55 SSIDLength = get_uint8() 51 56 ap["SSIDLength"] = SSIDLength 52 57 ap["SSID"] = get_char(SSIDLength) … … 61 66 ap["BestLat"] = get_double() 62 67 ap["BestLong"] = get_double() 63 DataCount = get_uint32() [0]68 DataCount = get_uint32() 64 69 ap["DataCount"] = DataCount 65 70 ap["measurement"] = [] … … 69 74 ms["Signal"] = get_int32() 70 75 ms["Noice"] = get_int32() 71 LocationSource = get_int32() [0]76 LocationSource = get_int32() 72 77 ms["Location Source"] = LocationSource 73 78 if LocationSource == 1: … … 81 86 ms["Hdop"] = get_double() 82 87 ap["measurement"].append(ms) 83 NameLength = get_uint8() [0]88 NameLength = get_uint8() 84 89 ap["NameLength"] = NameLength 85 90 ap["Name"] = get_char(NameLength) … … 93 98 ap["IPMask"] = get_uint32() 94 99 ap["ApFlags"] = get_uint32() 95 IELength = get_uint32() [0]100 IELength = get_uint32() 96 101 ap["IELength"] = IELength 97 102 ap["InformationElements"] = get_uint8(IELength)
Note:
See TracChangeset
for help on using the changeset viewer.