Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #Regex
  2. #r"(z\(\d+-\d+\);)+(.|\n)+?(z\(\d+-\d+\);)+"
  3.  
  4. #Decrypter
  5. def ProxyListdotRoFilter(matches):
  6. EncodedIPList = []
  7. DecodedIPList = []
  8.  
  9. EncodedPortList = []
  10. DecodedPortList = []
  11.  
  12. for match in matches:
  13. filterEncodedData = re.finditer(r"(z\(\d+-\d+\);)+", match.group())
  14. filteredList = list(filterEncodedData)
  15.  
  16. EncodedIPList.append(filteredList[0])
  17. EncodedPortList.append(filteredList[1])
  18.  
  19. for encodedIP in EncodedIPList:
  20. cleanedString = encodedIP.group().replace("z(","").replace(")","").strip()
  21.  
  22. splitter = cleanedString.split(';')
  23. decodedIP = ""
  24.  
  25. for splitted in splitter:
  26. if(splitted):
  27. part = splitted.split('-')
  28. decodedIP += chr(int(part[0]) - int(part[1]))
  29.  
  30. DecodedIPList.append(decodedIP)
  31.  
  32. for encodedPort in EncodedPortList:
  33. cleanedString = encodedPort.group().replace("z(","").replace(")","").strip()
  34. splitter = cleanedString.split(';')
  35. decodedPort = ""
  36.  
  37. for splitted in splitter:
  38. if(splitted):
  39. part = splitted.split('-')
  40. decodedPort += chr(int(part[0]) - int(part[1]))
  41.  
  42. DecodedPortList.append(decodedPort)
  43.  
  44. for i in range(0, len(DecodedPortList)):
  45. Dump("{0}:{1}".format(DecodedIPList[i], DecodedPortList[i]))
  46.  
  47. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement