Jump to content
abhi93696

Hosts File Patch Maker

Recommended Posts

abhi93696

Hello guys

 

Here's my First project- Hosts File Patch Maker :) .Adding websites to hosts file is a bit time taking process(i.e 5-6 sec :D) & sometimes you may need to google the location of hosts file,so this tool creates a patcher which can modify the host file of windows  by  executing it.

As NONE OF US wants our hosts file to be get modified by any unknown sources,so it creates patch in ONLY  .BAT format.By doing so it gives 100% control to the user using it!! User can FULLY observe ,modify,add/remove things even after the patch is created(by opening in notepad)!!

Executing the patch simply adds included websites to host file.

 

USES-: 

If there are some websites which needed to blocked along with Patching it, then Patch generated by it can added with releaser's patch/keygen.It would be far easy for the other person adding that sites to host file having FULL TRANSPARENCY of what is being modified.

 

OS Supported-: All 32/64 bit windows OSes.

 

Requirements-: Net FrameWork v4 & above

 

Quote

 

 

Please test & report the errors(if any).Its my 1st tool which i made!!

 

Thank You :)

 

Edited by abhi93696
  • Upvote 4

Share this post


Link to post
Share on other sites
Kjacky

Change the location from Users\Public to same location of the app and add an icon to the program code for over writing when it is already a file or name the output files seperately 

  • Upvote 1

Share this post


Link to post
Share on other sites
abhi93696

Yeah I will fix that too + add different features too!! So that it would be much easier to manage the  hosts File! This version i made was for just testing! :D

Will also try to optimize the code further!

Thank you for suggestions :) 

  • Upvote 1

Share this post


Link to post
Share on other sites
Jasi2169

hey here is my batch code i have hosts_patcher.bat file made for every software requires made long back in 2014,

 

i just found my old 010 editor copy and had this

 

@ECHO OFF
IF "%OS%"=="Windows_NT" (
SET HOSTFILE=%windir%\system32\drivers\etc\hosts
) ELSE (
SET HOSTFILE=%windir%\hosts
)
ECHO 127.0.0.1 www.sweetscape.com>> %HOSTFILE%
IPCONFIG -flushdns
CLS
ECHO Hosts File Has Been Patched..!!
ECHO.
ECHO Made By: Jasi
ECHO.
PAUSE

 

this is simple to add hosts

 

ECHO 127.0.0.1 www.sweetscape.com>> %HOSTFILE%

 

just add any line with url it adds hosts,just make sure run as admin ,i have dozens of this hostsmaker created for apps which require in the software directory of that software :)

  • Thanks 1

Share this post


Link to post
Share on other sites
abhi93696

Yup bro mine is also nearly the same! :D Actually i just wanted to get a little experience abt "How apps r made in Real world" :D

You knw that it was only day before yesterday that i installed VB Studio 2015 in laptop!!

Now came to knw :D that its very hard to make complex tools like u made "URET patcher"!! Hats off man :bow:

i have full confidence that you must have really invested tooo much time & effort in making that!! ;)

  • Upvote 2

Share this post


Link to post
Share on other sites
Jasi2169

i just downloaded good work,but if you see it as a productivity ,it is not good,because you have to run it 2 times,first time create bat and then run,what if user  made changes and press button 2times ? your old one will be replaced

 

here is small idea

 

get admin access on run make administrator to true in manifest

 

(user press button)

if (check admin_rights == true) {

// admin access

get hosts file location

1. check by window if nt or not

or check by file like if file f.exists and f.isfile then read all text and append the data from editbox and write all text

 

readalltext and writealltext are api you dont need to do anything

 

// now this way user doesnot need to run 2 times

 

now what if entry is already added in hosts ?

 

before writealltext check if entry exists ? if exits either show popup or skip it (you can add checkbox to check if same entry exisut,if exist skip it,if user does not select it then write the same entry and does not read)

 

programming is good and nice task :)

 

}else{

msgbox(""please provide admin access)

return;

}

  • Upvote 2

Share this post


Link to post
Share on other sites
abhi93696

Thanks bro 4 all the suggestions! :)

Yeah i will surely work on that.... For programming part thanks 4 the compliments! :)

But i want to Honestly tell -- "I m a terrible coder :biggrin:" -at least till now!!

While making this small prog i came to knw that Logic is Most important of all!! As i used google & Stack-overflow seeing syntax of the things!

Honestly telling - i have Never-ever coded in C# before this :biggrin:

  • Upvote 1

Share this post


Link to post
Share on other sites
Jasi2169

me too,i use visual basic dot net :D

c# almost same as java syntex change

  • Upvote 1

Share this post


Link to post
Share on other sites
Kjacky

host Patcher GUI

  • Upvote 1

Share this post


Link to post
Share on other sites
TechLord
16 hours ago, Kjacky said:

host Patcher GUI

 

Yes, there is ALREADY a tool for this :)

 

a68ddcc8-0bd2-11e7-9eed-c53d02a08930.png

 

Download it here

 

Quote

 

 

and SOURCES here :

 

Quote

 

Didn't want to discourage @abhi93696 and so did not post it so far :)

 

Also, I understand that Abhi was doing it as a learning exercise in Batch File Programming according to what he told me.

 

Cheers :) 

  • Upvote 3

Share this post


Link to post
Share on other sites
abhi93696

Hi

Yeah it was & Still IS very much my learning exercise!!As i wanted to overcome CODEoPHOBIA(fear of coding :P)!!

 

Also i am very much aware of this tool as this was the 1st thing i saw when i googled "Host editor"!!

This software only make changes to ONLY person using this i.e it does NOT "EXPORT" the patch, so in that case the other person needs to manually add sites or person needs to have this software!!

So my aim was to automate that process even if the other user doesn't have this! So i m thinking to merge with it(after fixing the given suggestions) so that we can edit,export etc using a single standalone software!!

 

PS- there's currently NO term as codeophobia :D:D -- its a new term by me ;)

 

 

Edited by abhi93696
  • Upvote 1

Share this post


Link to post
Share on other sites
Kjacky

modify and play with codes its very interesting thing in programming  

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Guidelines