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