JetBrains 全家桶系列 2024 绿色

关于(JetBrains 2024)

JetBrains 是一家全球性软件公司,专门为软件开发者和团队打造可以提升工作效率的智能工具。总部位于捷克共和国布拉格,在多个国家/地区设有研发实验室和销售办事处。

环境

  • IDEA
  • JDK 17
  • jadx

逆向分析

JetBrains 全家桶系列 2024 绿色

这块过程,直接省略吧;
代码各种混淆 跟 加密; 着实看不下去;
就在一筹莫展之际, 突然发现一个可行的方案;

这里以 GoLand 为例, 当 系统检测到未授权时,会弹出一个 license 框;
并且这个框在你输入license 之前退不了;

此刻, 我就想, 我们能不能 注入一些代码, 开启一个线程来检测 该 license 窗口, 并且来修改窗口属性呢??

一开始我自己写了一个 class, 代码如下:

class WindowWatcher {
    static {
System.out.println(">>>>>>>     WindowWatcher");
    }
}

然后把编译后的 WindowWatcher.class 随便找了一个 JetBrains 依赖的 JAR 塞进去了;

  1. System.out.println(">>>>>>> WindowWatcher");
  2. Thread watcherThread = new Thread(() -> {
  3. while (watcherFlag) {
  4. try {
  5. // 每隔5秒执行一次遍历
  6. Thread.sleep(5000);
  7. Window[] windows = Window.getWindows();
  8. for (Window window : windows) {
  9. if (window instanceof JDialog dialog) {
  10. List<JButton> buttons = getButtons(dialog);
  11. for (JButton button : buttons) {
  12. String text = button.getText();
  13. // System.out.println("Button Text: " + text);
  14. dialog.setTitle("K'ed by: marlkiller");
  15. if (text != null && (text.contains("Quit") || text.contains("Close"))) {
  16. // dialog.setTitle(dialog.getTitle() + " 请点击["+text+"] 按钮");
  17. button.removeActionListener(button.getActionListeners()[0]);
  18. button.setText("<Close>");
  19. button.addActionListener(new ActionListener() {
  20. @Override
  21. public void actionPerformed(ActionEvent e) {
  22. watcherFlag = false;
  23. dialog.setVisible(false);
  24. }
  25. });
  26. }
  27. }
  28. }
  29. }
  30. } catch (InterruptedException e) {
  31. e.printStackTrace();
  32. }
  33. }
  34. });
  35. // 将线程设置为守护线程,随着主线程结束而结束
  36. watcherThread.setDaemon(true);
  37. watcherThread.start();

然后用命令后启动 GoLand;
发现打印的日志并没有我的 WindowWatcher;

不愧是 JetBrains, 想必 是用了自己写的类加载器, classLoader, 而且并不会加载 jar 包里所有的 class;

所有我们之前找 依赖里的 class 来反编译然后, 添加我们的 static 静态代码

  1. 复制代码 隐藏代码
  2.         System.out.println(">>>>>>>     WindowWatcher");
  3.         Thread watcherThread = new Thread(() -> {
  4.             while (watcherFlag) {
  5.                 try {
  6.                     // 每隔5秒执行一次遍历
  7.                     Thread.sleep(5000);
  8.                     Window[] windows = Window.getWindows();
  9.                     for (Window window : windows) {
  10.                         if (window instanceof JDialog dialog) {
  11.                             List<JButton> buttons = getButtons(dialog);
  12.                             for (JButton button : buttons) {
  13.                                 String text = button.getText();
  14.                                 // System.out.println("Button Text: " + text);
  15.                                 dialog.setTitle("K'ed by: marlkiller");
  16.                                 if (text != null && (text.contains("Quit") || text.contains("Close"))) {
  17.                                     // dialog.setTitle(dialog.getTitle() + " 请点击["+text+"] 按钮");
  18.                                     button.removeActionListener(button.getActionListeners()[0]);
  19.                                     button.setText("<Close>");
  20.                                     button.addActionListener(new ActionListener() {
  21.                                         @Override
  22.                                         public void actionPerformed(ActionEvent e) {
  23.                                             watcherFlag = false;
  24.                                             dialog.setVisible(false);
  25.                                         }
  26.                                     });
  27.                                 }
  28.                             }
  29.                         }
  30.                     }
  31.                 } catch (InterruptedException e) {
  32.                     e.printStackTrace();
  33.                 }
  34.             }
  35.         });
  36.         // 将线程设置为守护线程,随着主线程结束而结束
  37.         watcherThread.setDaemon(true);
  38.         watcherThread.start();

代码逻辑如下:
定时监测所有的窗口,
检测到 Licenses 窗口时 ,清除原始 Quit 按钮按钮的事件,
并且添加一个 close 当前 Dialog 的事件...

之后将class 覆盖, 然后重启app

之后会看到一个效果:

当弹出未授权窗口时, 点几 Quit 按钮, 该窗口就被隐藏了.....
之后我们正常打开项目即可..

JetBrains 全家桶系列 2024 绿色

大概是考虑到社区版,以及不同产品的兼容性;
所以除了启动窗口的时候, 没看到有别的地方有什么限制;

除此之外, 还有一个思路;
用 Agent 来动态修改 字节码文件,
但是目前的 class混淆加密严重,着实不知道 agent 改给哪些clz 挂钩哦

搞了个 shell 脚本,一键替换打包资源

  1. 复制代码 隐藏代码
    target_app="/Users/voidm/Applications/GoLand.app"
  2. rewrite_file="$(pwd)/../out/production/java_dev/com/jetbrains/ls/responses/License.class"
  3. rewrite_file2="$(pwd)/../out/production/java_dev/com/jetbrains/ls/responses/License\$1.class"
  4. echo "Changing directory to ${target_app}/Contents/lib"
  5. cd "${target_app}/Contents/lib"
  6. # 查找包含目标 Class 的 jar 包
  7. check_jar_for_class() {
  8.     local directory="$1"
  9.     local class_file="$2"
  10.     local found=false
  11.     for jar_file in "$directory"/*.jar; do
  12.         if jar tf "$jar_file" | grep -q "$class_file"; then
  13.             # 返回包含指定类文件的jar包名称
  14.             echo "$(basename "$jar_file")"
  15.             found=true
  16.             return
  17.         fi
  18.     done
  19.     # 如果未找到指定文件,则输出日志并退出
  20.     if ! $found; then
  21.         echo "target class_file not found" >&2
  22.         exit 1
  23.     fi
  24. }
  25. jar_name=$(check_jar_for_class "${target_app}/Contents/lib" "com/jetbrains/ls/responses/License.class")
  26. echo "target_jar is : $jar_name"
  27. jar_file="${target_app}/Contents/lib/${jar_name}"
  28. jar_file_back="${jar_file}_Backup"
  29. # 备份文件
  30. if [ ! -f "$jar_file_back" ];
  31. then
  32.     echo "Backing up $jar_file to $jar_file_back"
  33.     cp "$jar_file" "$jar_file_back"
  34. fi
  35. # 解压缩 Jar
  36. echo "Extracting ${jar_name}"
  37. jar -xvf ${jar_name} com/jetbrains/ls/responses/License.class
  38. # 替换文件
  39. cp -f ${rewrite_file} "./com/jetbrains/ls/responses/License.class"
  40. cp -f ${rewrite_file2} "./com/jetbrains/ls/responses/License\$1.class"
  41. # 重新打包
  42. echo "Compressing ${jar_name}"
  43. jar -uvf ${jar_name} "com/jetbrains/ls/responses/License.class"
  44. jar -uvf ${jar_name} "com/jetbrains/ls/responses/License\$1.class"
  45. # 清理临时文件
  46. rm -rf ./com

后记

人啊, 不能太闲; 太闲的时候就会胡闹,比如这个胡闹出来的思路.....
找工作真tm难..

仅供研究学习使用,请勿用于非法用途

郑重声明:

各位朋友,本网站本身不提供下载资源,以下资源地址均为网友整理提供,并且需离开本站,请各位网友谨慎选择,我站将不提供任何保障。另:如这些资源地址有违规或侵权行为,请联系66553826(@)qq.com,我方将在确认后第一时间断开链接。

吾爱破解

硬盘检测工具 CrystalDiskInfo v9.3.2 单文件版

2024-7-3 11:08:10

吾爱破解

管家婆辉煌版 SQL SERVER(2008 R2)安装教程及安装包

2024-7-3 11:24:14

0 条回复 A文章作者 M管理员
欢迎您,新朋友,感谢参与互动!
    暂无讨论,说说你的看法吧
搜索