Mr_hEx

HTB Overflow Xor File (Not Woriking)!!

Nov 30th, 2021 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. int main(int argc, char** argv) {
  5.     std::ofstream MyFile("FileName.txt");
  6.     std::ifstream file("FileName2.txt");
  7.     if (file.is_open())
  8.     {
  9.         std::string line;
  10.         while (getline(file, line)){
  11.         // note that the newline character is not included
  12.         // in the getline() function
  13.         for(int i = 0; i < line.length(); i++){
  14.             char XorCahrByChar = line[i] ^ 0x9b;
  15.             MyFile <<XorCahrByChar;
  16.         }
  17.  
  18.      }
  19.     MyFile.close();
  20.     file.close();
  21.     }
  22.     return 0;
  23. }
  24. # Ntet : it's not working
  25. # it's xor file but when decrypt it thru file_encrypt it's does't decrypt it with new line !!
  26. # I do it with python !
Add Comment
Please, Sign In to add comment