diff --git a/SHNFileDecryptor/AbState.shn.bak b/SHNFileDecryptor/AbState.shn.bak index 7d427d3..4d96d5c 100644 Binary files a/SHNFileDecryptor/AbState.shn.bak and b/SHNFileDecryptor/AbState.shn.bak differ diff --git a/SHNFileDecryptor/SHNFileDecryptor.cpp b/SHNFileDecryptor/SHNFileDecryptor.cpp index 8dfaec6..ca79ef4 100644 --- a/SHNFileDecryptor/SHNFileDecryptor.cpp +++ b/SHNFileDecryptor/SHNFileDecryptor.cpp @@ -219,7 +219,7 @@ class SHNFile{ } int marker=0; std::vectorcryptHeader; - std::vectordata; + std::vectordata,rawData; uint32_t header=0,recordCount=0,defaultRecordLength=0,columnCount=0; std::vectorcolumns; std::vector>contents; @@ -231,12 +231,23 @@ public: header=recordCount=defaultRecordLength=columnCount=0; columns.clear(); contents.clear(); + rawData.clear(); marker=0; std::chrono::time_pointtimer=std::chrono::high_resolution_clock::now(); filename=file; + + //FILE OPERATIONS! std::ifstream f(filename,std::ios::binary); cryptHeader=ReadBytes(f,0x20); - data=ReadBytes(f,ReadInt32(f)-0x24); + std::copy(cryptHeader.begin(),cryptHeader.end(),std::back_inserter(rawData)); + int readAmt=ReadInt32(f); + rawData.push_back(byte(readAmt&0xFF)); + rawData.push_back(byte((readAmt>>8)&0xFF)); + rawData.push_back(byte((readAmt>>16)&0xFF)); + rawData.push_back(byte((readAmt>>24)&0xFF)); + data=ReadBytes(f,readAmt-0x24); + std::copy(data.begin(),data.end(),std::back_inserter(rawData)); + Decrypt(); header=ReadUInt32(); recordCount=ReadUInt32(); @@ -302,8 +313,8 @@ public: void Save(){ std::ofstream fBackup(filename+".bak",std::ios::binary); std::cout<<"Saving a backup to "<