Programming in C++ - HACKINGbegins - HACKING Begins

December 29, 2010

Programming in C++ - HACKINGbegins



Hi everyone, Welcome to (HACKINGbegins - "An approach to introduce people with the truth of HACKING"),  in this article i'll show you how can we make a program with the help of c++ to make a *.txt file(we can change its extension as desired  like .bat, .com, .cpp etc) and also place it every where in hard disk (C:,D:,E:) of your computer but firstly i introduce you with C++ computer language which is an object oriented programming language that allow programmer to build large and complex applications in a useful and effective way. C++ is one of the universal language that is used by programmers around the world.
It was developed by Bjarne Stroustrup in 1983.  Bjarne Stroustrup who was a great admirer and master of C and Simula 67 combined the features of both the languages into more powerful language that could support  the concepts of object oriented programming and still could retain the feature of c.

/* Program to make a *.txt file i
 n c: drive */

#include<fstream.h> //preprocessor directive
#include<conio.h>
#include<process.h>
void main()
{
clrscr(); // clear screen
char line1[50]; // lines to be written in file
char line2[50];
char line3[50];
ofstream fin("c:\\abc.txt"); // abc.txt file placed in c: dive
cout<<"Enter the lines given below"<<endl; // output statement
cout<<"Enter line 1"<<endl;
cin>>line1;
cout<<"Enter line 2"<<endl;
cin>>line2;
cout<<"Enter line 3"<<endl;
cin>>line3;
cout<<"Writing detail into file.............";
fin<<line1<<endl;
fin<<line2<<endl;
fin<<line3<<endl;
getch();
 }
 
Copy the program to the Turbo C++ software, compile and run the the program. you can also increase the number or size of words place in every line of program. Example line4[100]..... so on. To change the location of file to be saved is done by "ofstream fin("c:\\abc.txt");" , if u want to place file in a specific location example "C:\Documents and Settings\All Users" then we have to type "ofstream fin(" c:\\Documents and Settings\\All Users\\abc.txt ");".
 
In this article i just give an view to make a file using C++, main advantage of this file it can be copied in denied folders which cant be accessed by Users, This article is only for educational purpose. this technique is often used by Hackers to make virus and placed into specific location without knowing the admin, hope every one liked it. Kindly post you views on this article and send feedback.

Be a Real Hacker - PROFESSIONAL, and change the trend of HACKING.

Thanks and regards :

  Sahil Mahajan.
 

1 comment:

I hope you got some great ideas in this post! Please feel free to share additional ideas or query.