A hacker should know atleast the basics of a programming language.Most of the viruses and other security threats can be identified if only we can understand the codes.
Here I'll introduce to you a few programs like C++,Python and perl.
We'llbegin with C++
C++
C++ is said to be an objected oriented programming language. So let's see what OOP means.
OOP means that the system gives importance to data and it is prevented from misuse.The data is tied to certain functions and only those functions can operate on the data.
C++ cannot be called a pure OOP because it is an extension of C which was a procedure oriented programming language.
The concept of OOP is implemented in C++ with the help of objects and classes of which we will see in detail later.
HISTORY
C++ was developed by Bjarne Stroustrap of AT&T labs around the 1980s.He combined the best of simula67 and C, the result was C++.
Though C++ is said to be an OOP.It can also be programmed as a procedure oriented program like C.
Lets see a simple C++ program.
#include<iostream.h>
void main()
{
cout<<"HI!!!";
}
on compiling and running this code Hi!!! will be displayed on the screen.
Now lets examine each part of the above program.
#include<iostream.h>
this line tells the compiler to load the header file iostream.h.
Header files contain definitions of the common functions which we use.
eg the iostream.h contains functions for input and output.
void main()
main() isthe part which will be executed by the compiler.
the syntax is return type main(), return type specifies if any value will be returned. Here we have used void, so nothings returned.
the cout statement is similar to print statement and displays the text which is given in " ".
and the entire main() should be within { }.
Since i cannot teach you the whole of C++ in a single page we will see some programs and i'll explain to you how these work.
As we are learning hacking lets start with a virus program that modifies your text files: