#include "main.h" using namespace std; int ccCount=0; std::ofstream *ccfout=NULL; bool ccWrite=false; int CharCreateDump(DATA *d) { if(d->encrypted) { //Make sure we don't capture the GAMESERV_DISPATCH packet if(ccCount==1) { ccCount++; } else { //We are capturing data1 if(!ccWrite) { if(ccCount==2) { ccfout=new ofstream; ccfout->open("Dump/Data1",std::ios::binary); ccWrite=true; } else if(ccCount==3) { ccfout=new ofstream; ccfout->open("Dump/Data2",std::ios::binary); ccWrite=true; } else if(ccCount==4) { ccfout=new ofstream; ccfout->open("Dump/A34Data1",std::ios::binary); ccWrite=true; } else { return -1; } } if(ccWrite) { ccfout->write((char*)d->data,d->dataSize); } } } else { ccCount++; if(ccfout!=NULL) { ccfout->close(); delete ccfout; } ccfout=NULL; ccWrite=false; } return 0; }