/* DiggBlocker, version 0.1. This is Open Source Software. Anyone can use it. For free. Just give me some credit, mmkay? ;) Copyright Cat Chapman, 2006. */ #include #include #include using namespace std; int main() { string antidigg = "\n127.0.0.1 digg.com"; char choice; cout << "What OS are you running? \n\ta: Windows XP \n\tb: Windows 2000\n\tc: Windows 98/ME" << endl; cin >> choice; if( choice == 'a' ) { ofstream file("/Windows/System32/Drivers/etc/hosts", ios::app); if (! file) { cout << "Error opening output file" << endl; return -1; } file << antidigg << endl; file.close(); } else if( choice == 'b' ) { ofstream file("/Winnt/System32/Drivers/etc/hosts", ios::app); if (! file) { cout << "Error opening output file" << endl; return -1; } file << antidigg << endl; file.close(); } else if(choice == 'c' ) { ofstream file("/Windows/hosts", ios::app); if (! file) { cout << "Error opening output file" << endl; return -1; } file << antidigg << endl; file.close(); } else cout << "Invalid choice. Please run this program again" << endl; system("pause"); return 0; cout << "Success! Digg blocked. :)" << endl; system("pause"); return 0; }