8000 Fix: handle hashed filenames with a length of 16 or more by dnzbk · Pull Request #548 · nzbgetcom/nzbget · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: handle hashed filenames with a length of 16 or more #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions daemon/queue/Deobfuscation.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of nzbget. See <https://nzbget.com>.
*
* Copyright (C) 2024 Denis <denis@nzbget.com>
* Copyright (C) 2024-2025 Denis <denis@nzbget.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -34,7 +34,7 @@ namespace Deobfuscation
inline const std::array<std::regex, 11> HASHED_RELEASES_REGEXES{
std::regex{ "[0-9a-f.]{16}" },
std::regex{ "^[0-9a-zA-Z]{24,}" },
std::regex{ "^[a-z0-9]{24}$" },
std::regex{ "^[a-z0-9]{16,}$" },
std::regex{ "^abc$" },
std::regex{ "^abc[-_. ]xyz" },
std::regex{ "^[A-Z]{11,}[0-9]{3}$" },
Expand Down
6 changes: 5 additions & 1 deletion tests/queue/DeobfuscationTest.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of nzbget. See <https://nzbget.com>.
*
* Copyright (C) 2023-2024 Denis <denis@nzbget.com>
* Copyright (C) 2023-2025 Denis <denis@nzbget.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,6 +40,10 @@ BOOST_AUTO_TEST_CASE(IsExcessivelyObfuscatedTest)
BOOST_CHECK(IsExcessivelyObfuscated("2fpJZyw12WSJz8JunjkxpZcw0XIZKKMP.7z.015") == false);
BOOST_CHECK(IsExcessivelyObfuscated("a1b2c3d4e5f678.901234567890abcdef01234567890123.zip") == false);
BOOST_CHECK(IsExcessivelyObfuscated("a1b2c3d4e5f678.901234567890abcdef01234567890123.par2") == false);
BOOST_CHECK(IsExcessivelyObfuscated("ac4rcq47pkqt4flatz2xf.rar") == false);
BOOST_CHECK(IsExcessivelyObfuscated("ac4rcq47pkqt4fla"));
BOOST_CHECK(IsExcessivelyObfuscated("ac4rcq47pkqt4flatz2xf"));
BOOST_CHECK(IsExcessivelyObfuscated("ac4rcq47pkqt4flatz2xfac4rcq47pkqt4flatz2xf4567"));
}

BOOST_AUTO_TEST_CASE(DeobfuscationTest)
Expand Down
0