📄 common.cpp
字号:
return;
atcount=0;
i=0;
j=0;
bpoint=0;
brac=false;
name=(unsigned char *)(*nme);
while(name[i])
{ if(name[i]=='@')
{ atcount++;
if(atcount>1)
{ buff[j++]=':';
buff[j++]=':';
}
}
else if((name[i]=='$')&&(name[i+1]=='q')&&(!brac))
{ brac=true;
bpoint=j;
buff[j++]='(';
i+=1;
}
else if((name[i]=='$')&&(name[i+1]=='x')&&(name[i+2]=='q')&&(!brac))
{ brac=true;
bpoint=j;
buff[j++]='(';
i+=2;
}
else if(!strnicmp((char *)&name[i],"$bctr",5))
{ k=0;
while((buff[k]!=':')&&(k<20))
{ buff[j++]=buff[k++];
}
i+=4;
}
else if(!strnicmp((char *)&name[i],"$bdtr",5))
{ k=0;
buff[j++]='~';
while((buff[k]!=':')&&(k<20))
{ buff[j++]=buff[k++];
}
i+=4;
}
else if(!strnicmp((char *)&name[i],"$bdla",5))
{ strcpy((char *)&buff[j],"delete");
j+=6;
i+=4;
}
else if(!strnicmp((char *)&name[i],"$bnwa",5))
{ strcpy((char *)&buff[j],"new");
j+=3;
i+=4;
}
else if(!strnicmp((char *)&name[i],"$bdele",6))
{ strcpy((char *)&buff[j],"delete");
j+=6;
i+=5;
}
else if(!strnicmp((char *)&name[i],"$bnew",5))
{ strcpy((char *)&buff[j],"new");
j+=5;
i+=4;
}
else
buff[j++]=name[i];
i++;
}
if(brac)
buff[j++]=')';
buff[j]=0;
strcpy((char *)buff2,(char *)buff);
if(brac)
{ j=bpoint;
k=bpoint;
i=0;
pointer=false;
rpointer=false;
while(buff[j])
{ if((buff[j]=='p')&&(!i))
{ pointer=true;
j++;
}
if((buff[j]=='r')&&(!i))
{ rpointer=true;
j++;
}
else if((buff[j]=='i')&&(!i))
{ i=1;
strcpy((char *)&buff2[k],"int");
k+=3;
j+=1;
}
else if((buff[j]=='c')&&(!i))
{ i=1;
strcpy((char *)&buff2[k],"char");
k+=4;
j+=1;
}
else if((buff[j]=='v')&&(!i))
{ i=1;
strcpy((char *)&buff2[k],"void");
k+=4;
j+=1;
}
else if((buff[j]=='l')&&(!i))
{ i=1;
strcpy((char *)&buff2[k],"long");
k+=4;
j+=1;
}
else if((buff[j]=='u')&&(buff[j+1]=='i')&&(!i))
{ i=1;
strcpy((char *)&buff2[k],"uint");
k+=4;
j+=2;
}
else if((buff[j]==':')&&(buff[j+1]==':')&&(i))
{ strcpy((char *)&buff2[k],"::");
k+=2;
j+=2;
}
else if((buff[j]=='t')&&((buff[j+1]>='0')&&(buff[j+1]<='9'))&&(!i))
{ buff2[k++]=buff[j++];
buff2[k++]=buff[j++];
i=1;
}
else if(((buff[j]>='0')&&(buff[j]<='9'))&&(!i))
{ i=buff[j]-'0';
j++;
if((buff[j]>='0')&&(buff[j]<='9'))
{ i=i*10+buff[j]-'0';
j++;
}
i++;
}
else
buff2[k++]=buff[j++];
if(i)
{ i--;
if(!i)
{ if((pointer)&&(buff2[k-1]!=')'))
buff2[k++]='*';
if((rpointer)&&(buff2[k-1]!=')'))
buff2[k++]='&';
if((buff[j]!=')')&&(buff2[k-1]!=')'))
buff2[k++]=',';
pointer=false;
rpointer=false;
}
}
}
buff2[k]=0;
}
namelen=strlen((char *)buff2);
//BugFix Build 15 nme-> *nme.
delete *nme;
name=new unsigned char[namelen+1];
strcpy((char *)name,(char *)buff2);
*nme=(char *)name;
}
/************************************************************************
* init_ofn *
* - initialises the OPENFILENAME struct used in calls to common dialogs *
* callers can then change options further as needed *
************************************************************************/
void init_ofn(OPENFILENAME *ofn)
{ int cbString,i;
char chReplace;
static char szDirName[MAX_PATH*2];
static char szFilesave[MAX_PATH*2];
static char szFilter[MAX_PATH];
static char szFileTitle[MAX_PATH*2];
GetCurrentDirectory(MAX_PATH,szDirName);
szFilesave[0]=0;
cbString=LoadString(hInst,IDS_FILTERSTRING,szFilter,sizeof(szFilter));
chReplace=szFilter[cbString-1];
for(i=0;szFilter[i]!=0;i++)
{ if(szFilter[i]==chReplace)
szFilter[i]=0;
}
ofn->lStructSize=sizeof(OPENFILENAME);
ofn->hwndOwner=mainwindow;
ofn->hInstance=NULL;
ofn->lpstrFilter=szFilter;
ofn->lpstrCustomFilter=NULL;
ofn->nMaxCustFilter=0;
ofn->nFilterIndex=1;
ofn->lpstrFile=szFilesave;
ofn->nMaxFile=sizeof(szFilesave)/2;
ofn->lpstrFileTitle=szFileTitle;
ofn->nMaxFileTitle=sizeof(szFileTitle)/2;
ofn->lpstrInitialDir=szDirName;
ofn->lpstrTitle="Borg Disassembler - Select File";
ofn->Flags=OFN_PATHMUSTEXIST|OFN_HIDEREADONLY|OFN_LONGNAMES
|OFN_EXPLORER;
ofn->nFileOffset=0;
ofn->nFileExtension=NULL;
ofn->lpstrDefExt=NULL;
ofn->lCustData=0;
ofn->lpfnHook=NULL;
ofn->lpTemplateName=NULL;
}
/************************************************************************
* getfiletoload *
* - obtains a filename for the file to be loaded *
* used for new files to load, and load database file *
* sets fname to the filename *
************************************************************************/
void getfiletoload(char *fname)
{ OPENFILENAME ofn;
init_ofn(&ofn);
ofn.Flags|=OFN_FILEMUSTEXIST;
GetOpenFileName(&ofn);
strcpy(fname,ofn.lpstrFile);
}
/************************************************************************
* getfiletosave *
* - obtains a filename for the file to be saved *
* sets fname to the filename *
************************************************************************/
void getfiletosave(char *fname)
{ OPENFILENAME ofn;
init_ofn(&ofn);
GetSaveFileName(&ofn);
strcpy(fname,ofn.lpstrFile);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -