Skip to content

Commit a786425

Browse files
committed
Not sure why Konloch put whis in the Todo list but here we go
1 parent 40a7815 commit a786425

File tree

68 files changed

+44
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+44
-6
lines changed

src/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@
4747
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameFields;
4848
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameMethods;
4949
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
50-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.CodeSequenceDiagram;
51-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter;
52-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowAllStrings;
53-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowMainMethods;
54-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZKMStringDecrypter;
55-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZStringArrayDecrypter;
50+
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.*;
5651

5752
import javax.swing.JSpinner;
5853
import javax.swing.SpinnerNumberModel;
@@ -299,6 +294,8 @@ public String getDescription() {
299294
public JMenuBar menuBar = new JMenuBar();
300295
public final JMenuItem mntmReplaceStrings = new JMenuItem(
301296
"Replace Strings");
297+
public final JMenuItem mntmStackFramesRemover = new JMenuItem(
298+
"StackFrames Remover");
302299
public final JMenuItem mntmNewMenuItem_4 = new JMenuItem("");
303300
public final JMenu mnNewMenu_3 = new JMenu("CFR");
304301
public final JMenu mnNewMenu_4 = new JMenu("Procyon");
@@ -2002,7 +1999,15 @@ public void actionPerformed(ActionEvent arg0) {
20021999
}
20032000
});
20042001

2002+
mntmStackFramesRemover.addActionListener(new ActionListener() {
2003+
@Override
2004+
public void actionPerformed(ActionEvent e) {
2005+
PluginManager.runPlugin(new StackFramesRemover());
2006+
}
2007+
});
2008+
20052009
mnNewMenu_1.add(mntmZstringarrayDecrypter);
2010+
mnNewMenu_1.add(mntmStackFramesRemover);
20062011

20072012
menuBar.add(mntmNewMenuItem_4);
20082013

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package the.bytecode.club.bytecodeviewer.plugin.preinstalled;
2+
3+
import org.objectweb.asm.tree.AbstractInsnNode;
4+
import org.objectweb.asm.tree.ClassNode;
5+
import org.objectweb.asm.tree.FrameNode;
6+
import org.objectweb.asm.tree.MethodNode;
7+
import the.bytecode.club.bytecodeviewer.api.Plugin;
8+
import the.bytecode.club.bytecodeviewer.api.PluginConsole;
9+
10+
import java.util.ArrayList;
11+
import java.util.concurrent.atomic.AtomicInteger;
12+
13+
public class StackFramesRemover extends Plugin {
14+
15+
@Override
16+
public void execute(ArrayList<ClassNode> classNodeList) {
17+
AtomicInteger counter = new AtomicInteger();
18+
PluginConsole frame = new PluginConsole("StackFrames Remover");
19+
for (ClassNode cn : classNodeList) {
20+
for (MethodNode mn : cn.methods) {
21+
for (AbstractInsnNode insn : mn.instructions.toArray()) {
22+
if (insn instanceof FrameNode) {
23+
mn.instructions.remove(insn);
24+
counter.incrementAndGet();
25+
}
26+
}
27+
}
28+
}
29+
30+
frame.appendText(String.format("Removed %s stackframes.", counter));
31+
frame.setVisible(true);
32+
}
33+
}

0 commit comments

Comments
 (0)