예제 #1
0
파일: ftpu.cpp 프로젝트: elfmz/far2l
void main(int argc,char *argv[])
{
	CTArgInit(argc,argv,FALSE);

	if(argc < 2 || CTArgCheck("?"))
	{
		printf("USAGE: FTPU <command>\n"
		       "Where commands are:\n"
		       " -<H>ash=<text>    - creates password hash\n"
		       " -<P>wd=<hash>     - decode password from hash\n"
		       " -<P>wd=hex:<hash> - decode password from FTP file or registry format\n"
		       "");
		return;
	}

	LPCSTR m;
	BYTE     b[FTP_PWD_LEN];
	char     str[MAX_PATH];

	if((m=CTArgGet("h;hash")) != NULL)
	{
		MakeCryptPassword(m, b);
		printf("Hash for \"%s\" is:\n",m);
		PPwd(b);
	}
	else if((m=CTArgGet("p;pwd")) != NULL)
	{
		ReadPwd(b,m);
		DecryptPassword(b, str);
		printf("The password is: [%s]\n",str);
	}
	else
		printf("Command missing or mitsmatch!\n");;
}
예제 #2
0
pchar MYRTLEXP CTGetArgPathName( CONSTSTR arg, CONSTSTR def, char *str, int sz )
  {  CONSTSTR m;

     if ( (m=CTArgGet(arg)) == NULL )
       StrCpy( str, MakePathName( GetStartupDir(NULL), def ).c_str(), sz );
      else {
#if defined(__HWIN32__)
       ExpandEnvironmentStrings( m, str, sz );
#else

//??Def expand on QNX

       StrCpy( str, m, sz );
#endif

       if ( !IsAbsolutePath(str) )
         StrCpy( str, MakeStartLocalPath(str).c_str(), sz );
     }

 return str;
}