From ce8da4ed7e3f1db1b77e1e083f283312f814e95e Mon Sep 17 00:00:00 2001 From: yosh Date: Sat, 9 Sep 2023 16:25:38 -0400 Subject: [PATCH] New package: stegseek-0.6 --- srcpkgs/stegseek/patches/portable-types.patch | 74 +++++++++++++++++++ srcpkgs/stegseek/template | 12 +++ 2 files changed, 86 insertions(+) create mode 100644 srcpkgs/stegseek/patches/portable-types.patch create mode 100644 srcpkgs/stegseek/template diff --git a/srcpkgs/stegseek/patches/portable-types.patch b/srcpkgs/stegseek/patches/portable-types.patch new file mode 100644 index 0000000000000..b68c7480b2f8c --- /dev/null +++ b/srcpkgs/stegseek/patches/portable-types.patch @@ -0,0 +1,74 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a404f8..9bb968f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.5) + + project(stegseek VERSION 0.6) + ++if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) ++ # Update if necessary ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long") ++endif() ++ + add_subdirectory("src") + + # Testing only available if this is the main app +diff --git a/src/Cracker.cc b/src/Cracker.cc +index 8c5a646..88a2b09 100644 +--- a/src/Cracker.cc ++++ b/src/Cracker.cc +@@ -189,7 +189,7 @@ bool Cracker::verifyMagic(UWORD32 seed) { + short currentBit = (ev >> k) & 1; + int bitsSeen = i * bitsPerEmbValue + k; + // Add an extra check to make sure we don't touch bit 26, even if bitsPerEmbValue > 1 +- if (currentBit != ((magic >> bitsSeen) & 1) && bitsSeen < 25) { ++ if (currentBit != (short)((magic >> bitsSeen) & 1) && bitsSeen < 25) { + return false; + } + } +diff --git a/src/PasswordCracker.cc b/src/PasswordCracker.cc +index 58fc3a8..e91ef1a 100644 +--- a/src/PasswordCracker.cc ++++ b/src/PasswordCracker.cc +@@ -58,7 +58,11 @@ void PasswordCracker::crack() { + // Add n worker threads + // A part must have at least len 1, otherwise no words will be read when + // threads > size +- unsigned long part = std::max(wordlistStats.st_size / threads, 1L); ++ unsigned long part = ((unsigned long)wordlistStats.st_size) / threads; ++ if (part <= 0) { ++ part = 1; ++ } ++ + for (unsigned int i = 0; i < threads; i++) { + ThreadPool.push_back(std::thread([this, i, part, metricsEnabled] { + consume(i * part, (i + 1) * part, metricsEnabled); +@@ -138,8 +142,13 @@ void PasswordCracker::consume(unsigned long i, unsigned long stop, bool metricsE + batchProgess = 0; + } + ++ // Get out current position in the wordlist, make sure it is non-negative, so ++ // we are safe to cast it to unsigned in the next compare. ++ long pos = ftell(pWordList); ++ myassert(pos >= 0); ++ + // If we've overshot the end of our section (by one word), we can stop +- if (ftell(pWordList) > stop) { ++ if ((unsigned long)ftell(pWordList) > stop) { + break; + } + } +diff --git a/src/SeedCracker.cc b/src/SeedCracker.cc +index 3308753..36f3c1a 100644 +--- a/src/SeedCracker.cc ++++ b/src/SeedCracker.cc +@@ -128,7 +128,7 @@ Result SeedCracker::trySeed(UWORD32 seed) { + int bitsSeen = i * bitsPerEmbValue + k; + // Check magic + if (bitsSeen < 25) { +- if (((magic >> bitsSeen) & 1) != currentBit) { ++ if ((short)((magic >> bitsSeen) & 1) != currentBit) { + return Result{}; + } + } diff --git a/srcpkgs/stegseek/template b/srcpkgs/stegseek/template new file mode 100644 index 0000000000000..fd78008a08d3a --- /dev/null +++ b/srcpkgs/stegseek/template @@ -0,0 +1,12 @@ +# Template file for 'stegseek' +pkgname=stegseek +version=0.6 +revision=1 +build_style=cmake +makedepends="mhash-devel libmcrypt-devel libjpeg-turbo-devel zlib-devel" +short_desc="Worlds fastest steghide cracker" +maintainer="yosh " +license="GPL-2.0-or-later" +homepage="https://github.com/RickdeJager/stegseek" +distfiles="https://github.com/RickdeJager/stegseek/archive/refs/tags/v${version}.tar.gz" +checksum=66cdd8e4e4b815d7fe368843e7df2f0416af0304df35e4f22db9f16c7ae6c771