(self, offset, ip=0)
| 39 | return self.getString(offset) |
| 40 | |
| 41 | def getAddr(self, offset, ip=0): |
| 42 | self.ipdb.seek(offset + 4) |
| 43 | countryAddr = "" |
| 44 | areaAddr = "" |
| 45 | str = self.ipdb.read(1) |
| 46 | (byte,) = struct.unpack('B', str) |
| 47 | if byte == 0x01: |
| 48 | countryOffset = self.getLong3() |
| 49 | self.ipdb.seek(countryOffset) |
| 50 | str = self.ipdb.read(1) |
| 51 | (b,) = struct.unpack('B', str) |
| 52 | if b == 0x02: |
| 53 | countryAddr = self.getString(self.getLong3()) |
| 54 | self.ipdb.seek(countryOffset + 4) |
| 55 | else: |
| 56 | countryAddr = self.getString(countryOffset) |
| 57 | areaAddr = self.getAreaAddr() |
| 58 | elif byte == 0x02: |
| 59 | countryAddr = self.getString(self.getLong3()) |
| 60 | areaAddr = self.getAreaAddr(offset + 8) |
| 61 | else: |
| 62 | countryAddr = self.getString(offset + 4) |
| 63 | areaAddr = self.getAreaAddr() |
| 64 | return countryAddr + " " + areaAddr |
| 65 | |
| 66 | def dump(self, first, last): |
| 67 | if last > self.indexCount: |
no test coverage detected