This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-24 14:57:16

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Custom Hosts Generator Program!

I've been coding away, as being a newbie to C++. But, if you do the right research and looking good things happen! Such as my Custom Hosts Generator program, which makes you custom hosts to use for other things. It works by setting an IP to a web address, much like redirecting a website to an IP. But, this only works LOCALLY! If you want to know where i got my original inspiration for this project, please see Here! I haven't set up any download links for my compiled program, so you'll have to compile it yourself. If anyone can direct me to an awesome file sharing service, that's free, then I will thank you.
EDITS: Thanks to TRocket, I have a Github download! Here it is! NOTE: This download may be broken, and non-working.
And if that doesn't work, I finally managed to setup my own version! Here it is!
Here's my code, for any of you that are interested:

Code:

#include <iostream>
#include <fstream>
using namespace std;
int main ( )
{
    char *c = new char;
    char *v = new char;
    cout<<"Please input your desired IP."<<endl;
    cout<<"i.e.: 192.168.0.1"<<endl;
    cin>>c;
    cout<<endl;
    cout<<"Now insert your desired hostname."<<endl;
    cout<<"ie.: 192.168.0.1 would be router.int"<<endl;
    cin>>v;
    cout<<endl;
    ofstream file;
    file.open("C:\\Windows\\System32\\drivers\\etc\\hosts", ios_base::app);
    file<<endl<<c<<"    "<<v;
    file.close( );
    cout<<"Wrote "<<c<<"    "<<v<<" to the hosts file. Enjoy!"<<endl;
    system("PAUSE");
    return 0;
};

Enjoy!

Last edited by DigiTechs (2012-10-24 17:43:31)


I'm back.
Maybe.

Offline

 

#2 2012-10-24 15:26:16

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Custom Hosts Generator Program!

I have uploaded it here to github if you want to use it...


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2012-10-24 15:31:18

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: Custom Hosts Generator Program!

You could try FileDen for free file hosting with direct downloads - they seem reputable enough.

Also, did you steal my idea for "router.int?"

IHeartGaming wrote:

I pointed my router to "router.int" (int for internal)...


IHeartGaming

Offline

 

#4 2012-10-24 15:38:23

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

IHeartGaming wrote:

You could try FileDen for free file hosting with direct downloads - they seem reputable enough.

Also, did you steal my idea for "router.int?"

IHeartGaming wrote:

I pointed my router to "router.int" (int for internal)...

Yes, I did. Well, it was the only workable local thing... And thanks for the FileDen and Github downloads!


I'm back.
Maybe.

Offline

 

#5 2012-10-24 15:44:42

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

IHeartGaming wrote:

You could try FileDen for free file hosting with direct downloads - they seem reputable enough.

Also, did you steal my idea for "router.int?"

IHeartGaming wrote:

I pointed my router to "router.int" (int for internal)...

I just tried fileden, 'exe files are blocked' D:


I'm back.
Maybe.

Offline

 

#6 2012-10-24 15:49:54

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

Well, somthing's wrong, as it doesn't want to work.. It keeps crashing. Mabye it's because Windows doesn't like it?
EDIT: Yes. It definitely doesn't like it.
EDIT 2: It works completely fine when I use my IDE though.. Odd.

Last edited by DigiTechs (2012-10-24 15:52:06)


I'm back.
Maybe.

Offline

 

#7 2012-10-24 15:56:15

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Custom Hosts Generator Program!

DigiTechs wrote:

Well, somthing's wrong, as it doesn't want to work.. It keeps crashing. Mabye it's because Windows doesn't like it?
EDIT: Yes. It definitely doesn't like it.
EDIT 2: It works completely fine when I use my IDE though.. Odd.

Hmm, I compiled it on a windows 2000 VM i use for compiling Itchy++. If you email me the one that does work to havwrukn@trashmail.net I'll put that there...


http://i.imgur.com/1QqnHxQ.png

Offline

 

#8 2012-10-24 16:07:54

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

TRocket wrote:

DigiTechs wrote:

Well, somthing's wrong, as it doesn't want to work.. It keeps crashing. Mabye it's because Windows doesn't like it?
EDIT: Yes. It definitely doesn't like it.
EDIT 2: It works completely fine when I use my IDE though.. Odd.

Hmm, I compiled it on a windows 2000 VM i use for compiling Itchy++. If you email me the one that does work to havwrukn@trashmail.net I'll put that there...

I belive I know why mine only works for me.. I created the project as a win32 console app. I'll remake it as a CLR.
EDIT: Done! It should work now, as long as you have the right things to run it.

Last edited by DigiTechs (2012-10-24 16:31:10)


I'm back.
Maybe.

Offline

 

#9 2012-10-24 17:33:00

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

Does anyone like the program? I belive it's very helpful if you want to shorten IPs down but not affect everyone else!


I'm back.
Maybe.

Offline

 

#10 2012-11-08 14:15:14

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Custom Hosts Generator Program!

UBER bump


I'm back.
Maybe.

Offline

 

Board footer