int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("Invalid argument number!\n");
return -1;
}
char psz_dest[64];
char psz_src[64];
char psz_crypt_pwd[64];
char psz_crypt_pwd_2nd[64];
int i_iterator;
int i_iterator_2nd;
int i_esc;
memset(psz_dest, 0x0, sizeof(psz_dest));
memset(psz_src, 0x0, sizeof(psz_src));
memset(psz_crypt_pwd, 0x0, sizeof(psz_crypt_pwd));
memset(psz_crypt_pwd_2nd, 0x0, sizeof(psz_crypt_pwd_2nd));
i_iterator = 0;
i_iterator_2nd = 0;
i_esc = 0;
strcpy(psz_crypt_pwd, argv[1]);
for (i_iterator = 0; i_iterator <= strlen(psz_crypt_pwd); i_iterator++)
{
if (psz_crypt_pwd[i_iterator] == '\\' && (psz_crypt_pwd[i_iterator + 1] == '#'
|| psz_crypt_pwd[i_iterator + 1] == '=' || psz_crypt_pwd[i_iterator + 1] == ':'
|| psz_crypt_pwd[i_iterator + 1] == '!' || psz_crypt_pwd[i_iterator + 1] == '\\'))
{
psz_crypt_pwd_2nd[i_iterator_2nd++] = psz_crypt_pwd[i_iterator + 1];
i_iterator+=1;
i_esc = 1;
}
else
{
psz_crypt_pwd_2nd[i_iterator_2nd++] = psz_crypt_pwd[i_iterator];
}
}
if (0 != i_esc && psz_crypt_pwd_2nd[0] == '\''
&& psz_crypt_pwd_2nd[strlen(psz_crypt_pwd_2nd) - 1] == '\'')
{
psz_crypt_pwd_2nd[strlen(psz_crypt_pwd_2nd) - 1] = '\0';
strcpy(psz_src, psz_crypt_pwd_2nd + 1);
}
else
{
strcpy(psz_src, psz_crypt_pwd_2nd);
}
sleep(1/1000000);
if (0 != dms_decrypt(psz_dest, psz_src))
{
printf("Failed to decrypt %s\n", psz_src);
return -1;
}
printf("%s\n",psz_dest);
return 0;
}
阅读(822) | 评论(0) | 转发(0) |