Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 3rd, 2004, 11:34 AM   #1
FoZ
Newbie
 
Join Date: Oct 2004
Posts: 20
Rep Power: 0 FoZ is on a distinguished road
#include <windows.h>
#include <iostream>
using namespace std;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
  SetConsoleTitle("FoZ's IE Modder Version 1");
  int msgbx;
  msgbx=MessageBox(NULL,"I accept no responsibility for any damage that this program\n"
         "causes. There is only a very small chance of anything wrong\n"
         "happening but nothing that would seriously damage your system.\n\n"
         "Click Yes to continue and use the program.\n"
         "Click No to quit the program",
         "Warning!",
         MB_YESNO|MB_ICONWARNING);
  if (msgbx==IDYES) {
  cout << "This program changes the text on the bar after the website title eg;" << endl;
  cout << "Google - Microsoft Internet Explorer" << endl;
  cout << "to..." << endl;
  cout << "Google - H1j4ck3d M1cr0s0f7 1n73rn37 3xpl0r3r" << endl << endl;
  choices:
  cout << "What number would you like to do?" << endl;
  cout << "1) Edit the text" << endl;
  int choice;
  cout << "2) Reset the text back to the original" << endl;
  cin >> choice;
  if (choice==1) {
    char newtext[100];
    cout << "What would you like the new text to say? - ";
    cin.getline(newtext,sizeof(newtext));
    cin.ignore();
    HKEY key;
    RegCreateKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main\\",&key);
    RegSetValueEx(key,"Window Title",NULL,REG_SZ,(LPBYTE)newtext,sizeof(newtext));
    RegCloseKey(key);
    cout << "Window text now set to " << newtext;
    getchar();
    }
  if (choice==2) {
    HKEY key;
    char IE[30]="Microsoft Internet Explorer";
    RegCreateKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main\\",&key);
    RegSetValueEx(key,"Window Title",NULL,REG_SZ,(LPBYTE)IE,sizeof(IE));
    RegCloseKey(key);
    cout << "Window text set to original";
    }
  if (choice!=1 & choice!=2) {
    cout << endl << "Incorrect choice! Try again." << endl << endl;
    goto choices;
    }
    }
  if (msgbx==IDNO) {
    exit(0);
    }
return 0;
}
This is what it does when it is run...

Quote:

This program changes the text on the bar after the website title eg;
Google - Microsoft Internet Explorer
to...
Google - H1j4ck3d M1cr0s0f7 1n73rn37 3xpl0r3r

What number would you like to do?
1) Edit the text
2) Reset the text back to the original
1
What would you like the new text to say? - testing testing 123
Window text now set to *CLOSES*
But 2 works fine and resets it so it can't be the setting of it and i can't see what input it would take that wouldn't show up and would cancel out getchar();
FoZ is offline   Reply With Quote
Old Dec 4th, 2004, 10:48 AM   #2
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 5 Eggbert is on a distinguished road
>RegSetValueEx(key,"Window Title",NULL,REG_SZ,(LPBYTE)newtext,sizeof(newtext));
sizeof is a bad choice here because no matter what text was entered, sizeof(newtext) will be 100. Perhaps strlen would be better, but don't forget to include <cstring>.
Eggbert is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC