Mr_hEx icon

HTB Overflow Xor File (Not Woriking)!!

Mr_hEx | PRO | 11/30/21 08:10:24 AM UTC (Edited) | 0 ⭐ | 258 👁️ | Never ⏰ | []
C++ |

670 B

|

None

|

0 👍

/

0 👎

#include <iostream>
#include <fstream>
 
int main(int argc, char** argv) {
    std::ofstream MyFile("FileName.txt");
    std::ifstream file("FileName2.txt");
    if (file.is_open())
    {
        std::string line;
        while (getline(file, line)){
        // note that the newline character is not included
        // in the getline() function
        for(int i = 0; i < line.length(); i++){
            char XorCahrByChar = line[i] ^ 0x9b;
            MyFile <<XorCahrByChar;
        }
 
     }
    MyFile.close();
    file.close();
    }
    return 0;
}
# Ntet : it's not working 
# it's xor file but when decrypt it thru file_encrypt it's does't decrypt it with new line !!
# I do it with python !

Comments