Advertisement
Guest User

Plugin Haarp Sunat

a guest
Nov 25th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <vector>
  4. #include "../utils.cpp"
  5.  
  6. // use this line to compile
  7. // g++ -I. -fPIC -shared -g -o sunat.gob.pe.so sunat.gob.pe.cpp
  8. // regex
  9. // http.*\.sunat\.gob\.pe.*(\.gif|\.jpg|\.png|\.exe|\.rar|\.zip|\.swf)
  10.  
  11. string get_filename(string url) {
  12. vector<string> resultado;
  13. if (url.find("?") != string::npos) {
  14. stringexplode(url, "?", &resultado);
  15. stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
  16. return resultado.at(resultado.size()-1);
  17. } else {
  18. stringexplode(url, "/", &resultado);
  19. return resultado.at(resultado.size()-1);
  20. }
  21. }
  22.  
  23. extern &quot;C&quot; resposta hgetmatch2(const string url) {
  24. resposta r;
  25. r.range_min = 0;
  26. r.range_max = 0;
  27.  
  28. if ( (url.find(".sunat.gob.pe") != string::npos)
  29. ) {
  30.  
  31. r.file = get_filename(url);
  32. if (!r.file.empty()) {
  33. r.match = true;
  34. r.domain = "Sunat";
  35. } else {
  36. r.match = false;
  37. }
  38. } else {
  39. r.match = false;
  40. }
  41. return r;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement