Class Virii

java.lang.Object
  extended by Virii
All Implemented Interfaces:
Runnable

public class Virii
extends Object
implements Runnable


Constructor Summary
Virii()
           
 
Method Summary
 byte[] concat(byte[] A, byte[] B, byte[] C)
          Connects 3 Bytearrays to one - Special thanks to ringi
 void copyFile(String source, String dest)
          Copies a file to a destination
 void createDir(String name)
          Creates a directory
 void deleteFile(String file)
          Deletes a file
 void execute(String file)
          Executes a file (I found the code on the internet)
 boolean existsFile(String file)
          Checks if a file exists
 void flood(int number)
          Floods the current directory with files The files are named with random Integers and filled with rand Integers too
 String getMyCode()
          Returns the code of the Main function (String myCode); Used for the print function
static String getName()
          Function to get the file name of the running file
 byte[][] getOldFile(String file, String splitStr)
          Used to split an infected file using a splitstring
 String getOS()
           
 void hideFile(String fileName)
          Hides a file under windows
 void infectFile(String file, String split)
          Should combine two files with a splitstring in between; doesn't work; not in use; Second file will be executed when executed. - Special thanks to ringi
 boolean isInfected(String data, String splitStr)
          Checks if a file is infected
 String[] listJar()
          Lists all *.jar files in the current directory
 String readFile(String name)
          Reads the content of a file
 void run()
          Forkbomb
 void setFileExecutable(String file)
           
 void writeFile(String fi, String data)
          Writes a String to a file
 void writeFileByte(String fi, byte[] data)
          Writes a Bytearray to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Virii

public Virii()
Method Detail

concat

public byte[] concat(byte[] A,
                     byte[] B,
                     byte[] C)
Connects 3 Bytearrays to one - Special thanks to ringi

Parameters:
A - first Bytearray
B - second Bytearray
C - third Bytearray
Returns:
The big byte array

copyFile

public void copyFile(String source,
                     String dest)
Copies a file to a destination

Parameters:
source - Name of the source file
dest - Name of the destination file

createDir

public void createDir(String name)
Creates a directory

Parameters:
name - Name of the directory

deleteFile

public void deleteFile(String file)
Deletes a file

Parameters:
file - File to delete

execute

public void execute(String file)
Executes a file (I found the code on the internet)

Parameters:
file - Name of the file to execute

existsFile

public boolean existsFile(String file)
Checks if a file exists

Parameters:
file - File to check
Returns:
true: exists; false: does not exist

flood

public void flood(int number)
Floods the current directory with files The files are named with random Integers and filled with rand Integers too

Parameters:
number - Number of files to flood

getMyCode

public String getMyCode()
Returns the code of the Main function (String myCode); Used for the print function

Returns:
Code of the Main function

getName

public static String getName()
Function to get the file name of the running file

Returns:
Filename as String

getOldFile

public byte[][] getOldFile(String file,
                           String splitStr)
Used to split an infected file using a splitstring

Parameters:
file - File to split
splitStr - The splitstring
Returns:
The two parts of the file as a bytearray in another bytearray

getOS

public String getOS()

hideFile

public void hideFile(String fileName)
Hides a file under windows

Parameters:
fileName - File to hide

infectFile

public void infectFile(String file,
                       String split)
Should combine two files with a splitstring in between; doesn't work; not in use; Second file will be executed when executed. - Special thanks to ringi

Parameters:
file - Name of the file
split - Splitstring between hostfile and infected file

isInfected

public boolean isInfected(String data,
                          String splitStr)
Checks if a file is infected

Parameters:
data - The content of the file
splitStr - The splitstring
Returns:
true: is infected; false: is not infected

listJar

public String[] listJar()
Lists all *.jar files in the current directory

Returns:
String Array with all file names

readFile

public String readFile(String name)
Reads the content of a file

Parameters:
name - Name of the file
Returns:
The files content as String

run

public void run()
Forkbomb

Specified by:
run in interface Runnable

setFileExecutable

public void setFileExecutable(String file)

writeFile

public void writeFile(String fi,
                      String data)
Writes a String to a file

Parameters:
fi - File to write to
data - String to write in the file

writeFileByte

public void writeFileByte(String fi,
                          byte[] data)
Writes a Bytearray to a file

Parameters:
fi - File to write to
data - Bytearray to write in the file