Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1.     char chars[256];
  2.     //strcpy(chars, pGameEntry->GetFileName());
  3.     strcpy(chars, "smb://USER:pass@server/share/Directory/");
  4.     DevMsg("Chars are: %s\n", chars);
  5.     DevMsg("In hex, that's: %x\n", (unsigned int) chars);
  6.  
  7.     // Convert to lowercase
  8.     int i = 0;
  9.     while(chars[i] != '\n')
  10.     {
  11.         chars[i] = tolower(chars[i]);
  12.         i++;
  13.     }
  14.  
  15.     DevMsg("That's %s in lowercase.\n", chars);
  16.  
  17.     // Guess: Start with a full mask?
  18.     unsigned int m_crc = 0xffffffff;
  19.  
  20.     i = 0;
  21.     while(input[i])
  22.     {
  23.         c = input[i];
  24.         m_crc ^= ((unsigned int) c << 24);
  25.         for (int a = 0; a < 8; a++)
  26.         {
  27.             if( ((unsigned int) c & 0x80000000) == 0x80000000 )
  28.                 m_crc = (m_crc << 1) ^ 0x04C11DB7;
  29.             else
  30.                 m_crc <<= 1;
  31.         }
  32.         i++;
  33.     }
  34.  
  35.     char xbmc_file_hash[256];
  36.     strcpy( xbmc_file_hash, VarArgs("%x", m_crc) );
  37.  
  38. //  strcpy(marqueeFile, this->FindImage(pGameEntry, "", VarArgs("%sVideo/%s%s", xbmc_thumbnails_folder, xbmc_file_hash[0], xbmc_file_hash), "marquees"));
  39.     DevMsg("Hash is: %s\n", xbmc_file_hash);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement