From 3a0d73eb7910b66e50dbb4c8d30649bb79418129 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 4 Aug 2023 01:37:05 -0500 Subject: [PATCH] Changed from vectors to lists for performance gains. --- SHNFileDecryptor/AbState.shn.bak | Bin 0 -> 227187 bytes SHNFileDecryptor/SHNFileDecryptor.cpp | 183 ++++++++++++++++---------- 2 files changed, 113 insertions(+), 70 deletions(-) create mode 100644 SHNFileDecryptor/AbState.shn.bak diff --git a/SHNFileDecryptor/AbState.shn.bak b/SHNFileDecryptor/AbState.shn.bak new file mode 100644 index 0000000000000000000000000000000000000000..7d427d3da46cc2be69a3d94d2131787e645229db GIT binary patch literal 227187 zcmd_z2YBSv)i-dN-XS5qk~qDPtw1{V*j_KYvlx$;CDoB_*%ls;jAmvRliuDpy*GM? zBtU?KB#;86hn7Moz4zXGzI!B{J1Y0g)yW%Ya`yA{tVdqWTk##?^SL$u;^)@>i=SKfFMe)4|8wJRW3Hqpet(h6aASJjZM3$u7pH7rB7Uyco{Fnl z$?4(uFyuFvyn5;C>0td-(_?)UKbOp8&E4)zEHBw-7C%>Y{YF&HR6{KDMd*C(rMf?@ z>UNnAsrO*LhWCmv zoAWr0%qwuhPoHBeuGiz^`BYzeL_~*z&KdqeGTS^WqFsP!&~3Hq-e5i0QERmuIHlwj z%;O(halIao^BEJ-q4rR3#CBwxXGOFt5LNxTd9@%3+I48@IHlwjI=T2K^G^KF)N5wE zVabviZ&-q4#v7Itnem1t!jUTb?rMHwB3y`1u3c5lhU&D7QnhHeEKw>j4nmcTe{ABt z9*^@G6Lr3K{QvwbP-WN+6-3pd-J>@Jp+upTWs=UZLg2Kek!y^?01mn1~L=Y-oD|(Wo0P4tcZQbPK1F zdfihG_nN>qeVoylhz`Z9MSB6!pcgj11uq;4y~at)IHlxuFa5V|7JEG&XEY|FLosX7 z-cduF52hCe>uQV2u+WFq)A*;?1h(npd?pQz48>gN?*l}g&fl=8hV{_+$2N<-9*^@G z6Lk$0y|v^LZQm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Nke*cs6mz{tp8wvtps1n_E zGeb03_Zu@>I3D;bmS){5woPuO$K#AAr>0{ETL=Y#us^cRlRA#p$`Fm!il>JBO*&B_ z6lViu_x`?ihDe>sH{yHsOhx*;bfQ8itU)C=K(=RyOeYxqLpo6*6a<2r1V6ThrfSiS z4AHhqbs)b;`=@jwQ>ciiWGy-|Lu5Q%2~SbBirc=Cl^!4ER=;xHwJ{W2NmP>P`9QRB zXs|syJGpw*Dx6B{^+!T$QP)s9pY3Z?OSBiHh>kD`IX{+7WDdn4dSQy_FeA}VWD}V~ zaflXEMC*)1Kb1{n4#gpAq=?oSiGC)V$Q+78^dcY{sraqX_ljo)LP@6!C89%d)~;1| z{U#u)1kGx@=?+Y1_Uk9oeL@%dT|-6LN-p%@oFb}(e!`M|*+n*yITVNJEh(abdR&XnYZf=>*)}gc5ZPrJG5KRmW2^M8y+u)g7dz6BR;1AA~<8 zh)x5d;mKzPi|Vnu__@sM9zu!eP)Jm=yFNW8s=A?D3B4T|ocNDD#S&4Wm_%oEh=%Ka z>QKJM+DkN%DHN0F%nnh__3J^XX>ed~(L|THmv;X0b+@$P)wrpW1{h3D#+U;e;+88hzi9dx*#SR4WI&I{(mllzQK6Vb7so`k s$x(MX^k!!K!aDZ7#1c`Vm_(OgEi%-fxI*1qED`K4Dl`i9A1tE(2kqr-l>h($ literal 0 HcmV?d00001 diff --git a/SHNFileDecryptor/SHNFileDecryptor.cpp b/SHNFileDecryptor/SHNFileDecryptor.cpp index 1b9940a..31d8cd2 100644 --- a/SHNFileDecryptor/SHNFileDecryptor.cpp +++ b/SHNFileDecryptor/SHNFileDecryptor.cpp @@ -3,13 +3,13 @@ #include #include #include +#include +#include typedef std::byte byte; typedef char sbyte; class SHNFile{ - std::vectorcryptHeader; - std::vectordata; std::vectorReadBytes(std::ifstream&file,int bytes){ std::vectorbyteArr; for(int i=0;iReadBytes(int bytes){ - std::vectorbyteArr={}; + std::listReadBytes(int bytes){ + std::listbyteArr={}; for(int i=0;ib=ReadBytes(1); + std::listb=ReadBytes(1); if(b.size()>0){ - return b[0]; + return b.front(); } else { return byte(0); } } uint16_t ReadUInt16(){ - std::vectorintBytes=ReadBytes(2); - uint16_t numb = uint16_t(intBytes[1])<<8|uint16_t(intBytes[0]); + std::listintBytes=ReadBytes(2); + uint16_t numb = uint16_t(intBytes.back())<<8; + intBytes.pop_back(); + numb |= uint16_t(intBytes.back()); return numb; } int16_t ReadInt16(){ - std::vectorintBytes=ReadBytes(2); - int16_t numb = int16_t(intBytes[1])<<8|int16_t(intBytes[0]); + std::listintBytes=ReadBytes(2); + int16_t numb = int16_t(intBytes.back())<<8; + intBytes.pop_back(); + numb |= int16_t(intBytes.back()); return numb; } uint32_t ReadUInt32(){ - std::vectorintBytes=ReadBytes(4); - uint32_t numb = uint32_t(intBytes[3])<<24|uint32_t(intBytes[2])<<16|uint32_t(intBytes[1])<<8|uint32_t(intBytes[0]); + std::listintBytes=ReadBytes(4); + uint32_t numb = uint32_t(intBytes.back())<<24; + intBytes.pop_back(); + numb |= uint32_t(intBytes.back())<<16; + intBytes.pop_back(); + numb |= uint32_t(intBytes.back())<<8; + intBytes.pop_back(); + numb |= uint32_t(intBytes.back()); return numb; } int ReadInt32(){ - std::vectorintBytes=ReadBytes(4); - int numb = int(intBytes[3])<<24|int(intBytes[2])<<16|int(intBytes[1])<<8|int(intBytes[0]); + std::listintBytes=ReadBytes(4); + int numb = int(intBytes.back())<<24; + intBytes.pop_back(); + numb |= int(intBytes.back())<<16; + intBytes.pop_back(); + numb |= int(intBytes.back())<<8; + intBytes.pop_back(); + numb |= int(intBytes.back()); return numb; } struct Column{ @@ -86,39 +101,44 @@ class SHNFile{ int length=0; }; std::string ReadString(int bytes){ - std::vectorstrBytes=ReadBytes(bytes); + std::liststrBytes=ReadBytes(bytes); std::string str=""; - for(int i=0;istrBytes=ReadBytes(4); - byte bytes[]={strBytes[0],strBytes[1],strBytes[2],strBytes[3]}; + std::liststrBytes=ReadBytes(4); + byte bytes[4]; + bytes[0]=strBytes.front(); + strBytes.pop_front(); + bytes[1]=strBytes.front(); + strBytes.pop_front(); + bytes[2]=strBytes.front(); + strBytes.pop_front(); + bytes[3]=strBytes.front(); float f; memcpy(&f,&bytes,sizeof(float)); return f; } sbyte ReadSByte(){ - return sbyte(ReadBytes(1)[0]); + return sbyte(ReadBytes(1).front()); } std::string ReadString(){ std::string str=""; while(true){ - std::vectorbyteArr=ReadBytes(1); - if(byteArr.size()>0&&byteArr[0]!=byte(0)){ - str+=unsigned char(byteArr[0]); + std::listbyteArr=ReadBytes(1); + if(byteArr.size()>0&&byteArr.front()!=byte(0)){ + str+=unsigned char(byteArr.front()); }else{ break; } } return str; } - uint32_t header,recordCount,defaultRecordLength,columnCount; - std::vectorcolumns; public: struct Data{ std::shared_ptrdata; @@ -217,14 +237,28 @@ class SHNFile{ } }; private: - std::vector>contents; friend std::ostream&operator<<(std::ostream&out,SHNFile::Data&d){ out<cryptHeader; + std::vectordata; + uint32_t header=0,recordCount=0,defaultRecordLength=0,columnCount=0; + std::vectorcolumns; + std::vector>contents; + std::string filename; public: - SHNFile(std::string file){ - std::ifstream f(file,std::ios::binary); + void Load(std::string file){ + cryptHeader.clear(); + data.clear(); + header=recordCount=defaultRecordLength=columnCount=0; + columns.clear(); + contents.clear(); + marker=0; + std::chrono::time_pointtimer=std::chrono::high_resolution_clock::now(); + filename=file; + std::ifstream f(filename,std::ios::binary); cryptHeader=ReadBytes(f,0x20); data=ReadBytes(f,ReadInt32(f)-0x24); Decrypt(); @@ -248,53 +282,62 @@ public: std::vectorrow; for(int j=0;jdur=std::chrono::high_resolution_clock::now()-timer; + std::cout<<"Loaded "<