Repository: f1tz/BCELCodeman
Branch: main
Commit: 8eecb2227d54
Files: 4
Total size: 3.6 KB
Directory structure:
gitextract_b32o8_r2/
├── BCELCodeman.iml
├── META-INF/
│ └── MANIFEST.MF
├── README.md
└── src/
└── Main.java
================================================
FILE CONTENTS
================================================
================================================
FILE: BCELCodeman.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
================================================
FILE: META-INF/MANIFEST.MF
================================================
Manifest-Version: 1.0
Main-Class: Main
================================================
FILE: README.md
================================================
# BCELCodeman
> 初次使用Java编写工具,由于网上找到的编码/解码工具不是很顺手,才制作了这款工具,功能比较单一,就做一件事情BCEL编码/解码。
> 其实工具是在护网期间做攻击溯源的过程中写的,目的是为了分析攻击者使用的fastjson payload。
## How to use
> 主要功能就是将class文件编码为BCEL编码,或将BCEL编码还原为class,从而可以反编译出java源码。
> 使用Decode功能会自动在当前目录下生成**Decoded.class**, 由于BCEL编码存在$符号,请使用***单引号***对代码进行包裹
```shell
Decode:
java -jar BCELCodeman.jar d [BCEL_CODE]
Encode:
java -jar BCELCodeman.jar e [Class_Filepath]
```

解码后的class可以拖入IDEA进行反编译,对比原始java代码效果如下

================================================
FILE: src/Main.java
================================================
import com.sun.org.apache.bcel.internal.classfile.Utility;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
String helpMsg = "---------Example---------\n"
+ "Decode:\n"
+ "java -jar BCELCodeman.jar d [BCEL_CODE]\n"
+ "Encode:\n"
+ "java -jar BCELCodeman.jar e [Class_Filepath]\n\n"
+ " -=Coding By F1tz=-";
try{
switch (args[0]){
case "d" :
String bcelCode = args[1];
decode(bcelCode);
break;
case "e" :
String classPath = args[1];
encode(classPath);
break;
default :
System.out.println(helpMsg);
}
}catch (Exception e){
System.out.println(helpMsg);
return;
}
}
public static void decode(String cdata){
String path = "./Decoded.class";
if(cdata.startsWith("$$BCEL$$")){
cdata = cdata.substring(8);
}
String cryptdata= cdata;
FileOutputStream fos = null;
FileChannel channel = null;
try {
fos = new FileOutputStream(path);
channel = fos.getChannel();
byte[] array = Utility.decode(cryptdata,true);
ByteBuffer buffer = ByteBuffer.wrap(array);
channel.write(buffer);
System.out.println("[*] Decode BCELcode successfully, find Class file in ./Decoded.class");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
channel.close();
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void encode(String Classpath) {
Path path = Paths.get(Classpath);
try {
byte[] data = Files.readAllBytes(path);
String s = Utility.encode(data, true);
System.out.println("$$BCEL$$" + s);
System.out.println("\n[*] Encode BCELcode successfully. Have fun :)");
}catch (IOException e){
e.printStackTrace();
}
}
}
gitextract_b32o8_r2/
├── BCELCodeman.iml
├── META-INF/
│ └── MANIFEST.MF
├── README.md
└── src/
└── Main.java
SYMBOL INDEX (4 symbols across 1 files)
FILE: src/Main.java
class Main (line 12) | public class Main {
method main (line 13) | public static void main(String[] args) {
method decode (line 39) | public static void decode(String cdata){
method encode (line 68) | public static void encode(String Classpath) {
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5K chars).
[
{
"path": "BCELCodeman.iml",
"chars": 433,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<module type=\"JAVA_MODULE\" version=\"4\">\r\n <component name=\"NewModuleRootManager"
},
{
"path": "META-INF/MANIFEST.MF",
"chars": 43,
"preview": "Manifest-Version: 1.0\r\nMain-Class: Main\r\n\r\n"
},
{
"path": "README.md",
"chars": 527,
"preview": "# BCELCodeman\n\n> 初次使用Java编写工具,由于网上找到的编码/解码工具不是很顺手,才制作了这款工具,功能比较单一,就做一件事情BCEL编码/解码。\n\n> 其实工具是在护网期间做攻击溯源的过程中写的,目的是为了分析攻击者使"
},
{
"path": "src/Main.java",
"chars": 2713,
"preview": "import com.sun.org.apache.bcel.internal.classfile.Utility;\r\n\r\nimport java.io.FileNotFoundException;\r\nimport java.io.File"
}
]
About this extraction
This page contains the full source code of the f1tz/BCELCodeman GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (3.6 KB), approximately 1.1k tokens, and a symbol index with 4 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.