Some thinking about execution
This commit is contained in:
19
src/main/java/info/sigterm/deob/execution/Execution.java
Normal file
19
src/main/java/info/sigterm/deob/execution/Execution.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package info.sigterm.deob.execution;
|
||||
|
||||
import info.sigterm.deob.ClassGroup;
|
||||
import info.sigterm.deob.pool.Method;
|
||||
|
||||
public class Execution
|
||||
{
|
||||
private ClassGroup group;
|
||||
private java.util.Stack<Frame> frames = new java.util.Stack<Frame>();
|
||||
|
||||
public Execution(ClassGroup group)
|
||||
{
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public void run(Method method, Object... args)
|
||||
{
|
||||
}
|
||||
}
|
||||
23
src/main/java/info/sigterm/deob/execution/Frame.java
Normal file
23
src/main/java/info/sigterm/deob/execution/Frame.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package info.sigterm.deob.execution;
|
||||
|
||||
import info.sigterm.deob.Method;
|
||||
import info.sigterm.deob.attributes.Code;
|
||||
|
||||
public class Frame
|
||||
{
|
||||
private Execution execution;
|
||||
private Method method;
|
||||
private Stack stack;
|
||||
private Variables variables;
|
||||
|
||||
public Frame(Execution execution, Method method)
|
||||
{
|
||||
Code code = method.getCode();
|
||||
|
||||
this.execution = execution;
|
||||
this.method = method;
|
||||
|
||||
stack = new Stack(code.getMaxStack());
|
||||
variables = new Variables(code.getMaxLocals());
|
||||
}
|
||||
}
|
||||
28
src/main/java/info/sigterm/deob/execution/Stack.java
Normal file
28
src/main/java/info/sigterm/deob/execution/Stack.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package info.sigterm.deob.execution;
|
||||
|
||||
public class Stack
|
||||
{
|
||||
private int size;
|
||||
private Object[] stack;
|
||||
|
||||
public Stack(int sz)
|
||||
{
|
||||
stack = new Object[sz];
|
||||
}
|
||||
|
||||
public void push(Object obj)
|
||||
{
|
||||
if (size == stack.length)
|
||||
throw new RuntimeException("Stack overflow");
|
||||
|
||||
stack[size++] = obj;
|
||||
}
|
||||
|
||||
public Object pop()
|
||||
{
|
||||
if (size <= 0)
|
||||
throw new RuntimeException("Stack underflow");
|
||||
|
||||
return stack[--size];
|
||||
}
|
||||
}
|
||||
11
src/main/java/info/sigterm/deob/execution/Variables.java
Normal file
11
src/main/java/info/sigterm/deob/execution/Variables.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package info.sigterm.deob.execution;
|
||||
|
||||
public class Variables
|
||||
{
|
||||
private Object variables;
|
||||
|
||||
public Variables(int sz)
|
||||
{
|
||||
variables = new Object[sz];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user