SandMark version 2.1


sandmark.obfuscate.methodmadness
Class StaticSplit

java.lang.Object
  |
  +--sandmark.Algorithm
        |
        +--sandmark.obfuscate.GeneralObfuscator
              |
              +--sandmark.obfuscate.ClassObfuscator
                    |
                    +--sandmark.obfuscate.methodmadness.StaticSplit

public class StaticSplit
extends ClassObfuscator

Splits each nonstatic method of the class into a nonstatic method with the same name and signature as before, and a static method that contains the method body of the original method.

Used by Method2RMadness obfuscator.

Author:
Kelly Heffner (kheffner@cs.arizona.edu)

Field Summary
static boolean DEBUG
           
 
Constructor Summary
StaticSplit()
           
 
Method Summary
 void apply(ClassFileCollection cfc, java.lang.String classname)
          Modifies the given class file collection, class, and method so that the each method of the class is split into two parts.
 java.lang.String getAlgHTML()
          Returns an HTML description of this obfuscator.
 java.lang.String getAlgURL()
          Returns the URL at which you can find information about this obfuscator.
 java.lang.String getAuthor()
          Specifies the author of the algorithm.
 java.lang.String getAuthorEmail()
          Specifies the email address author of the algorithm.
 ConfigProperties getConfigProperties()
          Gets the ConfigProperties object which specifies the parameters for this run of the algorithm.
 java.lang.String getDescription()
          Specifies what this algorithm does, briefly.
 java.lang.String getLongName()
          Returns a long description of this obfuscator's name.
 ModificationProperty[] getMutations()
          Specifies the types of modifications that the algorithm makes.
 RequisiteProperty[] getPostsuggestions()
          Specifies a list of properties of algorithms that should be run on the target code after this algorithm is run, but are not necessary.
 java.lang.String getShortName()
          Returns a short description of this obfuscator's name.
static void main(java.lang.String[] args)
           
 void setConfigProperties(ConfigProperties props)
          Sets the ConfigProperties object which specifies the parameters for this run of the algorithm.
 void split(de.fub.bytecode.generic.MethodGen origMethEdit, de.fub.bytecode.generic.ClassGen classEdit, de.fub.bytecode.generic.ConstantPoolGen cpEdit)
           
 
Methods inherited from class sandmark.obfuscate.ClassObfuscator
toString
 
Methods inherited from class sandmark.Algorithm
getPostprohibited, getPostrequisites, getPreprohibited, getPrerequisites, getPresuggestions, getReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Constructor Detail

StaticSplit

public StaticSplit()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception

apply

public void apply(ClassFileCollection cfc,
                  java.lang.String classname)
           throws java.io.IOException
Modifies the given class file collection, class, and method so that the each method of the class is split into two parts. The first part is a nonstatic method with the same name and signature as the specified method. The second part is a static method with a unique name within the class that contains the method body of the original method. If this method is passed information about a static method, the method will not be modified.

Specified by:
apply in class ClassObfuscator
Parameters:
cfc - the collection of java classes dependent on this class
classname - the name of the class which contains the methods to change
java.io.IOException

split

public void split(de.fub.bytecode.generic.MethodGen origMethEdit,
                  de.fub.bytecode.generic.ClassGen classEdit,
                  de.fub.bytecode.generic.ConstantPoolGen cpEdit)

getAlgURL

public java.lang.String getAlgURL()
Returns the URL at which you can find information about this obfuscator.

Specified by:
getAlgURL in class Algorithm
Returns:
a URL to the help.html file for the algorithm

getAlgHTML

public java.lang.String getAlgHTML()
Returns an HTML description of this obfuscator.

Specified by:
getAlgHTML in class Algorithm
Returns:
an HTML formatted description of what the algorithm does.

getAuthor

public java.lang.String getAuthor()
Description copied from class: Algorithm
Specifies the author of the algorithm.

Overrides:
getAuthor in class Algorithm
Returns:
the name of the author of the algorithm

getAuthorEmail

public java.lang.String getAuthorEmail()
Description copied from class: Algorithm
Specifies the email address author of the algorithm.

Overrides:
getAuthorEmail in class Algorithm
Returns:
the email address of the author of the algorithm

setConfigProperties

public void setConfigProperties(ConfigProperties props)
Description copied from class: Algorithm
Sets the ConfigProperties object which specifies the parameters for this run of the algorithm.

Specified by:
setConfigProperties in class Algorithm
Parameters:
props - the parameters for this run of the algorithm

getDescription

public java.lang.String getDescription()
Description copied from class: Algorithm
Specifies what this algorithm does, briefly. This description is displayed to the user in the log of execution in Sandmark.

Overrides:
getDescription in class Algorithm
Returns:
a brief description of the algorithm

getMutations

public ModificationProperty[] getMutations()
Description copied from class: Algorithm
Specifies the types of modifications that the algorithm makes. For more information see ModificationProperty. NOTE: This method will be tagged abstract as of 06/05/2002; at that time, all Sandmark algorithms should provide their own implementation.

Overrides:
getMutations in class Algorithm
Returns:
a list of mutations that this algorithm may do on the code

getPostsuggestions

public RequisiteProperty[] getPostsuggestions()
Description copied from class: Algorithm
Specifies a list of properties of algorithms that should be run on the target code after this algorithm is run, but are not necessary. See RequisiteProperty for more details. This method should only be overridden if the algorithm has a nonempty set of post-suggestions.

Overrides:
getPostsuggestions in class Algorithm
Returns:
a list of suggested algorithm properties to run after this algorithm.

getConfigProperties

public ConfigProperties getConfigProperties()
Description copied from class: Algorithm
Gets the ConfigProperties object which specifies the parameters for this run of the algorithm.

Specified by:
getConfigProperties in class Algorithm
Returns:
the parameters for this run of the algorithm

getLongName

public java.lang.String getLongName()
Returns a long description of this obfuscator's name.

Specified by:
getLongName in class Algorithm
Returns:
the long name for this algorithm

getShortName

public java.lang.String getShortName()
Returns a short description of this obfuscator's name.

Specified by:
getShortName in class Algorithm
Returns:
the short name for this algorithm

SandMark version 2.1

Wed Jul 3 17:27:43 MST 2002