CString CWYRGame::CryptPassword(CString strPWD)
{
int pwdLen = strPWD.GetLength() + 1;
char* pEnPassword = new char[pwdLen];
char* pPassword = new char[pwdLen];
memcpy(pPassword, strPWD.GetString(), pwdLen);
int i = 0;
char tmpChar;
//int size = strlen( in );
while (pPassword != '\0')
{
tmpChar = pPassword;
pEnPassword = (tmpChar & 0x80) | ((2 * (tmpChar & 2 | (2 * (tmpChar & 4 | ((tmpChar & 1) << 4))))) | (((tmpChar & 0x40) | (((tmpChar & 0x28) | ((tmpChar >> 2) & 4)) >> 1)) >> 1));
i++;
}
pEnPassword = '\0';
CString retStr = pEnPassword;
delete[] pEnPassword;
delete[] pPassword;
return retStr;
}上面这段C语言 怎么翻成 Delphi 的,懂的朋友帮忙下,谢
{
int pwdLen = strPWD.GetLength() + 1;
char* pEnPassword = new char[pwdLen];
char* pPassword = new char[pwdLen];
memcpy(pPassword, strPWD.GetString(), pwdLen);
int i = 0;
char tmpChar;
//int size = strlen( in );
while (pPassword != '\0')
{
tmpChar = pPassword;
pEnPassword = (tmpChar & 0x80) | ((2 * (tmpChar & 2 | (2 * (tmpChar & 4 | ((tmpChar & 1) << 4))))) | (((tmpChar & 0x40) | (((tmpChar & 0x28) | ((tmpChar >> 2) & 4)) >> 1)) >> 1));
i++;
}
pEnPassword = '\0';
CString retStr = pEnPassword;
delete[] pEnPassword;
delete[] pPassword;
return retStr;
}上面这段C语言 怎么翻成 Delphi 的,懂的朋友帮忙下,谢
解决方案 »
- 大哥大姐大叔大嫂们,我要制作一个delphi的通用查询器,可是不知道接口怎么弄?哪位高手帮我一下,我将万分感谢
- 请教算法大师:取这样的字符串,有何好方法
- 新手求助
- 各位高手,请给小妹赐教
- 请大家帮我找一个错误,我是在weizhisheng写的文章里考的一段代码,可运行老出错.谢谢哟!
- 加了一个三角,高兴,散分!
- 文件备份!!急
- foxpro打开一张表的时候,我的delphi程序就访问不了我的表了,怎么解决?
- fastreport怎样实现打印当前记录
- 怎么计算一个磁盘文件的校检和,用checksummappedfile吗?
- 请教关于 MD5和base64加密问题
- delphi 发送短信问题,...........
{
tmpChar = pPassword;
pEnPassword = (tmpChar & 0x80) | ((2 * (tmpChar & 2 | (2 * (tmpChar & 4 | ((tmpChar & 1) << 4))))) | (((tmpChar & 0x40) | (((tmpChar & 0x28) | ((tmpChar >> 2) & 4)) >> 1)) >> 1));
i++;
}这个循环好像有问题:只是递增i,pPassword没任何变化,会死循环的