Monday 4 February 2013

IT series Control Structure Part 17:

Converter program :
Centimeter-->Inches
Litre-->Gallon
Kilometer-->Miles
Kilogram-->Pounds

This is the code:


#include<iostream.h>
#include<stdio.h>
void main()
{
printf("This is the menu:\n\n");
cout<<" Inch<--> Centimeter\nGallon<-->Litres\nMile<-->Kilomemter\nPound<-->Kilogram\n\n";
cout<<"Now acording to your choice: select it\n";
cout<<"inch->centimeter press 1\nCentimetr->inch press 2\nLitr->Gallon press 3\nGallon->Litre press 4\n";
cout<<"Mile->Kilometr press 5\nKilomter->Mile press 6\nPound->Kilogram press 7\nKilogram->pound press 8\n\n";

int a;float z,b;
cin>>a;
switch(a)
{
case 1:
cout<<"Enter your unit value\n";
cin>>z;

b=z*2.54;
cout<<"\nThis is the conversion result of inch to centimeter\n"<<b<<endl;
case 2:
cout<<"Entr your unit value:\n";
cin>>z;
b=(1.0/2.54)*z;
cout<<"This is the conversion result of Centimeter to inch\n"<<b<<endl;
case 3:
cout<<"Entr your unit value:\n";
cin>>z;
b=z*3.785;
cout<<"\nThis is the conversion of Gallon to Litre\n"<<b<<endl;
case 4:
cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/3.785)*z;
cout<<"This is the conversion result of Litre to Gallon\n"<<b<<endl;
case 5:
        cout<<"Enter your unit value:\n";
cin>>z;
b=z*1.609;
cout<<"This is the conversion of Mile to Kilometers\n"<<b<<endl;
case 6:
        cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/1.609)*z;
cout<<"This is the conversion of Kilometer to Mile\n"<<b<<endl;
case 7:
cout<<"Enter your unit value:\n";
cin>>z;
b=z*.4536;
cout<<"This is the conversion of Pound to Kilogram\n"<<b<<endl;
case 8:
   cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/.4536)*z;
cout<<"This is the conversion of Kilogram to pound\n"<<b<<endl;
default:
cout<<"Please try again and enter a valid option\n";
}
}

IT series Control Structure Part 13:


Find the roots of the Quadratic Equation:
ax2+bx+C=0

#include<iostream.h>
#include<stdio.h>
#include<math.h>
void main()
{
printf("This program solve the quadratic equation and find out the real roots of the equation\n");
cout<<"Kindly just enter the coeffint of the equation ax^2+bx+c\n\n";
int a,b,c;
cout<<"Enter units\n\n";cin>>a>>b>>c;
float z,x,v,n;
x=pow(b,2)-4*a*c;
z=sqrt(x);
    if(z>=0)
{
v=((-b+z)/(2*a));
cout<<"This is first root\n"<<v<<endl;
v=((-b-z)/(2*a));
cout<<"This is second root of this quadratic equation\n\n"<<v<<endl;
}
else
cout<<"Roots are not real\n";
}


IT series Control Structure Part 8:

Conversion of some Numerical Identities:
Converter program :

Centimeter-->Inches
Litre-->Gallon
Kilometer-->Miles
Kilogram-->Pounds


#include<iostream.h>
#include<stdio.h>
void main()
{
printf("This is the menu:\n\n");
cout<<" Inch<--> Centimeter\nGallon<-->Litres\nMile<-->Kilomemter\nPound<-->Kilogram\n\n";
cout<<"Now acording to your choice: select it\n";
cout<<"inch->centimeter press 1\nCentimetr->inch press 2\nLitr->Gallon press 3\nGallon->Litre press 4\n";
cout<<"Mile->Kilometr press 5\nKilomter->Mile press 6\nPound->Kilogram press 7\nKilogram->pound press 8\n\n";

int a;float z,b;
cin>>a;
switch(a)
{
case 1:
cout<<"Enter your unit value\n";
cin>>z;

b=z*2.54;
cout<<"\nThis is the conversion result of inch to centimeter\n"<<b<<endl;
case 2:
cout<<"Entr your unit value:\n";
cin>>z;
b=(1.0/2.54)*z;
cout<<"This is the conversion result of Centimeter to inch\n"<<b<<endl;
case 3:
cout<<"Entr your unit value:\n";
cin>>z;
b=z*3.785;
cout<<"\nThis is the conversion of Gallon to Litre\n"<<b<<endl;
case 4:
cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/3.785)*z;
cout<<"This is the conversion result of Litre to Gallon\n"<<b<<endl;
case 5:
        cout<<"Enter your unit value:\n";
cin>>z;
b=z*1.609;
cout<<"This is the conversion of Mile to Kilometers\n"<<b<<endl;
case 6:
        cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/1.609)*z;
cout<<"This is the conversion of Kilometer to Mile\n"<<b<<endl;
case 7:
cout<<"Enter your unit value:\n";
cin>>z;
b=z*.4536;
cout<<"This is the conversion of Pound to Kilogram\n"<<b<<endl;
case 8:
   cout<<"Enter your unit value:\n";
cin>>z;
b=(1.0/.4536)*z;
cout<<"This is the conversion of Kilogram to pound\n"<<b<<endl;
default:
cout<<"Please try again and enter a valid option\n";
}
}

IT series Control Structure Part 5:

Conversion of temperature:

void main()
{
char a;
cout<<"Enter C for Celcius to Farenhiet:\nEnter F for farenheit to celcius\n";
cin>>a;
if(a=='C')
{
int b;
cout<<"Enter the temprature in celcius: ";cin>>b;cout<<"You enter the Celcius temprature as:"<<b<<"C"<<endl;
float bb;
bb=(9.0/5.0)*b+32;
cout<<"This is the temprature in Farenheit:"<<bb<<endl;
}
else
{
int b;
cout<<"Enter the temprature in Farenheit: ";cin>>b;cout<<"You enter the farenheit temprature as:"<<b<<"F"<<endl;
float bb;
bb=((b-32.0)*(5.0/9.0));
cout<<"This is the temprature in Celcius:"<<bb<<endl;
}
}

IT series Control Structure part 3:

To check wheter the third one is the common divisior of the first and second one.

void main()
{
int a,b,c;
cout<<"Enter three numbers\n";
cin>>a>>b>>c;

if(a==0)
cout<<"Sorry try again\n";
else
{
if(b%a==0 && c%a==0)
cout<<"The first number is divisble of the second and third one\n";
else
cout<<"First variable is not divisor of the second and third one\n";
}
}

Friday 25 January 2013

Hacking Lec 8: DNS Hijacking


DNS hijacking (sometimes referred to as DNS redirection) is a type of malicious attack that overrides a computer’s TCP/IP settings to point it at a rogue DNS server, thereby invalidating the default DNS settings. In other words, when an attacker takes control of a computer to alter its DNS settings, so that it now points to a rogue DNS server, the process is referred to as DNS hijacking.
As we all know, the “Domain Name System (DNS)” is mainly responsible for translating a user friendly domain name such as “google.com” to its corresponding IP address “74.125.235.46″. Having a clear idea of DNS and its working can help you better understand what DNS hijacking is all about. 

How DNS Hijacking Works?

As mentioned before, DNS is the one that is responsible for mapping the user friendly domain names to their corresponding IP addresses. This DNS server is owned and maintained by your Internet service provider (ISP) and many other private business organizations. By default, your computer is configured to use the DNS server from the ISP. In some cases, your computer may even be using the DNS services of other reputed organizations such as Google. In this case, you are said to be safe and everything seems to work normally.
DNS Hijacking
But, imagine a situation where a hacker or a malware program gains unauthorized access to your computer and changes the DNS settings, so that your computer now uses one of the rogue DNS servers that is owned and maintained by the hacker. When this happens, the rogue DNS server may translate domain names of desirable websites (such as banks, search engines, social networking sites etc.) to IP addresses of malicious websites. As a result, when you type the URL of a website in the address bar, you may be taken to a fake website instead of the one you are intending for. Sometimes, this can put you in deep trouble!

What are the Dangers of DNS Hijacking?

The dangers of DNS hijacking can vary and depend on the intention behind the attack. Many ISPs such as “OpenDNS” and “Comcast” use DNS hijacking for introducing advertisements or collecting statistics. Even though this can cause no serious damage to the users, it is considered as a violation of RFC standards for DNS responses.
Other dangers of DNS hijacking include the following attacks:
Pharming: This is a kind of attack where a website’s traffic is redirected to another website that is a fake one. For example, when a user tries to visit a social networking website such as Facebook.com he may be redirected to another website that is filled with pop-ups and advertisements. This is often done by hackers in order to generate advertising revenue.
Phishing: This is a kind of attack where users are redirected to a malicious website whose design (look and feel) matches exactly with that of the original one. For example, when a user tries to log in to his bank account, he may be redirected to a malicious website that steals his login details.

How to Prevent DNS Hijacking?

In most cases, attackers make use of malware programs such as a trojan horse to carry out DNS hijacking. These DNS hijacking trojans are often distributed as video and audio codecs, video downloaders, YoTube downloaders or as other free utilities. So, in order to stay protected, it is recommended to stay away from untrusted websites that offer free downloads. The DNSChanger trojan is an example of one such malware that hijacked the DNS settings of over 4 million computers to drive a profit of about 14 million USD through fraudulent advertising revenue.
Also, it is necessary to change the default password of your router, so that it would not be possible for the attacker to modify your router settings using the default password that came with the factory setting. For more details on this topic you can read my other post on How to Hack an Ethernet ADSL Router.
Installing a good antivirus program and keeping it up-to-date can offer a great deal of protection to your computer against any such attacks.

What if you are already a victim of DNS hijacking?

If you suspect that your computer is infected with a malware program such as DNSChanger, you need not panic. It is fairly simple and easy to recover from the damage caused by such programs. All you have to do is, just verify your current DNS settings to make sure that you are not using any of those DNS IPs that are blacklisted. Otherwise re-configure your DNS settings as per the guidelines of your ISP.

Computer Lec 4: Introduction To Networking


Networking

We start next from the Network interface card.

Hubs:

An Ethernet hub or concentrator is a device for connecting multiple twisted pair or fibre optic Ethernet devices together, making them act as a single segment.

It works at the physical layer of the OSI model, repeating the signal received at one port out each of the  other ports (but not the original one). 

The device is thus a form of multiport repeater. Ethernet hubs are also responsible for forwarding a jam signal to all ports if it detects a collision. Hubs also often come with a BNC and/or AUI connector to allow connection to legacy 10BASE2 or 10BASE5 network segments.

 The availability of low-priced Ethernet switches has largely rendered hubs obsolete but they are still seen in older installations and more specialist applications.

Switches:

A network switch or switch for short is a networking device that performs transparent bridging (connection of multiple network segments with forwarding based on MAC addresses) at full wire speed in hardware.

As a frame comes into a switch, the switch saves the originating MAC address and the originating (hardware) port in the switch’s MAC address table. 

This table often uses content-addressable memory, so it is sometimes called the “CAM table”. The switch then selectively transmits the frame from specific ports based on the frame’s destination MAC address and previous entries in the MAC address table. 

If the destination MAC address is unknown, for instance, a broadcast address or (for simpler switches) a multicast address, the switch simply transmits the frame out of all of the connected interfaces except the incoming port.

If the destination MAC address is known, the frame is forwarded only to the corresponding port in the MAC address table.

Hubs VS Switches:

A hub, or repeater, is a fairly unsophisticated broadcast device. Any packet entering any port is broadcast out on every port and thus hubs do not manage any of the traffic that comes through their ports.

 Since every packet is constantly being sent out through every port, this results in packet collisions, which greatly impedes the smooth flow of traffic.

 A switch isolates ports, meaning that every received packet is sent out only to the port on which the target may be found (assuming the proper port can be found; if it is not, then the switch will broadcast the packet to all ports except the port the request originated from). 

Since the switch intelligently sends packets only where they need to go the performance of the network can be greatly increased.

See next lecture 5 about this more. 

Computer Lec 3: Introduction To Networking


Networking

Why use a Network?

Quite simply explained we use networks for communication between computers, sharing of data and peripherals. In the business world we use networks for ease of administration and to cut costs.
Sharing data example imagine an office with 5 secretaries working on 5 different computers, one requires a file from another computer in a non networked office this file would have to be written to a portable media then loaded onto the computer. In a networked office the file could be accessed via the network from a shared folder.
Sharing peripherals example the same office with 5 secretaries working on 5 different computers, in order to print their work each computer would need to have a printer attached. In a networked office you could have one shared printer, cutting costs.

What do you need?

A common language or protocol (TCP/IP IPX/SPX, APPLE TALK) is a convention or standard that controls or enables the connection, communication, and data transfer between two computing endpoints.

A common language or protocol (TCP/IP IPX/SPX, APPLE TALK) is a convention or standard that controls or enables the connection, communication, and data transfer between two computing endpoints.

Cabling BNC,Cat5, fibre optic

Hardware NIC(Network Interface Card), router, switch, hub, modem wireless access point.
Network Service (DNS, WINS, DHCP)
.

Network Hardware

                                  Networking

Network Interface Card

A network card, network adapter, network interface card or NIC is a piece of computer hardware designed to allow computers to communicate over a computer network. It has a MAC address.

Every network card has a unique 48-bit serial number called a MAC address, which is written to ROM carried on the card.

Every computer on a network must have a card with a unique MAC address.

The IEEE is responsible for assigning MAC addresses to the vendors of network interface cards. No two cards ever manufactured should share the same address.

See next lecture 4 for more..

Monday 14 January 2013

Let Us C Chapter 3 problem No: E-l


//Program to calculate amount  of compound interest
//Formula for compound Interest: a = p ( 1 + r / q )^nq

#include<iostream>
#include<math.h>

using namespace std;

int main(void)
{
    float r,a1,a2,p,q,n,t1,t2,i;


    for(i=0;i<10;i++)
    {
        cout<<"Enter details for set "<<i+1;
        cout<<endl;
        cout<<"Enter the Principle(p):  ";
        cin>>p;
        cout<<"Enter the rate of interest(r):  ";
        cin>>r;
        cout<<"Enter number of years(n):  ";
        cin>>n;
        cout<<"Enter the number of periods per year (q):  ";
        cin>>q;

        t1= (1+(r/q));
        t2=n*q;
        a1=pow(t1,t2);
        a2=(p*a1);

        cout<<a2;
        cout<<endl<<endl;
    }
}

Let Us C Chapter 3 problem No: E-j


//Design 3

#include<iostream>
#include<conio.h>

using namespace std;

int main(void)
{
    int i,j,x=1;

    for(i=0;i<=5;i++)
    {
        for(j=5;j>i;j--)

        {
           cout.width(3);
            cout<<" ";

        }

        for(j=0;j<i;j++)
        {
            if((i==3) && (j==1))
            {

            cout.width(5);
            cout<<"2"<<" ";
            }

            else if((i==4) && ((j==1)||(j==2)))
              {
               cout.width(5);
               cout<<"3"<<" ";
              }
            else if((i==5) && ((j==1) || (j==3)))
            {
                cout.width(5);
             cout<<"4"<<" ";
            }
            else if((i==5) && (j==2))
            {
               cout.width(5);
             cout<<"6"<<" ";
            }
           else
           {
               cout.width(5);
               cout<<x<<" ";
           }


        }

        cout<<endl;
    }
getch();
}

Let Us C Chapter 3 problem No: E-i


//Design 2

#include<iostream>

using namespace std;

int main(void)
{
    int i,j,x=1;

    for(i=0;i<6;i++)
    {
        for(j=6;j>i;j--)

        {
            cout.width(2);
            cout<<" ";

        }

        for(j=0;j<i;j++)
        {

            cout.width(3);
          //if((i==3) && (j==1))
                cout<<j<<" ";
            //  else
            //cout<<x<<" ";

        }

        cout<<endl;
    }

}

Let Us C Chapter 3 problem No: E-h


//Program to generate table of any IP number

#include<iostream>

using namespace std;

int main(void)
{
    int n,i;

    cout<<"Enter the number:  ";
    cin>>n;
    cout<<endl;

    for(i=1;i<11;i++)
    {
        //cout<<n<<" x "<<i<<" = "<<(n*i)<<endl;
        cout<<n<<" x ";
        cout.width(2);
        cout<<i<<" = ";
        cout.width(3);
        cout<<(n*i);
        cout<<endl;
    }
}

Let Us C Chapter 3 problem No: E-f


//Design

#include<iostream>
#include<windows.h>

using namespace std;

int main(void)
{
    int i,j,k,x,c,y;
    char xx,yy,kk;

    for(i=0;i<7;i++)
    {
         x=65;y=71-i;

        for(j=i;j<7;j++)
        {
            xx=x;
            cout.width(2);
            cout<<xx;
            x++;
        }

        for(k=1;k<(2*i);k++)
        {
           cout.width(2);
            cout<<" ";

        }

         if(i==0)
         {
             for(k=70;k>=65;k--)
             {
                 kk=k;
                 cout.width(2);
                cout<<kk;
             }

         }
        else
        {
        for(j=7;j>i;j--)
        {
            yy=y;
            cout.width(2);
            cout<<yy;
            y--;
        }
        }
        cout<<endl;
    }
}

Let Us C Chapter 3 problem No: E-a


// Program to print prime numbers form 1 to 300

#include<iostream>

using namespace std;

int main(void)
{
    int i,j,x;

    cout<<"Prime numbers between 1 to 300 are:  \n";

    for(i=1;i<=300;i++)
    {   x=0;
        for(j=2;j<i;j++)
        {
            if(i%j==0)
            {
                x=1;
                break;
            }

        }
             if(x==0)
            {
             cout.width(3);
             cout.fill('0');
             cout<<i<<", ";
            }
    }
}

Let Us C Chapter 3 problem No: B-i


// Program to find range of set of numbers

#include<iostream>
#include<windows.h>

using namespace std;

int main(void)
{
    int l,n,i=0,max=0,min=0,range;
    char c;

   cout<<"Define length of number set:  ";
   if(cin>>l)
   {}
   else
   {
       cout<<"Error: Only numeric values are allowed, TRY AGIAN...\n\n";
       cin.clear();
       cin.ignore();

       main();
   }


   if(l<=0)
   {
       cout<<"Error: Invalid set lenght\n Try again...\n\n";
       main();
   }

   cout<<endl;
   cout<<"Enter numbers into the set:\n";

   for(i=0;i<l;i++)
   {
       cin>>n;
       if(n>max)
        max=n;

        if(i==0)
            min=n;

        if(n<min)
         min=n;

   }
   cout<<"Range of the set is MAX - MIN: "<<max<<" - "<<min<<" = "<<max-min;
}

Let Us C Chapter 3 problem No: B-h


//Program to find octal equivalent of any number

#include<iostream>
#include<windows.h>
#include<stdio.h>
#include<conio.h>

using namespace std;

int convertor();
int main()
{
    cout<<"================================================================================\n";
    cout<<"                        Super Number Convertor (v3.7)";
    cout<<endl<<endl;
    cout<<"                                                Developed by: Azhar Ahmed";
    cout<<endl;
    cout<<"                                                            : Matthew Chan";
    cout<<endl<<endl;
    cout<<"                                                Designed by : Matthew Chan";
    cout<<endl;
    cout<<"================================================================================\n";
    cout<<endl;
    cout<<endl;
    system("color 33");

    return convertor();

}
void binary(long n) {
long converter;

if(n <= 1) {
cout << n;
return;
}

converter = n%2;
binary(n >> 1);
cout << converter;
}
int convertor(void)
 {
     long n,b,x,bina;
     char c;
     do
     {

     cout<<"Enter any decimal value:  ";

     if(cin>>n)
     {
         if(n<0)
         {
              cout<<"Error: Please enter valid decimal value"<<" TRY AGAIN\n";
            cin.clear(); /*-->  when some error encouner by wrong input from cin function of iostream the function cin became unstable so you need to clear this function's value */
            cin.ignore();//--> and than you need to ignore the previous state
            convertor();
         }
     }
     else
     {
             cout<<"Error: Please enter valid decimal value"<<" TRY AGAIN\n";
            cin.clear(); /*-->  when some error encouner by wrong input from cin function of iostream the function cin became unstable so you need to clear this function's value */
            cin.ignore();//--> and than you need to ignore the previous state
            convertor();
     }

        cout<<endl;
        cout<<"The Binary equivalent of "<<n<<" is:  ";
        binary(n);
        cout<<endl<<endl;

        cout<<"The Octal equivalent of "<<n<<" is:  ";
        printf("%o",n);
        cout<<endl<<endl;

        cout<<"The Hexadecimal equivalent of "<<n<<" is:  ";
        printf("%x",n);



     cout<<endl<<endl;
     cout<<"Do you want to convert another number?(y/n):  ";
     c=getche();
     cout<<endl<<endl;

     }

     while((c=='y') || (c=='Y'));
     cout<<"Thank you for using our application.";
     getch();
     exit(0);
 }

Let Us C Chapter 3 problem No: B-g


//Program to display count of +ve, -ve or zero numbers inserted by users

#include<iostream>
#include<conio.h>
#include<windows.h>

using namespace std;

int main(void)
{
    int n,pos =0, neg =0, zero =0, i = 0;
    char c;


  do
    {
        cout<<"Insert any number:  ";
        cin>>n;

        if(n==0)
        {
            zero++;
        }

        else if(n>0)
        {
            pos++;
        }

        else
        {
            neg++;
        }
        i++;


    cout<<"Do you want to insert a number:  ";
    c=getche();
    cout<<endl;
    }
   while((c=='y') || (c== 'Y'));



    cout<<endl;
    cout<<"You entered total "<<i<<" terms.";
    cout<<endl;
    cout<<"In which, total number of\n";
    cout<<"Positives:  ";
    cout<<pos;
    cout<<endl;
    cout<<"Negatives:  ";
    cout<<neg;
    cout<<endl;
    cout<<"Zeros    :  ";
    cout<<zero;
}

Let Us C Chapter 3 problem No: B-c


//Program to calculate m^n

#include<iostream>

using namespace std;

