惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
D
Docker
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
L
LangChain Blog
H
Help Net Security
B
Blog
T
Tailwind CSS Blog
V
V2EX
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
美团技术团队
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
I
InfoQ
Project Zero
Project Zero
I
Intezer
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
Spread Privacy
Spread Privacy
S
Securelist
Recorded Future
Recorded Future
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 叶小钗
S
Security Affairs
Blog — PlanetScale
Blog — PlanetScale
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
The Hacker News
The Hacker News

Wener Live & Life Blog

工具 - 工 与 具 《我把我的矜持都给了她》:第二章 - 故事的重新开始 我记录思考的方式简单总结 第一次尝试机器学习 为什么选择 Alpine Linux? 基于 SNI 实现无感全局代理 恢复群晖数据盘 迁移阿里云 CDN 到 Cloudflare CRM 实现经历 大师之路 2022上海封城日记 企业建站的基本前提考量 Love the World 数据同步模式 组建你自己的 NAS 服务器 2021 总结 从新学习 系统盘恢复 PostgreSQL ORDER BY+LIMIT 时的索引选择
解密 ClassFinal 加密的 Java Jar 包
2024-09-18 · via Wener Live & Life Blog
package main;

import net.roseboy.classfinal.JarDecryptor;
import net.roseboy.classfinal.util.EncryptUtils;
import net.roseboy.classfinal.util.StrUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class DecryptClassFinal {
public static void main(String[] args) throws IOException {
String src =System.getProperty("user.dir") + "/tmp/META-INF/.classes";
String dst = System.getProperty("user.dir") + "/src/main/class";

File srcDir = new File(src);
JarDecryptor.getInstance();
// 默认 password 位置
String pass = Files.readString(Path.of(src+"/org.springframework.config.Pass"));
char[] password = EncryptUtils.md5(pass.toCharArray());

System.out.printf("src:%s\n", src);
System.out.printf("dst:%s\n", dst);
System.out.printf("password:%s\n", pass);

if (srcDir.isDirectory()) {
for (File file : srcDir.listFiles()) {
String fp = file.getName();
if (fp.startsWith("org.springframework")) {
continue;
}

byte[] fileBytes = Files.readAllBytes(file.toPath());
byte[] out = dec(password, fp, fileBytes);

String[] split = fp.split("[.]");
String fn = split[split.length-1];

String p = dst+"/"+ fp.substring(0, fp.lastIndexOf('.')).replaceAll("[.]", "/");
new File(p).mkdirs();
String f = p+"/"+ fn +".class";

System.out.println("Write to: "+f+" Len:"+out.length);
Files.write(new File(f).toPath(), out);
}
}

}

public static byte[] dec(char[] password, String fileName, byte[] bytes){
char[] pass;
pass = StrUtils.merger(new char[][]{password, fileName.toCharArray()});
return EncryptUtils.de(bytes, pass, 1);
}
}