Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Joseph Kogut

By: a guest on Jan 30th, 2010  |  syntax: None  |  size: 1.54 KB  |  views: 113  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Part of Laverna's Brute
  2. //Base processing path which path implementations inherit from.
  3.  
  4. //This class declaration is dedicated to Tori :)
  5.  
  6. #ifndef PROCESSINGPATH_H_
  7. #define PROCESSINGPATH_H_
  8.  
  9. #include <iostream>
  10. #include <stdlib.h>
  11. #include <time.h>
  12. #include <sstream>
  13. #include <string>
  14.  
  15. #include <boost/unordered_map.hpp>
  16. #include <boost/thread/thread.hpp>
  17.  
  18. #include "MasterThread.h"
  19. #include "NTLM.h"
  20.  
  21. #include "KeyGenerator.h"
  22.  
  23. class processingPath
  24. {
  25.         public:
  26.  
  27.         processingPath();
  28.         ~processingPath();
  29.  
  30.         // The loop that is run to crack a given target hash
  31.         virtual void operator()() = 0;
  32.    
  33.         // Functions necessary for the Director to do its job
  34.         virtual int getThreadID() = 0;
  35.  
  36.         virtual unsigned long long getKeyspaceEnd() = 0;
  37.         virtual unsigned long long getKeyspaceBegin() = 0;
  38.         virtual unsigned long long getKeyLocation() = 0;
  39.  
  40.         virtual void moveKeyspaceEnd(unsigned long long input) = 0;
  41.         virtual void moveKeyspaceBegin(unsigned long long input) = 0;
  42.         virtual void moveKeylocation(unsigned long long input) = 0;
  43.  
  44.         // Processing path options
  45.         static void pushTarget(std::string input);
  46.         static void setMaxChars(int input);
  47.         static int getMaxChars();
  48.  
  49.         static int getNumTargets();
  50.  
  51. protected:
  52.  
  53.         static void removeTarget(boost::unordered_map<int64_pair, std::string>::iterator it);
  54.  
  55.         static boost::unordered_map<int64_pair, std::string> targets;
  56.         static boost::mutex targetsMutex;
  57.  
  58.         static int maxChars;
  59.         static int numWorkers;
  60.  
  61.         char* charset;
  62.         int charsetLength;
  63.  
  64.         int remainingTargets;
  65. };
  66.  
  67. #endif