SandMark version 2.0


sandmark
Class Scripting

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--sandmark.Scripting
All Implemented Interfaces:
java.lang.Runnable

public class Scripting
extends java.lang.Thread

Commands: * set PROPERTY VALUE Set the property value. The following property values can be set: "DWM_CT_AnnotatorClass" "DWM_CT_Encode_NodeType" "DWM_CT_Encode_ParentClass" "DWM_CT_Encode_ClassName" "DWM_CT_Encode_AvailableEdges" "DWM_CT_Encode_StoreWhat" "DWM_CT_Encode_StoreMethods" "DWM_CT_Encode_StoreLocation" "DWM_CT_Encode_ProtectionMethods" "DWM_CT_Encode_IndividualFixups" "DWM_CT_Encode_Encoding" one of "perm", "radix", ..., "*" "*" picks a random encoding method. "DWM_CT_Encode_Components" "DWM_CT_Encode_Package" "DWM_MaxTracePoints" "DWM_CT_Encode_StoreLocation" one of 'formal' or 'global' "DWM_CT_DumpIR" "DWM_ClassPath" * trace input.jar trace.tra MAINCLASS ARGUMENTS Run tracing. The classpath is set through the 'set DWM_ClassPath ...' command. Tracepoints are written to the trace.tra file. * embed input.jar output.jar watermark trace.tra Embed watermark in input.jar, creating output.jar. Read the tracepoints from trace.tra. * obfuscate input.jar output.jar Obfuscate input.jar, creating output.jar. * recognize input.jar watermark_count MAINCLASS ARGUMENTS Run recognition. The classpath is set through the 'set DWM_ClassPath ...' command. If the first non-blank character on a line is # the rest of the line is ignored. Commands are case insensitive, arguments are case sensitive.

Author:
Christian Collberg

Field Summary
(package private)  java.lang.String file
           
(package private)  SandMarkFrame frame
           
(package private)  java.util.Vector script
           
(package private) static Scripting scriptThread
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Scripting(SandMarkFrame frame, java.lang.String file)
           
 
Method Summary
(package private) static boolean check(java.lang.String[] instr, boolean wrong, java.lang.String error)
          if the 'error' argument is 'true' generate an error message that includes the offending line.
(package private) static boolean checkArgCount(java.lang.String[] instr, int min_count)
          Generate an error message if there aren't enough arguments.
 void run()
          The script is a a vector, one element per instruction.
static void runScript(SandMarkFrame frame, java.lang.String file)
          Run the script in 'file'.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

script

java.util.Vector script

frame

SandMarkFrame frame

scriptThread

static Scripting scriptThread

file

java.lang.String file
Constructor Detail

Scripting

public Scripting(SandMarkFrame frame,
                 java.lang.String file)
          throws java.lang.Exception
Method Detail

runScript

public static void runScript(SandMarkFrame frame,
                             java.lang.String file)
Run the script in 'file'. We run the script in its own thread in order not to block the input gui frame. We should really block user input (except for the DONE, buttons, etc., when needed) while the script is being run, but I don't know how to do that.

Parameters:
frame -
file -

run

public void run()
The script is a a vector, one element per instruction. Each element is an array of the tokens in the instruction. This routine runs each instruction. The first token in each instruction is the opcode.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

check

static boolean check(java.lang.String[] instr,
                     boolean wrong,
                     java.lang.String error)
if the 'error' argument is 'true' generate an error message that includes the offending line. If an error did occur, return true.

Parameters:
instr -
wrong -
error -

checkArgCount

static boolean checkArgCount(java.lang.String[] instr,
                             int min_count)
Generate an error message if there aren't enough arguments. If an error did occur, return true.

Parameters:
instr -
min_count -

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002