游戏文件包逆向笔记
// 替换文件名中的/ 去掉文件名开头的.\ 处理文件名中的空格
int ProcessPackName(char * PackName) //sub_DCD400
{
unsigned int StringLen;
StringLen = strlen(PackName);
for (int i = 0; i < StringLen; ++i )
{
if ( PackName[i] == '/' )
PackName[i]= '\\';
}
if ( StringLen > 2 && PackName[0] == '.' && PackName[1] == '\\' )
{
StringLen=StringLen-2;
if ( StringLen> 0 )
{
memcpy(PackName,PackName[2], StringLen);
}
PackName[StringLen] = 0;
}
for ( int j = strlen(PackName) - 1; j>=0; --j )
{
if PackName[j] != ' ' )
break;
PackName[j+1] = 0;
}
return 1;
}
posted on 2013-05-30 23:07 findmehere 阅读(481) 评论(0) 编辑 收藏 举报