Advertisement
Guest User

Joseph Kogut

a guest
Jan 30th, 2010
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement