Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4x: Starting to flesh out SSVM integration #718

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def asmVersion = '9.5'
def cafeDudeVersion = '1.10.2'
def junitVersion = '5.9.2'
def ssvmVersion = '4030675074'

project.ext {
asm = "org.ow2.asm:asm:$asmVersion"
Expand Down Expand Up @@ -64,5 +65,9 @@ project.ext {

richtextfx = 'org.fxmisc.richtext:richtextfx:0.11.1'

ssvm_core = "com.github.xxDark.SSVM:ssvm-core:$ssvmVersion"
ssvm_invoke = "com.github.xxDark.SSVM:ssvm-invoke:$ssvmVersion"
ssvm_io = "com.github.xxDark.SSVM:ssvm-io:$ssvmVersion"

treemapfx = 'software.coley:treemap-fx:1.1.0'
}
3 changes: 3 additions & 0 deletions recaf-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ dependencies {
api jlinker
api openrewrite
api regex
api ssvm_core
api ssvm_invoke
api ssvm_io
}

// Force generation of gversion data class when the version information is not up-to-date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public final class ConfigGroups {
* Group for debug/attach components.
*/
public static final String SERVICE_DEBUG = SERVICE + PACKAGE_SPLIT + "debug";
/**
* Group for deobfuscation components.
*/
public static final String SERVICE_DEOBFUSCATION = SERVICE + PACKAGE_SPLIT + "deobfuscation";
/**
* Group for decompiler components.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package software.coley.recaf.services.ssvm;

import software.coley.recaf.services.Service;

public interface VirtualInvoker extends Service {
String SERVICE_ID = "virtual-invoker";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package software.coley.recaf.services.ssvm;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import software.coley.recaf.config.BasicConfigContainer;
import software.coley.recaf.config.ConfigGroups;
import software.coley.recaf.services.ServiceConfig;

/**
* Config for {@link VirtualInvoker}
*
* @author Matt Coley
*/
@ApplicationScoped
public class VirtualInvokerConfig extends BasicConfigContainer implements ServiceConfig {
@Inject
public VirtualInvokerConfig() {
super(ConfigGroups.SERVICE_DEOBFUSCATION, VirtualInvoker.SERVICE_ID + CONFIG_SUFFIX);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package software.coley.recaf.services.ssvm;

import software.coley.recaf.services.Service;


public interface VirtualOptimizer extends Service {
public static String SERVICE_ID = "virtual-optimizer";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package software.coley.recaf.services.ssvm;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import software.coley.recaf.config.BasicConfigContainer;
import software.coley.recaf.config.ConfigGroups;
import software.coley.recaf.services.ServiceConfig;

/**
* Config for {@link VirtualOptimizer}
*
* @author Matt Coley
*/
@ApplicationScoped
public class VirtualOptimizerConfig extends BasicConfigContainer implements ServiceConfig {
@Inject
public VirtualOptimizerConfig() {
super(ConfigGroups.SERVICE_DEOBFUSCATION, VirtualOptimizer.SERVICE_ID + CONFIG_SUFFIX);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package software.coley.recaf.services.ssvm;

import jakarta.annotation.Nonnull;

/**
* Thrown when the VM is not available for operations in {@link VirtualInvoker} and {@link VirtualOptimizer}.
*
* @author Matt Coley
*/
public class VmUnavailableException extends Exception {
/**
* @param message
* Additional details.
* @param cause
* Cause for the VM to not be available. Likely due to an error in initialization.
*/
public VmUnavailableException(@Nonnull String message, @Nonnull Throwable cause) {
super(message, cause);
}

/**
* @param message
* Additional details.
*/
public VmUnavailableException(@Nonnull String message) {
super(message);
}

/**
* @param cause
* Cause for the VM to not be available. Likely due to an error in initialization.
*/
public VmUnavailableException(@Nonnull Throwable cause) {
super(cause);
}
}
Loading
Loading