diff --git a/CfLodHandler.h b/CfLodHandler.h new file mode 100644 index 000000000..a8e2b5d2e --- /dev/null +++ b/CfLodHandler.h @@ -0,0 +1,101 @@ +//TSearchRec +#include +#include +#include +const int dmHelp=0, dmNoExtractingMask=1; +std::string P1,P2,CurDir; +struct TSearchRec +{ +}sr; +struct Entry +{ + unsigned char name[12], //filename + hlam_1[4], // + hlam_2[4]; // + int offset, //from beginning + realSize, //size without compression + size; //and with +} ; +std::vector Entries; + +long TotalFiles; +int readNormalNr (unsigned char* bufor, int bytCon, bool cyclic=false) +{ + int ret=0; + int amp=1; + for (int i=0; i=amp/2) + { + ret = ret-amp; + } + return ret; +} +int Decompress (unsigned char * source, int size, int realSize, std::ofstream & dest); +void Extract(std::string FName) +{ + std::ifstream FLOD; + std::ofstream FOut; + long i; + + std::string Ts; + std::cout<<"*** Loading FAT ... \n"; + FLOD.open(FName.c_str(),std::ios::binary); + std::cout<<"*** Archive: "+FName+" loaded\n"; + FLOD.seekg(8,std::ios_base::beg); + unsigned char temp[4]; + FLOD.read((char*)temp,4); + TotalFiles = readNormalNr(temp,4); + FLOD.seekg(0x5c,std::ios_base::beg); + Entries.reserve(TotalFiles); + std::cout<<"*** Loading FAT ...\n"; + for (int i=0;i6) TotalFiles=6; + for (int i=0;i