TrueCrack v3.5 patch for Cygwin/Visual Studio compatibility

Hi,

  With the attached path TrueCrack v3.5 compiles under Visual Studio
2010 (if you add a compatible getopt_long implementation and a make-
file with the right source files) and Cygwin GCC v4.7.3 (with a minor
problem that you have to set `EXEEXT =` to the empty string in the
`src/Makefile` file, otherwise `make` will try to make a target with
the name `truecrack.exe` but does not know how; not sure why that is);
in both configurations building for CPU-only ignoring the CUDA parts.

The GCC version even appears to work to some extent, in verbose mode

  sh-4.1$ truecrack -t 2222.tc -v -c "1234" -s 4 -m 4
  TrueCrack v3.5
  Website: http://code.google.com/p/truecrack

  Contact us: infotruecrack@gmail.com
  
  Memory initialization...
  
  COUNT   PASSWORD        RESULT
  0       1111            NO
  1       2111            NO
  2       3111            NO
  ...
  84      1222            NO
  85      2222            YES
  No found password
  Total computations:     "86"

it stops when it has found the password (but claims to have found no
password, which is a bit disconcerting). The binary built with Visual
Studio 2010 using the same command line parameters also works fine, but
it never prints "YES", so it essentially does not find the password. I
am guessing it could be some kind of memory initialisation problem, but
a quick test under Dr. Memory showed nothing terribly obvious.

As for the particular changes, the patch removes instances of `#include
<sys/mount.h>` which appears to be unused, and `#include <unistd.h>`
which also appears to be unused; I added `#include <stdint.h>` with the
idea to compensate for `unistd.h` but that might not actually be needed,
and I am not sure I put it in the right positions, looking at the patch.
Some functions declare variables after other statements, which is only
allowed in recent versions of the C language, I reordered four cases or
so; I noticed there are a few `pow` calls that need type casts for them
to compile under C++ rules. In `Common/Endian.h` I added a check for the
`__CYGWIN__` macro to the check for `_WIN32` to define the endianess; I
imagine there might be better ways to do that.

A strange problem was in `Crypto/CpuAes.h` where the `EXTERN` macro is
defined. The patch does

  @@ -1212,7 +1212,7 @@ AES_RETURN aes_ctr_crypt(const unsigned
   #elif defined(DO_TABLES)
   #  define EXTERN
   #else
  -#  define EXTERN //extern
  +#  define EXTERN extern
   #endif

restoring the code from TrueCrypt's `Crypto\Aestab.h` as far as I can
tell. I have no idea why the TrueCrack version makes it a `//` comment.

regards,
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de

Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de

25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Saturday, 12 October 2013 15:14:46 UTC