int main(void)
{
    int m,n,i,x;

    cout<<"Enter value of base (m)     :  ";
    cin>>m;
    cout<<"Enter the value of power (n):  ";
    cin>>n;
    x=m;

    for(i=n-1;i>0;i--)
    {
        x=x*m;
    }
    cout<<m<<"^"<<n<<" = "<<x;
}

Let Us C Chapter 3 problem No: B-b


//Program to find factorial of any number

#include<iostream>

using namespace std;

int main(void)
{
    int i,x=1,n;

    cout<<"Enter the number:  ";
    cin>>n;

    for(i=n-1;i>=1;i--)
    {
        n=n*i;
        cout<<i+1<<" x ";
    }
    cout<<'1'<<endl;
      cout<<"Factorial = "<<n;
}

Let Us C Chapter 3 problem No: B-a


//Program to calculate overtime paid to 10 employess

#include<iostream>

using namespace std;

int main(void)
{
    int i,j,h,s;

    for(i=0;i<10;i++)
    {

    cout<<"Enter the total working hours of employee "<<i+1<<":  ";
    cin>>h;

    if(h>40)
    {
        s= (h-40)*12;
        cout<<"Employee "<<i+1<<" worked overtime for "<<(h-40)<<" hours\n";
        cout<<"And hence will get additional "<<s<<" $\n";
    }
    else
    {
        cout<<"Employee "<<i+1<<" did no overtime hence will get 0$ as additional salary\n";
    }
    cout<<endl;
    }
}

Computer Lec 2: Learn about all peripheral connections


Sunday 13 January 2013

C / C++ Coding Solutions and Discover the IT world: Hacking Lec 7: how can u lock any folder by using cmd

C / C++ Coding Solutions and Discover the IT world: Hacking Lec 7: how can u lock any folder by using cmd

Hacking Lec 7: how can u lock any folder by using cmd


Q: how can u lock any folder by using cmd?
A: Just simple go to the Run--->cmd.




 now here type the following
   cacls folder_name  /p everyone:n/f
   n for initializing lock and f for deactivating lock.


If your press Y then your folder will be lock from now onward same logic is use for unlock the folder.

Hacking Lec 6: How can you move your mouse cursor by using your keyboard


Q: How can u move your cursor by using your keyboard?
A: Simple Go to control panel then go to accessibility option  where u click "use mouse keys" then go the option according to your requirement.















Friday 11 January 2013

Hacking lec 5: how can you check it by cmd that when at what time the password change on which date?


Q: how can you check it by cmd that when at what time the password change on which date? 

Ans:
Simple from where you type this "net user Username *"just remove this "*" you can see
that the whole history will appear on the cmd window.
Note:
Here in term of the username I means that the username is the name of your computer system through                                                           which it is registered.
look out this screen shot



Hacking Lec 4: How can u broke or remake a new password on any computer by using cmd?


Q: How can u broke or remake a new password on your computer by using cmd?
Ans:
   Simple go to cmd from accessories then open it and then type "net user"
   you see some instruction then type "net user username *"
   you see there will be a command for typing password then type your new password.









Note:
This method is uses commonly when you wants to change the password without the permission of the administrator. And you can do this in such like manner when the "cmd" asks from the hacker type a password then you see when you are typing a new password you will not see any activity on the screen like you can see on the picture.

Thursday 10 January 2013

Let Us C Chapter 2 problem No: C-j


//Program to check 3 points lie in a straight line
/*concept: If three points are in straight line (i.e. collinear)
the area of triangle formed by these three points will be zero */

#include<iostream>
#include<math.h>
#include<windows.h>

using namespace std;

class points
{
public:
    void in()
    {

    }

    double distance(long u, long v, long w, long x)
    {
        double d;
        d=sqrt(((v-u)*(v-u))+((x-w)*(x-w)));
        return(d);
    }

    long area_tri(long p, long q, long r)
    {
        long peri, area;
        peri = (p+q+r)/2;
        area = (peri*(peri-p)*(peri-q)*(peri-r));
        return(area);
    }
};

int main(void)
{
    system("color 3F");
    long x1,x2,x3,y1,y2,y3,dist_ab,dist_bc,dist_ac;
    double ar;
    points p;

    cout<<"Enter x and y co-ordinates of three points:\n";
    cout<<"Point A:  \n";
    cout<<"x1:  ";
    cin>>x1;
    cout<<"y1:  ";
    cin>>y1;
    cout<<"Point B:  \n";
    cout<<"x2:  ";
    cin>>x2;
    cout<<"y2:  ";
    cin>>y2;
    cout<<"Point C:  \n";
    cout<<"x3:  ";
    cin>>x3;
    cout<<"y3:  ";
    cin>>y3;

    cout<<endl;

    dist_ab = p.distance(x1,x2,y1,y2);
    dist_ac = p.distance(x1,x3,y1,y3);
    dist_bc = p.distance(x2,x3,y2,y3);

    ar=p.area_tri(dist_ab,dist_ac,dist_bc);

    if(ar==0)
        cout<<"Points lie on a straight line\n";
    else
        cout<<"Points do not lie on a staight line\n";
}



Hacking Lec 3: Some useful Windows Tricks

Q 1: How can u Block website?
 Go to C derive then go to window then go to system 32 then go to drivers then go to etc here u see the host file then open it in notepad here last domain address is for blocking website so add your web which you want   to block.
    
Q 2: how can u add something in your context menu?
 So Simple go to Run from stat menu type "regedit"(Registry editor) for understanding.
  Now go there u see that"HKEY_LOCAL_MACHINE" then type "class" after this u open it u find this symbol "*" now open it u
   find this "shell" open it insert key name then insert command then go to this which is above the class "C07ft5Y" insert
   a string key and then enter the address in such like "C:\WINDOWS\System32" "%1" then click OK.

Q 3: How can u disorder your keyboard even it is working properly?
A: Simple go to control panel then go to acceptability option open it where u find many option select keyboard then
   click all the selecting task then click OK. U see your keyboard is not working.

Q 4: What is click lock?
A: Click lock is basically used for dragging object from one place from other so go to Control option then
   select mouse then open it and then turn on the click lock.

Q 5: How can u move your cursor by using your keyboard?
A: Simple Go to control panel then go to acceptability option  where u click "use mouse keys" then go the option according
   to your requirement.

Wednesday 9 January 2013

Let Us C Chapter 2 problem No: C-k


//Program to check whether the poin lies on x axis, y axis or origin
#include<iostream>

using namespace std;

class point
{
    int x,y;
public:
    void in()
    {
        cout<<"Enter the point:  \n";
        cout<<"x co-ordinate:  ";
        cin>>x;
        cout<<"y co-ordinate:  ";
        cin>>y;
    }

    void check()
    {
        if((x==0) && (y==0))
        {
            cout<<"Point lies on origin";
        }

        else if(x==0)
        {
            cout<<"Point lies on y-axis";
        }

        else if(y==0)
        {
            cout<<"Point lies on x-axis";
        }

        else
        {
            cout<<"Point lies somewhere between x-axis and y-axis";
        }
    }

};

int main(void)
{
    point p;
    p.in();
    p.check();
}



Let Us C Chapter 2 problem No: C-g


//Program to check a triangle is valid or not

#include<iostream>

using namespace std;

class triangle
{
    //int a,b,c;
public:
    int validation(int x, int y, int z)
    {
        if((x+y+z) == 180)
            return(1);
        else
            return(0);
    }
};

int main(void)
{
    int a,b,c,v;
    triangle t;
    cout<<"Enter three angles of a triangle:\n";
    cout<<"Angle a:  ";
    cin>>a;
    cout<<"Angle b:  ";
    cin>>b;
    cout<<"Angle c:  ";
    cin>>c;
    cout<<endl;

    v=t.validation(a,b,c);
    {
        if(v==1)
            cout<<"Valid Triangle as the sum of three angles "<<a<<" + "<<b<<" + "<<c<<" = 180";
        else
            cout<<"Invalid triangle as the sum of three angles "<<a<<" + "<<b<<" + "<<c<<" = "<<(a+b+c);
    }
}



Let Us C chapter 2 problem No: C-f


//Program to determine youngest age

#include<iostream>

using namespace std;

class age
{
    int a,b,c;
public:
   void in()
    {
        cout<<"Enter the age of person 1:  ";
        cin>>a;
        cout<<"Enter the age of person 2:  ";
        cin>>b;
        cout<<"Enter the age of person 3:  ";
        cin>>c;
        cout<<endl;

        comp(a,b,c);
    }

    void comp(int x, int y, int z)
     {
         if((x<y) && (x<z))
            cout<<"Youngest person is 'Person 1' with age "<<x<<" years";
         else if((y<x) && (y<z))
            cout<<"Youngest person is 'Person 2' with age "<<y<<" years";
         else
            cout<<"Youngest person is 'Person 3' with age "<<z<<" years";
     }


};


int main(void)
{
    age a;
    a.in();
}


Let Us C chapter 2 problem No: C-e


//Program to find reverse of IP number and compare them

#include<iostream>

using namespace std;

class number
{
    int i,j,x=0;
    int n, t[5], rev_array[5];
public:
    void in()
     {
         cout<<"Enter any five digit number:  ";
         cin>>n;
     }

