Files
ncmmiao/README.md
Lkhsss f1ee83bf79
Some checks failed
Release / Publish to Github Releases (, macos-latest, aarch64-apple-darwin, true) (push) Has been cancelled
Release / Publish to Github Releases (, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, aarch64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, arm-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, armv7-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, i686-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, x86_64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, aarch64-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, i686-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Release / Publish to crates.io (push) Has been cancelled
自动打印输出文件夹
2025-03-23 01:05:07 +08:00

83 lines
2.4 KiB
Markdown
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.

# NcmMiao :tada:
[![build](https://github.com/Lkhsss/NcmMiao/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/Lkhsss/NcmMiao/actions/workflows/build.yml)
一个使用Rust语言编写的ncm文件解密工具😆。
### 功能及特点
- 支持单一文件,多文件夹递归批量解密。
- 完善的日志功能
- Colorful
- 编译文件小,解密快
- 支持自动添加封面!
- 自动打开输出文件夹
- 简约美观
## 编译
```
cargo build -r
```
## 使用
支持单一文件,多文件夹递归批量解密。
```
ncmmiao [OPTIONS]
Options:
-w, --workers <WORKERS> 并发的最大线程数默认为8线程(性能还行的话建议直接32-64嘎嘎快)
-i, --input <输入文件/目录> 需要解密的文件夹或文件
-o, --output <输出目录> 输出目录 [default: NcmmiaoOutput]
-f, --forcesave 强制覆盖保存开关
-a, --autoopen 自动打开输出目录
```
~~输出文件夹在output。等我想写了再写命令行解析bushi。~~ 写了写了
---
# TODO :construction:
- [x] 多线程支持
- [x] 自动添加封面
- [x] 解密进度条
- [x] 命令行解析
- [x] 自定义输出文件夹
- [x] 计时功能
- [x] 自动覆盖开关
---
# [Changelog](CHANGELOG.md)
---
# 附 - ncm文件结构
|信息|大小|作用|
|:-:|:-:|:-:|
|Magic Header|8 bytes|文件头|
|Gap|2 bytes||
|Key Length|4 bytes|RC4密钥长度字节是按小端排序。|
|Key Data|Key Length|RC4密钥|
|Music Info Length|4 bytes|用AES128加密后的音乐相关信息的长度小端排序。|
|Music Info Data|Music Info Length|Json格式音乐信息数据。|
|Gap|5 bytes||
|CRC校验码|4 bytes|图片的CRC32校验码小端排序。|
|Image Size|4 bytes|图片的大小|
|Image Data|Image Size|图片数据|
|Music Data||音乐数据|
---
### Magic Header
### Key Data
用AES128加密后的RC4密钥。
1. 先按字节对0x64进行异或。
2. AES解密,去除填充部分。
3. 去除最前面'neteasecloudmusic'17个字节得到RC4密钥。
### Music Info Data
Json格式音乐信息数据。
1. 按字节对0x63进行异或。
2. 去除最前面22个字节。
3. Base64进行解码。
4. AES解密。
6. 去除前面6个字节后面数量为最后一个字节的字节数的垃圾数据得到Json数据。
### Music Data
1. RC4-KSA生成S盒。
2. 用S盒解密(自定义的解密方法)不是RC4-PRGA解密。