Git Product home page Git Product logo

ncmdump's Introduction

ncmdump's People

Contributors

s12mmm3 avatar taurusxin avatar wshon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ncmdump's Issues

MSVC Windows 版本不支持中文文件名

MSVC 编译 Windows 版本的 ncmdump 不支持中文文件名。如果通过直接输入给出文件名,出现如下异常

PS D:\> ./ncmdump "<path>\中文.ncm"
Unexpected exception while processing file:

使用 -d 指定的文件夹中如果包含纯英文文件和含有中文的文件,中文文件会被直接忽略而不产生异常

DoS attack caused by memory exhaustion

Description

Denial-of-Service (DoS) vulnerability of taurusxin ncmdump v1.3.2 allow a remote attacker to flood a server with extremely high memory consumption to prevent user from accessing services via the crafted .ncm files.

One crafted .ncm file with a file size of 440KB can consume 16.3GB physical memory in 23 seconds. Memory resource consumption is amplified by 38183 times the file size.

Attacker can take down state-of-the-art cloud server on sale in HUAWEI (which has 4096GB virtual memory) by sending no more than 256 files. In other words, it is easy for attacker to launch DoS attack to mainstream servers with ncmdump service on it.

Besides, attack vectors provided in poc also trigger segmentation fault to increase the probability of successful attack.

See also https://github.com/Helson-S/FuzzyTesting/blob/master/ncmdump/dos_mmExhausted/dos_mmExhausted.md

Reproduction

run the following command:

./bin/ncmdump ./poc/I7K9QM~F; cp ./poc/origin/I7K9QM~F ./poc/I7K9QM~F

Recommendation for Temporary Patch

Servers with ncmdump service should set memory limit for running process to prevent memory exhausted.

More details

I collect the memory consumption data with collectl and /bin/time. See raw data in ./resource_consumption_statistics.

I have processed the raw data to bar charts shown in Screen-shot below.

Screen-shot

image-20240505161831080
image-20240505161936492
image-20240505162005079
image-20240505162122180

A demonstration video is available ./resource_consumption_statistics/demo_video

是否可以支持指定输出目录

现在版本好像是只能输出到原目录,能不能加一个指定参数输出目录,这样复制的时候就不用很麻烦的搜索后缀复制。如果可以,还是麻烦把dll编译一下,用法的话就只用说一下在哪里指定路径,谢谢

能否发布32位的DLL

您好,我对您的项目很满意也很需要,但我在制作GUI时因为使用了很老的架构导致只能支持x86而不支持x64,能否发布一个32位版本的DLL

[Bug] MSVC版本在处理特殊字符文件名出现问题

Describe the bug

MSVC版本在处理文件名中带有特殊字符出现问题(我这里的场景应该是特殊日文字符)

处理正常的日文字符文件名没有问题.

如图:
image

我将文件名后面的特殊字符删除后, 程序正常转换.

本来是使用-d选项直接处理文件夹, 程序出现异常而中断运行了.

我不知道这个文件名的字在日语文字中是不是属于特殊字符, 我发现在Windows Terminal中会出现光标在文字中间的情况(可能是导致问题的原因 (类似终端的连体字?)).
image

recording

我使用的版本: Release 1.2.1 也就是这个release的MSVC版本
[ncmdump_1.2.1_windows_msvc_amd64.zip] (https://github.com/taurusxin/ncmdump/releases/download/1.2.1/ncmdump_1.2.1_windows_msvc_amd64.zip)

English Translate:

Describe the bug
The MSVC version has problems handling file names with special characters.
After I delete the special characters after the file name, the program converts normally.

I don't know if the word of this file name is a special character in Japanese text, but I found that in Windows Terminal, the cursor appears in the middle of the text. (may problem)

Version I use: Release 1.2.1 MSVC

是否可以支持dll

你好,非常感谢你的软件,到目前为止,它表现得非常好。但是我有一个提议,也是因为我在写一个带有GUI的转换器,您是否能将软件编译成一个可以调用的dll,使我可以在C#代码中调用它?这应该并不困难,在我的看来,只需要修改一些编译参数,如果C++可以调用这个dll,C#应该也可以。如果你能帮我这个忙,我万分感谢。(请尽量不要修改类名和方法名)

macOS 下编译问题

几个问题,我就不 fork PR 了,望仓主补正下 Readme 以及 Makefile:

  • MacOS 下 brew install taglib 后,并不能直接 make 通过,仍然报告链接错误,修复办法:
$ brew info taglib  # 获取安装后的 lib 路径
  • 需修改 Makfile,并添加头文件路径(直接使用 clone 后的本地 taglib 头文件)
macos:
	clang++ main.cpp cJSON.cpp aes.cpp ncmcrypt.cpp -o ncmdump -ltag \
		-I taglib/include \
		-L/opt/homebrew/Cellar/taglib/1.13.1/lib/   # 此即上面 info 命令获取的 taglib 路径,视情况而定
	strip ncmdump

另:release 页面下载的 macOS 平台二进制并不能直接运行,提示动态库找不到。还是建议大家直接编译。

DoS attack caused by segmentation fault

Description

Denial-of-Service (DoS) Vulnerability of taurusxin ncmdump v1.3.2 allow a remote attacker to break ncmdump online service via the crafted .ncm files.

Attack vectors provided in poc will trigger segmentation fault caused by illegal read access. The crash point is at ncmdump/src/ncmcrypt.cpp:251, a function call to NeteaseCrypt::FixMetadata(). Coredump file is provided in ./coredumps.

See also https://github.com/Helson-S/FuzzyTesting/blob/master/ncmdump/dos_FixMetadata/dos_FixMetadata.md

Reproduction

Run the following command:

./bin/ncmdump ./poc/I1DWE0~U; cp ./poc/origin/I1DWE0~U ./poc/I1DWE0~U

Postscript: To successfully reproduce it, one need to run the command for several times.

Screen-shot

Crash:
crash

Debug coredump:
debug-coredump

[Bug] 文件被占用

在使用1.3.1版本的dll时,发现仍有文件被占用的问题。
图片
这里已经销毁了实例,但是在Move过程中抛出错误
图片
并且在程序运行的状态下在文件夹中删除转换后文件显示被占用
图片

文件名称中带有西语或特殊符号时反序列出错

严格意义上不算错误, 可以通过修改文件名为正常名称后再次处理

异常信息:
Exception: not netease protected file

示例文件名(只列举了同类中一个, 仅供参考)
特殊符号( 此处为・)
荻野目洋子 - ダンシング・ヒーロー (Eat You Up).ncm

韩语
단비 - 니가 내리던 하루.ncm

西语
Schnuffel - Häschenparty (Album Version).ncm
Shawn Mendes,Camila Cabello - Señorita.ncm

保留文件时间戳

作者大大你好,我用了你这个命令行版本的网易音乐解码器我觉得不错,我想给个建议就是能否保留原始文件时间戳?转码之后文件时间变了!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.