Log.txtには特にそれらしきものは見つかりませんでした
いつも通りです
ちなみにこの関数はちょいとした暗号化を解くための読み込み関数で
暗号化の解除自体は下記の関数で行います
だから実際DXアーカイブから暗号化されたファイルを読もうとするとLoadGraphの代わりに
DxAPath("...");
DecryptionReadingG("...");
といった感じで毎回呼び出しています
ほかにもGV,WAV,Oggに対する同様の処理があります
とにかくその関数です
void DxAPath(const char *path){
static int flag=0;
static int fhandle,fsize;
SetUseDXArchiveFlag( TRUE ) ;
SetDXArchiveExtension( "dat" ) ;
SetDXArchiveKeyString( "****" ) ;
fsize=FileRead_size(path);
file_load.buf=(int *)malloc(fsize*sizeof(int));
fhandle=FileRead_open(path);
if(fhandle==0){
CString stra;
stra.Format(_T("Read error!\nNow Process = SetDecryptG\n%s"),path);
::MessageBox(NULL,stra,_T("ERROR"),MB_OK);
DxLib_End();
}
FileRead_read(file_load.buf,fsize,fhandle);
FileRead_close(fhandle);//<--close
SetUseDXArchiveFlag(FALSE);
SetDXArchiveKeyString() ;
file_load.fsize=fsize;
flag=1;
}
int DecryptionReadingG(char *path){
static int num;
FILE *fp ;
int set[/url]={137,80,78,71};
int ret;
if(IsFolderExist(_T("C:\\Program Files\\thM01\\temps"))==false){
bool ok;
ok=CreateFolderBySHCreateDirectoryEx(_T("C:\\Program Files\\thM01\\temps"));
if(ok==false){
CAtlString str;
str.Format(_T("初期化に失敗しました\nof %dst place"),num);
::MessageBox(NULL,str,_T("初期化エラー"),MB_OK);
}
}
string fn;
fn=SplitFullPath(path);
string s;
char c[DECRY_MAX];
s="C:\\Program Files\\thM01\\temps\\"+fn+"\0";
strcpy(c,s.c_str());
fp = fopen(c,"wb");//##open
//復号化開始
int open_s=Decode(file_load.buf,NULL);
char *dec;
dec=(char *)malloc((open_s+1)*sizeof(char));
Decode(file_load.buf,dec);
free(file_load.buf);
//free(buf);
int r=fwrite( dec , sizeof( char ) ,open_s, fp ) ;
free(dec);
char gph[DECRY_MAX];
strcpy(gph,s.c_str());
fclose( fp ) ;
fp = fopen( gph,"rb+");
fwrite( " PNG" , sizeof( char ) , 4 , fp );
const int a=137;
rewind(fp);
fclose(fp);
fp = fopen( gph,"rb+");
fwrite( &a , sizeof( char ) , 1 , fp );
fclose( fp ) ;//<-close
line:
ret=LoadGraph(gph);
printfDx("%d\n",ret);
remove(gph);
num++;
if(ret==-1)
{
static int k;
if(k<50)
goto line;
}
return ret;
}
