-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6af601c
commit 500fbe6
Showing
4 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
...mpl/src/test/java/uwu/narumi/deobfuscator/transformer/TestSandboxSecurityTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
package uwu.narumi.deobfuscator.transformer; | ||
|
||
import dev.xdark.ssvm.execution.VMException; | ||
import dev.xdark.ssvm.mirror.type.InstanceClass; | ||
import uwu.narumi.deobfuscator.api.asm.ClassWrapper; | ||
import uwu.narumi.deobfuscator.api.context.Context; | ||
import uwu.narumi.deobfuscator.api.execution.SandBox; | ||
import uwu.narumi.deobfuscator.api.transformer.Transformer; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
public class TestSandboxSecurityTransformer extends Transformer { | ||
@Override | ||
protected void transform(ClassWrapper scope, Context context) throws Exception { | ||
SandBox sandBox = context.getSandBox(); | ||
InstanceClass clazz = sandBox.getHelper().loadClass("sandbox.TestSandboxSecurity"); | ||
|
||
sandBox.getInvocationUtil().invokeInt( | ||
clazz.getMethod("test", "()I") | ||
); | ||
assertThrows(VMException.class, () -> { | ||
sandBox.getInvocationUtil().invokeInt( | ||
clazz.getMethod("test", "()I") | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters