diff --git a/README b/README index aab7234..30b160b 100644 --- a/README +++ b/README @@ -10,7 +10,6 @@ nHash cc1f Try some password on this file. $ ./xor_me toto 0xd10d 0Xcc1f -Algorithm XOR MS Word Key: d10d Hash: cc1f FAIL! toto @@ -18,7 +17,6 @@ FAIL! toto Try the good password on this file. $ ./xor_me 0824 0xd10d 0Xcc1f -Algorithm XOR MS Word Key: d10d Hash: cc1f Good guess: 0824 @@ -39,16 +37,14 @@ WARNING: little endian, you should permute bytes Try some password on this file. -$ ./xor_me 4242 0x499a 0Xcc61 1 -Algorithm XOR MS Excel +$ ./xor_me 4242 0x499a 0Xcc61 Key: 499a Hash: cc61 FAIL! 4242 Try the good password on this file. -$ ./xor_me 1950 0x499a 0Xcc61 1 -Algorithm XOR MS Excel +$ ./xor_me 1950 0x499a 0Xcc61 Key: 499a Hash: cc61 Good guess: 1950 diff --git a/xor_me.cxx b/xor_me.cxx index 26c2f3d..e19e19b 100644 --- a/xor_me.cxx +++ b/xor_me.cxx @@ -1,19 +1,12 @@ #include "binarycodec.cxx" int main(int argc, char ** argv) { - - oox::core::BinaryCodec_XOR::CodecType algo; - unsigned char * pwdToTest = reinterpret_cast(argv[1]); if (argc < 4) { - std::cout << "Usage: " << argv[0] << " <0xKey> <0xHash> [1 for XLS]" << std::endl; + std::cout << "Usage: " << argv[0] << " <0xKey> <0xHash>" << std::endl; return EXIT_FAILURE; - } else if (argc >= 5) { - algo = oox::core::BinaryCodec_XOR::CODEC_EXCEL; - std::cout << "Algorithm XOR MS Excel" << std::endl; - } else { - algo = oox::core::BinaryCodec_XOR::CODEC_WORD; - std::cout << "Algorithm XOR MS Word" << std::endl; } + + unsigned char * pwdToTest = reinterpret_cast(argv[1]); unsigned short nKey; std::istringstream issk(argv[2]); issk >> std::hex >> nKey; @@ -24,7 +17,7 @@ int main(int argc, char ** argv) { std::cout << std::hex << "Key: " << nKey << std::endl; std::cout << std::hex << "Hash: " << nHash << std::endl; - oox::core::BinaryCodec_XOR x(algo); + oox::core::BinaryCodec_XOR x(oox::core::BinaryCodec_XOR::CODEC_WORD); x.initKey(pwdToTest); if (x.verifyKey(nKey, nHash)) {