     void rev()
      {
          int r,temp;
          i=0;
          temp=n;
          while(n!=0)
          {
              r=n%10;
              n=n/10;
              t[i]=r;
              i++;
          }
          n=temp;

          j=4;
          for(i=0;i<5;i++)
          {
              rev_array[j]=t[i];
              j--;
          }

          cout<<"Reverse of the IP number is:  ";
          for(i=0;i<=4;i++)
          {
              cout<<t[i];
          }

      }

      int compare()
      {
        int x;
          for(i=0;i<5;i++)
          {
            if(t[i]==rev_array[i])
              {
                  x=1;
                  return(x);
              }
              else
              {
                  x=0;
                  return(x);
              }
          }
      }

      void result()
      {
          int z;
          z=compare();
          cout<<endl<<endl;
          if(z==1)
           {
             cout<<n<<" and its reverse are similar";
           }
         else
           {
              cout<<n<<" and its reverse are not similar";
           }

      }
};

int main(void)
{
    number num;
    num.in();
    num.rev();
    num.result();
}




Let Us C chapter 2 problem No: C-d


//Calendar Program - Detecting the day on 1st Jan between 1900-xxxx

#include<iostream>


using namespace std;

class calendar
{
    int y,year, days, week, leap, rem;
public:
    void in()
     {
         cout<<"Enter the year:  ";
         cin>>y;
     }

     void diff()
     {
        year = y-1900;
        leap = year/4;
        days = (year*365)+leap;
        week = days%7;
        if(y==2000)
        week=week-1;
        day_checker(week);
     }

     void day_checker(int a)
      {
          if(a==0)
            cout<<"The day on 1st January of "<<y<<" is Monday";
          if(a==1)
            cout<<"The day on 1st January of "<<y<<" is Tuesday";
          if(a==2)
            cout<<"The day on 1st January of "<<y<<" is Wednesday";
          if(a==3)
            cout<<"The day on 1st January of "<<y<<" is Thursday";
          if(a==4)
            cout<<"The day on 1st January of "<<y<<" is Friday";
          if(a==5)
            cout<<"The day on 1st January of "<<y<<" is Saturday";
          if(a==6)
            cout<<"The day on 1st January of "<<y<<" is Sunday";
      }
};

int main(void)
{
  calendar cal;
  cal.in();
  cal.diff();
}


Let Us C chapter 2 problem No: C-a



//Program to calculate profit and lost

#include<iostream>
#include<windows.h>

using namespace std;

class shop
{
    int sp,cp,p;
public:
    void in()
    {
        cout<<"Enter the cost price:     ";
        cin>>cp;
        cout<<"Enter the selling price:  ";
        cin>>sp;
    }

    void calc()
    {
        p=sp-cp;
        if(p>=0)
        {
         cout<<"You made a profit of "<<p<<"$";
        }
        else
        {
            cout<<"You lost "<<p*(-1)<<"$ in this business";
        }
    }
};

int main(void)
{
    shop s;
    s.in();
    s.calc();
    cout<<endl;
}


Hacking lec: 2 Change windows XP product key without reinstallation


Change Windows XP Product Key Without Re-Installation

Change Windows XP Product KeySometimes it becomes necessary to change the product key of Windows XP, but by default XP doesn’t provide any option to do that. As a result, many people may decide to re-install the operating system itself which is often a tedious and time consuming task .
However, here is a small hack using which it is possible to change the Windows XP product key without the need for re-installing it. This makes it possible to input a new product key and make your OS genuine. Here is a step-by-step procedure:
  1. Open the Registry editor (Go to Start menu -> Run -> type regeditand hit Enter).
  2. In the Registry editor navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION\WPA EVENTS
  3. In the right-side panel open “OOBE Timer”
  4. Edit/Change at least one entry there, press OK and close registry editor. This will temporarily deactivate your Windows.
    Deactivate Windows





















  5. 5. In “Run” type the following command and press Enter:
    %systemroot%\system32\oobe\msoobe /a
  6. Activation wizard appears as follows:
    Windows Activation Wizard



















  7. 7.Select the option “activation by phone” and click on “Next”. In the next page click on “CHANGE   PRODUCT KEY” button, enter a new valid product key, press OK and close the wizard.

    Activate by Phone




















  8. 8. Reboot the computer. After the restart type the same command (as shown in step-5) in the “Run” box.
  9. Activation wizard appears again and it shows the messageWINDOWS IS ALREADY ACTIVATED.




















That’s it! You have now successfully changed the product key of your Windows XP computer.