This isn't Emisand's, since his/her's upload died, I (sort of) fixed it up. The header changed for KGunz, which I didn't think of 'till a few minutes ago.
EDIT : Oh, use ThievingSix's MRS Decompiler to unpack the .mrs's without damaging the .mef's.
I attached the compiled MEncrypt.exe w/ PrivateKey.txt & .h
Yes, I rigged it, oh well.
NOTE:Code:void RSADecryptFile( const char *privFilename, const char *szFileName, const char *szOutputFileName) { // Read private key FileSource privFile( privFilename, true, new HexDecoder); RSAES_PKCS1v15_Decryptor priv( privFile ); // Get size of 1 block size_t nCipherTextLength = priv.FixedCiphertextLength(); // Set file source FileSource fileSource( szFileName, false); RSAHEADER header = GetHeaderFile( szFileName ); if( !memcmp( header.byteHeader, gHeaderChecker, sizeof(gHeaderChecker) ) ) g_bIsIjji = true; // Skip header if( g_bIsIjji ) fileSource.Pump( 40 ); else fileSource.Pump( 45 ); // Decrypt string strBuff; StringSink* pOutput = new StringSink( strBuff); PK_DecryptorFilter *pDecryptFilter = new PK_DecryptorFilter( GlobalRNG(), priv, pOutput); fileSource.Attach( pDecryptFilter); try { // Pump data lword nPump = 0; while ( nPump = fileSource.Pump( nCipherTextLength)) pDecryptFilter->MessageEnd(); } catch ( CryptoPP::Exception &e) { string str = e.what(); assert( 0); } pOutput->MessageEnd(); // Unzip code and save to file StringSource( strBuff, true, new Gunzip( new FileSink( szOutputFileName))); strBuff.clear(); }
IJJI's header is 40 bytes long, KGunZ's is 45 bytes long.
The original header size found in MEncrypt is 40 (sizeof(RSAHEASER)), which is default for IJJI, however; I was being retarded and forgot that I was testing on KGunZ's.
Usage:
Open CMD, navigate to directory of MEncrypt, type:
MEncrypt -d PrivateKey.txt [FILE_TO_DECRYPT] [OUTPUT_FILE_NAME]
Edit2 : I added support for IJJI's mefs, as well as KGunZ's. Enjoy.



Reply With Quote

