FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Missing headers indicating the plugin type · pnfsoftware/jeb-samplecode@e53fe78 · GitHub

Repository navigation

Commit e53fe78

Browse files
committed
Missing headers indicating the plugin type
1 parent 00f34bf commit e53fe78

24 files changed

Lines changed: 501 additions & 47 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//?type=gendec-ast
2+
import com.pnfsoftware.jeb.core.Version;
3+
import com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer;
4+
5+
/**
6+
* A sample gendec AST optimizer plugin.
7+
*
8+
* @author Nicolas Falliere
9+
*
10+
*/
11+
public class COptSampleJava extends AbstractCOptimizer {
12+
13+
public COptSampleJava() {
14+
super();
15+
}
16+
17+
@Override
18+
public int perform() {
19+
logger.debug("COptSampleJava: the optimizer is running");
20+
return 0;
21+
}
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#?type=gendec-ast
2+
from com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt import AbstractCOptimizer
3+
4+
'''
5+
Skeleton for an Java Abstract Syntax Tree (AST) optimizer plugin for gendec, JEB's generic decompiler.
6+
This Python plugin is executed during the decompilation pipeline of a method.
7+
8+
How to use:
9+
- Drop this file in your JEB's coreplugins/scripts/ sub-directory
10+
- Make sure to have the setting `.LoadPythonPlugins = true` in your JEB's bin/jeb-engines.cfg file
11+
12+
For additional information regarding dexdec AST optimizer plugins, refer to:
13+
- the Manual (www.pnfsoftware.com/jeb/manual)
14+
- the API documentation: TODO
15+
'''
16+
class COptSamplePython(AbstractCOptimizer):
17+
# note: Python script optimizers are singleton instances!
18+
# the engine will instantiate and provide a single instance for all decompilation threads
19+
# therefore, if you are using object attributes, make sure to provide support for concurrency
20+
# (this restriction does not apply to Java script optimizers, as well as full-blown jar optimizers;
21+
# each decompilation thread has its own unique instance of such optimizer objects)
22+
# for this reason (as well as others), moderately complex AST optimizers should be written in Java
23+
24+
def __init__(self):
25+
self.logger.debug('COptSamplePython: instantiated')
26+
27+
def perform(self):
28+
self.logger.debug('COptSamplePython: executed')
29+
30+
# if a value >0 is returned, the decompiler will assume that AST is being transformed and this AST optimizer will be called again
31+
return 0 # no optimization is performed

‎plugins/scripts/DOptAdhocDESDecryption.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import java.util.List;
23

34
import javax.crypto.SecretKey;

‎plugins/scripts/DOptArrayInitCleanup.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer;
23
import com.pnfsoftware.jeb.core.units.code.android.ir.DexDecEvaluationException;
34
import com.pnfsoftware.jeb.core.units.code.android.ir.IDVisitor;

‎plugins/scripts/DOptCleanCondExpr.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer;
23
import com.pnfsoftware.jeb.core.units.code.android.ir.IDVisitor;
34
import com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression;

‎plugins/scripts/DOptCleanDoubleSwitchOnSameVar.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock;
23
import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer;
34
import com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression;

‎plugins/scripts/DOptEmuHooksExample.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#?type=dexdec-ir
12
from com.pnfsoftware.jeb.core.units.code.android.ir import AbstractDOptimizer, IDEmulatorHooks
23
'''
34
dexdec IR plugin showing how to set up an emulator hooks for internal dex methods.

‎plugins/scripts/DOptEmuHooksGlobalExample.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import java.util.List;
23

34
import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer;

‎plugins/scripts/DOptEmuSandboxHooksExample.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#?type=dexdec-ir
12
from com.pnfsoftware.jeb.core.units.code.android.ir import AbstractDOptimizer, IDSandboxHooks
23
from com.pnfsoftware.jeb.util.base import Wrapper
34
'''

‎plugins/scripts/DOptEvalFolder.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//?type=dexdec-ir
12
import com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock;
23
import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer;
34
import com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL