New package: stegseek-0.6

This commit is contained in:
yosh 2023-09-09 16:25:38 -04:00 committed by classabbyamp
parent db173691b3
commit 5f3eb3f0bd
2 changed files with 86 additions and 0 deletions

View File

@ -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{};
}
}

12
srcpkgs/stegseek/template Normal file
View File

@ -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 <yosh-git@riseup.net>"
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