This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Joseph Kogut

By: a guest on Jan 30th, 2010  |  syntax: C++  |  size: 1.25 KB  |  views: 74  |  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.  
  3. #include "ProcessingPath.h"
  4.  
  5. ////////////////////////////////////////////
  6. // Initialize our static variables /////////
  7. ////////////////////////////////////////////
  8.  
  9. boost::unordered_map<int64_pair, std::string> processingPath::targets;
  10. boost::mutex processingPath::targetsMutex;
  11. int processingPath::maxChars = 0;
  12. int processingPath::numWorkers = 0;
  13.  
  14. ////////////////////////////////////////////
  15.  
  16. processingPath::processingPath()
  17. {
  18.         charset = masterThread::getCharset();
  19.         charsetLength = masterThread::getCharsetLength();
  20.  
  21.         //Make sure the keyspace size is within the supported limits
  22.         if(maxChars < 1 || maxChars > 14)
  23.         {
  24.                 maxChars = 8;
  25.         }
  26.  
  27.         numWorkers = masterThread::getNumWorkers();
  28. }
  29.  
  30. processingPath::~processingPath()
  31. {
  32. }
  33.  
  34. void processingPath::pushTarget(std::string input)
  35. {
  36.         NTLM ntlm;
  37.         targets[ntlm.weakenHash(input)] = input;
  38. }
  39.  
  40. void processingPath::setMaxChars(int input)
  41. {
  42.         maxChars = input;
  43. }
  44.  
  45. int processingPath::getMaxChars()
  46. {
  47.         return maxChars;
  48. }
  49.  
  50. int processingPath::getNumTargets()
  51. {
  52.         return (int)targets.size();
  53. }
  54.  
  55. void processingPath::removeTarget(boost::unordered_map<int64_pair, std::string>::iterator it)
  56. {
  57.         boost::mutex::scoped_lock lock(targetsMutex);
  58.         targets.erase(it);
  59. }
clone this paste RAW Paste Data