thexiv

30 proof ^ X

Nov 26th, 2021
1,013
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int arg, char * argv[])
  7. {
  8.  
  9.     const char H[30] = { "my weak www.peanuts.com" };
  10.    
  11.     unsigned int Hs_XORd = 0;
  12.     uint64_t xord = 0;
  13.     for (int16_t i = 0; i < sizeof(H); i++) {
  14.         Hs_XORd ^= H[i];
  15.     }
  16.    
  17.     unsigned int NUMKEYs_XORd = 0;
  18.     const char NUMKEY[30] = { "12121432-32e-13--113eoi456789" };
  19.     for (size_t i = 0; i < sizeof(NUMKEY) ; i++) {
  20.         NUMKEYs_XORd ^= Hs_XORd ^ (int)NUMKEY[i];
  21.     }
  22.    
  23.     char K1[30] = { "" };
  24.     for (size_t i = 0; i < sizeof(K1); i++) {
  25.         K1[i] = NUMKEYs_XORd ^ NUMKEY[sizeof(NUMKEY)-i-1];
  26.         for (unsigned int j = 0 ; j < i ; j++)
  27.         {
  28.             NUMKEYs_XORd ^= K1[sizeof(K1)-j-1] ^ (int)NUMKEY[sizeof(NUMKEY)-j-1];
  29.         }
  30.     }
  31.      
  32.     char X1[30] = { "" };
  33.     for (size_t i = 0; i < sizeof(NUMKEY); i++) {
  34.         X1[i] = K1[sizeof(K1)-i-1] ^ (int)NUMKEY[sizeof(NUMKEY)-i-1] ^ NUMKEYs_XORd;
  35.     }
  36.     cout << ("X's XOR'd together: ");
  37.     char R1[16] = { "\0" };
  38.    
  39.     for (int i = 0 ; i < sizeof(X1) ; i++)
  40.         R1[(i+14)%sizeof(R1)] = X1[(i)%sizeof(X1)];
  41.     cout << R1;
  42. }
RAW Paste Data