Files
Spine_lab/tools/fetch-ghidra.sh
T
tianmo 2e7ab7c33c 阶段四:Spine 3.8.99 编辑器里挂上自建视图面板
目标:在 Spine 编辑器窗口内部加一个自己的视图面板(按钮 + 文字显示),
点击读取场景对象,并像原生面板一样出现在 Views 菜单、可停靠可折叠。

本轮打通:
1. 编辑器在我们自己的进程里完整启动
   - 类加载器必须是 URLClassLoader 本身(自检要求)
   - Editor.main 必须在 AWT EDT 上调用
   - jvm.cfg 第 21 行要以两个空格结尾 + -DSpineJava
   - Editor.D:I 版本号、fonts/、/tzax 资源、Java8 版 launcher.Launcher 替身
2. 3.8.99 全量解密 → 可读源码
   - 字符串 17251/17461(伪造同名调用帧对齐 key)
   - 混淆动态派发还原 53871 处(调引导方法取 MemberName)
3. 自建视图
   - agent 在内存里给 us 枚举加 spineView 常量(不改磁盘,避开完整性自检)
   - 面板 Actor 由外部反射填进 us.spineView.D
   - 复用已有图标做别名(不新建图片资源)
   最终 "Spine View" 出现在 Views 菜单,可与 Tree 并排停靠、折叠展开

另外:
- ViewPatcher/ViewAgent:视图枚举与面板挂载的字节码插桩
- DecAll/ObMap/rewrite_source:字符串解密、派发还原、可读源码生成
- 阶段四-视图面板挂载.md:完整记录做法与踩过的坑

不纳入版本管理:rea/(独立仓库)、tools 下的 JDK/Ghidra 工具链、
Spine.app 与 spine-lab 副本、从载荷派生的批量产物。
2026-10-16 13:34:18 +08:00

35 lines
985 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/zsh
# 分块并行下载 Ghidra(GitHub release 单连接只有 ~150KB/s,多连接能快很多)。
set -e
URL="https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_12.1.4_build/ghidra_12.1.4_PUBLIC_20260921.zip"
TOTAL=569649598
PARTS=8
HERE="$(cd "$(dirname "$0")" && pwd)"
OUT="$HERE/ghidra.zip"
CHUNK=$(( (TOTAL + PARTS - 1) / PARTS ))
for index in $(seq 0 $((PARTS - 1))); do
start=$(( index * CHUNK ))
end=$(( start + CHUNK - 1 ))
(( end >= TOTAL )) && end=$(( TOTAL - 1 ))
part="$HERE/.ghidra.part$index"
have=0
[[ -f "$part" ]] && have=$(stat -f%z "$part")
want=$(( end - start + 1 ))
if (( have >= want )); then
echo "part$index 已完成 ($have)"
continue
fi
echo "part$index -> $(( have )) / $want"
curl -sL --max-time 1800 -r $(( start + have ))-$end -o "$part" "$URL" &
done
wait
echo "拼接"
: > "$OUT"
for index in $(seq 0 $((PARTS - 1))); do
cat "$HERE/.ghidra.part$index" >> "$OUT"
done
ls -la "$OUT"