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");; }
void PasswordToHex(char *Password,char *HexStr) { int n; BYTE pwd[FTP_PWD_LEN]; MakeCryptPassword(Password,pwd); strcpy(HexStr,"hex:"); for(n = 0,HexStr += 4; n < FTP_PWD_LEN && pwd[n]; Password++,n++) { sprintf(HexStr,"%02x",pwd[n]); HexStr+=2; } }
//------------------------------------------------------------------------ void WINAPI WriteCfg(void) { //Dialog FP_SetRegKey("AddToDisksMenu", Opt.AddToDisksMenu); FP_SetRegKey("DisksMenuDigit", Opt.DisksMenuDigit); FP_SetRegKey("AddToPluginsMenu", Opt.AddToPluginsMenu); FP_SetRegKey("PluginColumnMode", Opt.PluginColumnMode); FP_SetRegKey("ReadDescriptions", Opt.ReadDescriptions); FP_SetRegKey("UpdateDescriptions", Opt.UpdateDescriptions); FP_SetRegKey("UploadLowCase", Opt.UploadLowCase); FP_SetRegKey("ShowUploadDialog", Opt.ShowUploadDialog); FP_SetRegKey("ResumeDefault", Opt.ResumeDefault); FP_SetRegKey("WaitTimeout", Opt.WaitTimeout); FP_SetRegKey("ShowIdle", Opt.ShowIdle); FP_SetRegKey("IdleColor", Opt.IdleColor); FP_SetRegKey("IdleMode", Opt.IdleMode); FP_SetRegKey("KeepAlive", Opt.KeepAlive); FP_SetRegKey("IdleShowPeriod", Opt.IdleShowPeriod); FP_SetRegKey("IdleStartPeriod", Opt.IdleStartPeriod); FP_SetRegKey("TimeoutRetry", Opt.TimeoutRetry); FP_SetRegKey("RetryCount", Opt.RetryCount); FP_SetRegKey("BeepTimeout", Opt.LongBeepTimeout); FP_SetRegKey("AskAbort", Opt.AskAbort); FP_SetRegKey("WaitIdle", Opt.WaitIdle); FP_SetRegKey("DigitDelimit", Opt.dDelimit); FP_SetRegKey("DigitDelimiter", (int)Opt.dDelimiter); FP_SetRegKey("ExtCmdView", Opt.ExtCmdView); FP_SetRegKey("CmdLine", Opt.CmdLine); FP_SetRegKey("CmdLength", Opt.CmdLength); FP_SetRegKey("IOBuffSize", Opt.IOBuffSize); FP_SetRegKey("ProcessColor", Opt.ProcessColor); FP_SetRegKey("ServerType", Opt.ServerType); FP_SetRegKey("ProcessCmd", Opt.ProcessCmd); FP_SetRegKey("QueueRestoreState", Opt.RestoreState); FP_SetRegKey("QueueRemoveCompleted", Opt.RemoveCompleted); FP_SetRegKey("DescriptionNames", Opt.DescriptionNames); BYTE CryptedPassword[FTP_PWD_LEN]; MakeCryptPassword(Opt.DefaultPassword,CryptedPassword); FP_SetRegKey("DefaultPassword", CryptedPassword,ARRAYSIZE(CryptedPassword)-1); FP_SetRegKey("Firewall", Opt.Firewall); FP_SetRegKey("CmdLogLimit", Opt.CmdLogLimit); FP_SetRegKey("CmdLogFile", Opt.CmdLogFile); FP_SetRegKey("LogOutput", Opt.LogOutput); FP_SetRegKey("PassiveMode", Opt.PassiveMode); FP_SetRegKey("AutoAnonymous", Opt.AutoAnonymous); FP_SetRegKey("CloseDots", Opt.CloseDots); FP_SetRegKey("QuoteClipboardNames", Opt.QuoteClipboardNames); FP_SetRegKey("SetHiddenOnAbort", Opt.SetHiddenOnAbort); FP_SetRegKey("PwdSecurity", Opt.PwdSecurity); FP_SetRegKey("WaitCounter", Opt.WaitCounter); FP_SetRegKey("RetryTimeout", Opt.RetryTimeout); FP_SetRegKey("DoNotExpandErrors", Opt.DoNotExpandErrors); FP_SetRegKey("TruncateLogFile", Opt.TruncateLogFile); FP_SetRegKey("ServerType", Opt.ServerType); FP_SetRegKey("UseBackups", Opt.UseBackups); FP_SetRegKey("ProcessCmd", Opt.ProcessCmd); FP_SetRegKey("FFDup", Opt.FFDup); FP_SetRegKey("UndupFF", Opt.UndupFF); FP_SetRegKey("ShowSilentProgress", Opt.ShowSilentProgress); FP_SetRegKey("AskLoginFail", Opt.AskLoginFail); FP_SetRegKey("InvalidSymbols", Opt.InvalidSymbols); FP_SetRegKey("CorrectedSymbols", Opt.CorrectedSymbols); //Queue FP_SetRegKey("QueueRestoreState", Opt.RestoreState); FP_SetRegKey("QueueRemoveCompleted", Opt.RemoveCompleted); FP_SetRegKey("AddPrefix", Opt.sli.AddPrefix); FP_SetRegKey("AddPasswordAndUser", Opt.sli.AddPasswordAndUser); FP_SetRegKey("Quote", Opt.sli.Quote); FP_SetRegKey("Size", Opt.sli.Size); FP_SetRegKey("RightBound", Opt.sli.RightBound); FP_SetRegKey("ListType", Opt.sli.ListType); }