diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..88c7fbc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/Installers
diff --git a/FPC4/build.xml b/FPC4/build.xml
deleted file mode 100644
index 854da90..0000000
--- a/FPC4/build.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
- * Buffers compiled code in memory while behaving like a FileObject to the JavaCompiler. - *- */ -public class CompiledCode extends SimpleJavaFileObject { - - ByteArrayOutputStream os; - - public CompiledCode(String className) throws URISyntaxException { - super( new URI(className), Kind.CLASS ); - os = new ByteArrayOutputStream(); - } - - @Override - public OutputStream openOutputStream() throws IOException { - return os; - } - - @Override - public boolean delete() { - try { - os.close(); - } catch( Exception ex ) {} - os = null; - return true; - } - - public byte[] getbytes() { - return os.toByteArray(); - } -} \ No newline at end of file diff --git a/FPC4/src/TemplateEngine/Compiler/FPCompiler.java b/FPC4/src/TemplateEngine/Compiler/FPCompiler.java deleted file mode 100644 index e09039d..0000000 --- a/FPC4/src/TemplateEngine/Compiler/FPCompiler.java +++ /dev/null @@ -1,129 +0,0 @@ -package TemplateEngine.Compiler; - -import TemplateEngine.Data.FunctionalOperation; - -import javax.tools.*; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Created by BESTDOG on 11/23/2015. - * - * Manages compilation of SourceCode by ClassName. - * Allows classes to be unloaded with {@link IsolatedClassLoader}. - */ -public class FPCompiler { - - final JavaCompiler javac; - IsolatedClassLoader loader; - - private static FPCompiler self; - - public FPCompiler() { - findTools(); - javac = ToolProvider.getSystemJavaCompiler(); - if (FPCompiler.self == null) { - this.self = this; - } - } - - public static FPCompiler getCompiler() { - return self; - } - - /** - * Compiles a {@link SourceCode} java-code file and loads it into an {@link IsolatedClassLoader} so it may be unloaded - * from the JVM. - * @param sourceCode SourceCode to compile. - * @return true on successful compilation, else false. - */ - public boolean compile(SourceCode sourceCode) { - boolean res = false; - CompiledCode cc = null; - - if(javac == null) { - Logger.getLogger(getClass().getName()).log(Level.SEVERE, "JavaCompiler is unavailable."); - } else try { - cc = new CompiledCode(sourceCode.getClassName()); - - Iterable
- * Classloader for Fingerprints and Detect interfaces. - * A classloader is created for each fingerprint so that it may be deleted. - * Loading a class into the system class loader means that class cannot be unloaded without unloading every other class. - * A class can only be unloaded by removing all references to it's classLoader, this is why we use {@link IsolatedClassLoader}. - *- */ -public class IsolatedClassLoader extends ClassLoader { - - final HashMap
- * Used by the JavaCompiler to proxy the transition of SourceCode to CompiledCode objects. - * Helps the determine (when used by javac) to locate the compiled-code files in memory, vs on disk. - *- */ -public class IsolatedJavaFileManager extends ForwardingJavaFileManager
- * Used to intermediatly buffer source code as a JavaFileObject before it is compiled into a CompiledCode object. - *- */ -public class SourceCode extends SimpleJavaFileObject { - final String source; - private String className; - - /** - * By creating a URI to the default-java String pool we load our source files into memory, vs on disk. - * We can then read them as files with {@link ByteArrayInputStream}. - * @param className Name of contained class. - * @param source Contents of the source code. - */ - public SourceCode(String className, String source) { - super( URI.create("string:///"+className.replace('.','/')+Kind.SOURCE.extension), Kind.SOURCE ); - this.source = source; - this.className = className; - } - - public String getClassName() { - return this.className; - } - - @Override - public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { - return source; - } -} diff --git a/FPC4/src/TemplateEngine/Data/Cursor.java b/FPC4/src/TemplateEngine/Data/Cursor.java deleted file mode 100644 index f5aed9f..0000000 --- a/FPC4/src/TemplateEngine/Data/Cursor.java +++ /dev/null @@ -1,19 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - * - * Simple cursor implementation with three index. - * - * Three indexes is the minimal amount of cursors required to to exacting field extraction. - */ -public interface Cursor { - int getA(); - int getB(); - int get(); - void setA(int i); - void setB(int i); - void set(int i); - void forward(int i); - void reset(); -} diff --git a/FPC4/src/TemplateEngine/Data/Filter.java b/FPC4/src/TemplateEngine/Data/Filter.java deleted file mode 100644 index d1ac083..0000000 --- a/FPC4/src/TemplateEngine/Data/Filter.java +++ /dev/null @@ -1,69 +0,0 @@ -package TemplateEngine.Data; - -/** - * Created by BESTDOG on 11/24/2015. - *
- * Interface for filter ethernet header data.
- */
-public interface Filter
- * Interface to be used for the buffer parameter.
- */
-public interface PseudoBuffer {
- /**
- * @param index Index to get a byte from.
- * @return Byte at the provided index.
- */
- byte getByte(int index);
-
- /**
- * Retrieves a byte array with a maximum length and optionally reversed order.
- * @param index Start index to copy from.
- * @param array byte[] to write to.
- * @param offset Offset from the start index.
- * @param length maximum length of the copy, actual copied size may be less.
- * @param flip Reverses bytes if true, else NBO.
- * @return Reference to the copied byte array.
- */
- byte[] getByteArray(int index, byte[] array, int offset, int length, boolean flip);
-
- /**
- * Retrieves a byte array with a maximum length and always in NBO.
- * @param index Start index to copy from.
- * @param array byte[] to write to.
- * @param offset Offset from the start index.
- * @param length maximum length of the copy, actual copied size may be less.
- * @return Reference to the copied byte array.
- */
- byte[] getByteArray(int index, byte[] array, int offset, int length);
-
- /**
- * Creates a copy at the offset with the length provided, or less if end of buffer is reached.
- * @param offset Start index to copy from.
- * @param length Length in bytes to copy.
- * @return A new byte[] with the copied bytes.
- */
- byte[] getByteArray(int offset, int length);
-
- /**
- * Gets an int at the offset and optionally reverses byte order, see {@link Integer#BYTES}.
- * @param offset Start index to copy from.
- * @param isNetByteOrder Reverses bytes if true, else NBO.
- * @return Integer at the offset.
- */
- int getInt(final int offset, boolean isNetByteOrder);
-
- /**
- * Gets an int at the offset and optionally reverses byte order, see {@link Integer#BYTES}.
- * @param offset Start index to copy from.
- * @param length Length of bytes to read, may be less then 4 and converted to an int.
- * @param isNetByteOrder Reverses bytes if true, else NBO.
- * @return Integer at the offset.
- */
- int getInt(final int offset, int length, boolean isNetByteOrder);
-
- /**
- * Gets a String constructed from the bytes at the given offset.
- * @param offset Start index to copy from.
- * @param length Length of bytes to read.
- * @return UTF-8 string equivalent.
- */
- String getString(int offset, int length);
-
- /**
- * Returns the first string from the buffer which matches the Pattern.
- * @param pattern Pattern to search for.
- * @return First matching sub-string.
- */
- String match(Pattern pattern);
-
- /**
- * Returns the first string from the buffer within the bounds of offset and length which matches the Pattern.
- * @param pattern Pattern to search for.
- * @param offset Start index to search from.
- * @param length Length of bytes to read.
- * @return First matching sub-string.
- */
- String match(Pattern pattern, int offset, int length);
-
- /**
- * Searches for the byte sequence within the payload within the bounds of offset and length.
- * @param search byte[] to match.
- * @param offset Start index to search from.
- * @param length Length of bytes to read.
- * @return Beginning index in the buffer where the search sequence was a complete match, else -1 on failure.
- */
- int match(byte[] search, int offset, int length);
-
- /**
- * Checks if an integer is at a given byte offset.
- * @param offset Start index to search from.
- * @param compareTo Integer to compare to.
- * @return
- */
- boolean match(int offset, int compareTo);
-
- /**
- * Copies bytes `from an index `to an index with a maximum `length.
- * @param from Start index to search from.
- * @param to End index to search To.
- * @param length Maximum length, actual returned byte[] may be less then or equal to this length.
- * @return Copy of the bytes within the provided bounds.
- */
- byte[] extract(final int from, final int to, int length);
-
- /**
- * Same as {@link #extract(int, int, int)} but will flip the byte order.
- * @param from Start index to search from.
- * @param to End index to search To.
- * @param length Maximum length, actual returned byte[] may be less then or equal to this length.
- * @return Copy of the bytes within the provided bounds.
- */
- byte[] extractLittle(final int from, final int to, final int length);
-
- /**
- * @return Last addressable index within the buffer. ({@link #size()} - 1)
- */
- int end();
-
- /**
- * @return Size as returned by the buffer.
- */
- int size();
-
- /**
- * @return Entire buffer dumped to a hex-string.
- */
- String toHexdump();
-
-}
diff --git a/FPC4/src/TemplateEngine/Data/PseudoDetails.java b/FPC4/src/TemplateEngine/Data/PseudoDetails.java
deleted file mode 100644
index 90c7777..0000000
--- a/FPC4/src/TemplateEngine/Data/PseudoDetails.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package TemplateEngine.Data;
-
-import ICSDefines.Category;
-import ICSDefines.Direction;
-import ICSDefines.Role;
-
-/**
- * Created by BESTDOG on 11/24/2015.
- *
- * Interface for the methods which extract data from fingerprinting.
- */
-public class PseudoDetails extends LateBindingMap {
-
- public PseudoDetails() {
- }
-
- public void setCategory(Category category) {
- }
-
- public void setCategory(Category category, boolean setIfUnknown) {
- }
-
- public void setCountry(String country) {
- }
-
- public void setConfidence(Integer confidence) {
- }
-
- public void setDirection(Direction direction) {
- }
-
- public void putName(String name) {
- }
-
- public void setRole(Role role) {
- }
-
-}
diff --git a/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java b/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java
deleted file mode 100644
index 54cefaf..0000000
--- a/FPC4/src/TemplateEngine/Fingerprint3/Anchor.java
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
-// See http://java.sun.com/xml/jaxb
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2015.11.30 at 07:14:15 AM EST
-//
-
-
-package TemplateEngine.Fingerprint3;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * Java class for Anchor complex type.
- *
- * The following schema fragment specifies the expected content contained within this class.
- *
- * Java class for anonymous complex type.
- *
- * The following schema fragment specifies the expected content contained within this class.
- *
- *
- * <complexType name="Anchor">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute ref="{}Cursor use="required""/>
- * <attribute ref="{}Position"/>
- * <attribute ref="{}Relative"/>
- * <attribute ref="{}Offset"/>
- * </restriction>
- * </complexContent>
- * </complexType>
- *
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "Anchor")
-public class Anchor {
-
- @XmlAttribute(name = "Cursor", required = true)
- protected Cursor cursor;
- @XmlAttribute(name = "Position")
- protected Position position;
- @XmlAttribute(name = "Relative")
- protected Boolean relative;
- @XmlAttribute(name = "Offset")
- protected Integer offset;
-
- /**
- * Gets the value of the cursor property.
- *
- * @return
- * possible object is
- * {@link Cursor }
- *
- */
- public Cursor getCursor() {
- return cursor;
- }
-
- /**
- * Sets the value of the cursor property.
- *
- * @param value
- * allowed object is
- * {@link Cursor }
- *
- */
- public void setCursor(Cursor value) {
- this.cursor = value;
- }
-
- /**
- * Gets the value of the position property.
- *
- * @return
- * possible object is
- * {@link Position }
- *
- */
- public Position getPosition() {
- return position;
- }
-
- /**
- * Sets the value of the position property.
- *
- * @param value
- * allowed object is
- * {@link Position }
- *
- */
- public void setPosition(Position value) {
- this.position = value;
- }
-
- /**
- * Gets the value of the relative property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
- */
- public boolean isRelative() {
- if (relative == null) {
- return false;
- } else {
- return relative;
- }
- }
-
- /**
- * Sets the value of the relative property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
- */
- public void setRelative(Boolean value) {
- this.relative = value;
- }
-
- /**
- * Gets the value of the offset property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getOffset() {
- return offset;
- }
-
- /**
- * Sets the value of the offset property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setOffset(Integer value) {
- this.offset = value;
- }
-
-}
diff --git a/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java b/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java
deleted file mode 100644
index 4cc6593..0000000
--- a/FPC4/src/TemplateEngine/Fingerprint3/AndThen.java
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
-// See http://java.sun.com/xml/jaxb
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2015.11.30 at 07:14:15 AM EST
-//
-
-
-package TemplateEngine.Fingerprint3;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- *
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{}Operation"/>
- * </restriction>
- * </complexContent>
- * </complexType>
- *
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "matchOrByteTestOrIsDataAt"
-})
-@XmlRootElement(name = "AndThen")
-public class AndThen {
-
- @XmlElements({
- @XmlElement(name = "Match", type = MatchFunction.class),
- @XmlElement(name = "ByteTest", type = ByteTestFunction.class),
- @XmlElement(name = "IsDataAt", type = IsDataAtFunction.class),
- @XmlElement(name = "ByteJump", type = ByteJumpFunction.class),
- @XmlElement(name = "Anchor", type = Anchor.class),
- @XmlElement(name = "Return", type = Return.class)
- })
- protected List