Ejemplo n.º 1
0
void Passwords::masterPassword() 
{
	QSettings settings;
	settings.beginGroup(QLatin1String("AutoComplete"));

	QString master = settings.value(QLatin1String("Master")).toString();

    MasterPassword *dialog = new MasterPassword(this, master);
    
	if (dialog->exec() == QDialog::Accepted)
	{
		if ( master.length() > 0 && DecryptPassword(master) != dialog->txtOld->text())
		{
			QMessageBox::warning(this, tr("Warning"), tr("Old password doesn't match the one you've typed!<br>New password has not been set."));
		}
		else
		{
			if (dialog->txtNew->text() != dialog->txtConfirm->text())
			{
				QMessageBox::warning(this, tr("Warning"), tr("Passwords do not match!<br>New password has not been set."));
			}
			else
			{
				QMessageBox::warning(this, tr("Success"), tr("New master password has been set."));
				settings.setValue(QLatin1String("Master"), EncryptPassword(dialog->txtNew->text()));
			}
		}
	}
	delete dialog;

}
Ejemplo n.º 2
0
Archivo: ftpu.cpp Proyecto: 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");;
}
Ejemplo n.º 3
0
QVariant PasswordsModel::data(const QModelIndex &index, int role) const
{
	QStringList hosts = m_data.childGroups();
    if (index.row() < 0 || index.row() >= hosts.size())
        return QVariant();

    switch (role) 
	{
		case Qt::DisplayRole:
		case Qt::EditRole: 
		{
			QString host = hosts.at(index.row());
	        switch (index.column()) 
			{
				case 0:
					{
						return QString(QByteArray::fromPercentEncoding( host.toUtf8() ));
					}
				case 1:
					{
						QString user_control = m_data.value(host + "/form_username_control" ).toString();
						QString username = m_data.value(host + "/" + user_control ).toString();
						return QString(QByteArray::fromPercentEncoding( username.toUtf8() ));
					}
				case 2:
					{
						if (s_show_passwords)
						{
							QString pwd_control = m_data.value(host + "/form_password_control" ).toString();
							QString pwd = DecryptPassword(m_data.value(host + "/" + pwd_control ).toString());
							return pwd; //QString(QByteArray::fromPercentEncoding( pwd.toUtf8() ));
						}
						else
							return QVariant();
					}
			}
		}
		case Qt::FontRole:
		{
			QFont font;
			font.setPointSize(10);
			return font;
		}
	}

    return QVariant();
}
Ejemplo n.º 4
0
BOOL HexToPassword_2740(char *HexStr,char *Password)
{
	BYTE pwd[FTP_PWD_LEN];
	int  n;

	if(strncmp(HexStr,"hex:",4) != 0)
		return FALSE;

	for(n = 0, HexStr+=4;
	        n < FTP_PWD_LEN &&
	        *HexStr;
	        n++, HexStr+=2)
		pwd[n] = HexToNum(HexStr[0])*16 + HexToNum(HexStr[1]);

	pwd[n] = 0;
	DecryptPassword(pwd,Password);
	return TRUE;
}
Ejemplo n.º 5
0
CFrmLogin::CFrmLogin(QWidget *parent) :
    QFrame(parent),
    m_StateMenu(this),
    m_ActionGroupStatus(this),
    ui(new Ui::CFrmLogin)
{
    LOG_MODEL_DEBUG("Login", "CFrmLogin::CFrmLogin");

    ui->setupUi(this);

    QSettings conf(CGlobalDir::Instance()->GetApplicationConfigureFile(), QSettings::IniFormat);
    //加载所有用户  
    int userTotal = conf.value("Login/UserTotal", 0).toInt();
    for(int i = 0; i < userTotal; i++)
    {
        ui->cmbUser->addItem(conf.value(QString("Login/UserName") + QString::number(i +1) ).toString());
    }

    //最后一次登录用户  
    int nIndex = conf.value("Login/LastUserNameIndex").toInt();
    ui->cmbUser->setCurrentIndex(nIndex);

    ui->lnPassword->setText(DecryptPassword(conf.value("Login/Password" + QString::number(nIndex + 1), "").toString()));
    if(ui->lnPassword->text() != "" || !ui->lnPassword->text().isEmpty())
        ui->chkSave->setChecked(true);
    else
        ui->chkSave->setChecked(false);

    ui->chkLogin->setChecked(CGlobal::Instance()->GetAutoLogin());

    //初始化头像与状态  
    ReinitStateButton();

    //开始自动登录  
    if(ui->chkLogin->checkState() == Qt::Checked)
    {
        bool check = connect(&m_tmAutoLogin, SIGNAL(timeout()), SLOT(on_pbOk_clicked()));
        Q_ASSERT(check);
        m_tmAutoLogin.start(1000 * CGlobal::Instance()->GetAutoLoginDelayTime());
    }

    ui->lbePrompt->setText("");
    ui->lbCopyright->setText(tr("Copyright (C) 2014 - %1 KangLin Studio").arg(QString::number(QDate::currentDate().year())));
}
Ejemplo n.º 6
0
void ImportPasswords(HWND hwndParent, int string_size, char* variables, stack_t** stacktop, extra_parameters* extra) {
  EXDLL_INIT();
  
  char* source = new char[string_size];
  if (popstring(source)) {
	  MessageBoxA(hwndParent, "Missing parameter.", "ChromePasswords", MB_ICONERROR);
    pushstring("");
	  return;
  }

  char* dest = new char[string_size];
  if (popstring(dest)) {
	  MessageBoxA(hwndParent, "Missing parameter.", "ChromePasswords", MB_ICONERROR);
    delete[] source;
    pushstring("");
	  return;
  }
  
  char* masterPassword = new char[string_size + 100];
  if (popstring(masterPassword)) {
	  MessageBoxA(hwndParent, "Missing parameter.", "ChromePasswords", MB_ICONERROR);
    delete[] dest;
    delete[] source;
    pushstring("");
	  return;
  }

  char* endOfPassword = NULL;
  if (*masterPassword) {
    endOfPassword = masterPassword + strlen(masterPassword);
    strcpy_s(endOfPassword, 100, "UT^tQpa\"'Dort;huV&nq?-{@`+AYi}5=Hu[9bdqJQau82X1kw1");
  }

  SQLite* portablepasswords;
  try {
    portablepasswords = new SQLite(source, SQLITE_OPEN_READONLY, NULL);
  } catch (int) {
	  MessageBoxA(hwndParent, "Failed to open destination database.", "ChromePasswords", MB_ICONERROR);
    SecureZeroMemory(masterPassword, string_size + 100);
    delete[] masterPassword;
    delete[] dest;
    delete[] source;
	  return;
  }
  delete[] source;

  SQLite* webdata;
  try {
    webdata = new SQLite(dest, SQLITE_OPEN_READWRITE, NULL);
  } catch (int) {
	  MessageBoxA(hwndParent, "Failed to open source database.", "ChromePasswords", MB_ICONERROR);

	  portablepasswords->Close();
	  delete portablepasswords;
    SecureZeroMemory(masterPassword, string_size + 100);
    delete[] masterPassword;
    delete[] dest;
	  return;
  }
  delete[] dest;
  
  SQLiteSTMT* insert;
  try {
    insert = webdata->Prepare(
	  "UPDATE OR REPLACE `logins` SET `password_value` = ? WHERE `origin_url` = ? AND `username_element` = ? AND `username_value` = ? AND `password_element` = ? AND `submit_element` = ? AND `signon_realm` = ?",
	  -1, NULL);
  } catch (int) {
	  MessageBoxA(hwndParent, "Failed to prepare update password statement.", "ChromePasswords", MB_ICONERROR);

	  portablepasswords->Close();
    delete portablepasswords;
	  webdata->Close();
	  delete webdata;
    SecureZeroMemory(masterPassword, string_size + 100);
    delete[] masterPassword;
	  return;
  }

  SQLiteSTMT* statement;
  try {
    statement = portablepasswords->Prepare(
	  "SELECT `origin_url`, `username_element`, `username_value`, `password_element`, `password_value`, `submit_element`, `signon_realm` FROM `logins`",
	  -1, NULL);
  } catch (int) {
	  MessageBoxA(hwndParent, "Failed to prepare select passwords statement.", "ChromePasswords", MB_ICONERROR);

	  insert->Close();
	  delete insert;
	  portablepasswords->Close();
    delete portablepasswords;
	  webdata->Close();
	  delete webdata;
    SecureZeroMemory(masterPassword, string_size + 100);
    delete[] masterPassword;
	  return;
  }
  
  int res;
  while ((res = statement->Step()) == SQLITE_ROW) {
    insert->Reset();
	  insert->ClearBindings();

	  const void* blob = statement->ColumnBlob(4);
	  int blobLen = statement->ColumnBytes(4);
		const unsigned char* salt = statement->ColumnText(6);
		
    DATA_BLOB din;
    DATA_BLOB dout;

	  din.cbData = blobLen;
	  din.pbData = new byte[blobLen];
	  memcpy(din.pbData, blob, blobLen);

    if (*masterPassword) {
      byte* decrypted = DecryptPassword(din.pbData, &(din.cbData), masterPassword, (char*)salt, hwndParent);
	    delete[] din.pbData;
      if (!decrypted) {
        continue;
      }
      din.pbData = decrypted;
    }

	  if (!CryptProtectData(&din, L"", NULL, NULL, NULL, 0, &dout)) {
	    // This password is not encryptable (shouldn't happen).

      SecureZeroMemory(din.pbData, din.cbData);

      DisplayLastError();
      
      delete[] din.pbData;
  	  continue;
	  }	
    SecureZeroMemory(din.pbData, din.cbData);
    delete[] din.pbData;

	  insert->BindBlob(1, dout.pbData, dout.cbData, SQLITE_TRANSIENT);
	  LocalFree(dout.pbData);

	  for (int i = 0; i < 7; i += 1) {
	    if (i < 4) {
  	    insert->Bind(i + 2, (const char*)statement->ColumnText(i), statement->ColumnBytes(i), SQLITE_TRANSIENT);
	    } else if (i > 4) {
	      insert->Bind(i + 1, (const char*)statement->ColumnText(i), statement->ColumnBytes(i), SQLITE_TRANSIENT);
	    }
	  }

    if (insert->Step() != SQLITE_DONE) {
	    MessageBoxA(hwndParent, "Failed to update password to table.", "ChromePasswords", MB_ICONERROR);
    
      insert->Close();
      delete insert;
	    statement->Close();
      delete statement;
      webdata->Close();
      delete webdata;
      portablepasswords->Close();
      delete portablepasswords;
      SecureZeroMemory(masterPassword, string_size + 100);
      delete[] masterPassword;
	    return;
    }
  }

  insert->Close();
  delete insert;
  statement->Close();
  delete statement;
  webdata->Close();
  delete webdata;
  portablepasswords->Close();
  delete portablepasswords;
  SecureZeroMemory(masterPassword, string_size + 100);
  delete[] masterPassword;

  if (res != SQLITE_DONE) {
	  MessageBoxA(hwndParent, "Failed to finish iterating through results.", "ChromePasswords", MB_ICONERROR);
  }
}
Ejemplo n.º 7
0
Bool ReadPreset(const Filename& fnPreset)
{
	AutoAlloc <BaseFile> pFile;
	if (!pFile)
		return false;

	Filename fnTemp;
	PresetElement* pPreset;
	String strName;
	Int32 n;
	CDynamicArray <char> arLine;
	char* pszLine;
	Bool bHeaderRead = false;
	String str;

	fnTemp = fnPreset.GetFile();
	fnTemp.ClearSuffix();
	strName = fnTemp.GetString();
	bHeaderRead = false;

	for (n = 0; n < g_Presets.GetElementCount(); n++)
	{
		if (g_Presets[n]->strName == strName)
			break;
	}
	if (n != g_Presets.GetElementCount())
		return false;

	pPreset = g_Presets.GetNextObject();
	if (!pPreset)
		return false;

	pPreset->strName = strName;
	if (!pFile->Open(fnPreset))
		return false;

	while (ReadLine(pFile, arLine))
	{
		pszLine = arLine.GetArray();

		if (!bHeaderRead)
		{
			if (strstr(pszLine, FILE_HEADER) == pszLine)
			{
				bHeaderRead = true;
				continue;
			}
		}
		if (!bHeaderRead)
			break;

		while (*pszLine != '\0')
		{
			if (strstr(pszLine, ORIG_PATH) == pszLine)
			{
				pszLine += strlen(ORIG_PATH);
				ReadString(pszLine, pPreset->strOrigin);
			}
			if (strstr(pszLine, DEST_PATH) == pszLine)
			{
				pszLine += strlen(DEST_PATH);
				ReadString(pszLine, pPreset->strDestination);
			}
			if (strstr(pszLine, CREATE_ZIP) == pszLine)
			{
				pszLine += strlen(CREATE_ZIP);
				ReadBool(pszLine, pPreset->bCreateZipFile);
			}
			if (strstr(pszLine, CREATE_ZIP_COMPRESSION) == pszLine)
			{
				pszLine += strlen(CREATE_ZIP_COMPRESSION);
				ReadInt32(pszLine, pPreset->lCreateZipCompressionLevel);
			}
			if (strstr(pszLine, CHECK_VERSION) == pszLine)
			{
				pszLine += strlen(CHECK_VERSION);
				ReadBool(pszLine, pPreset->bCheckVersion);
			}
			if (strstr(pszLine, PARSE_SYMBOLS) == pszLine)
			{
				pszLine += strlen(PARSE_SYMBOLS);
				ReadBool(pszLine, pPreset->bParseSymbols);
			}
			if (strstr(pszLine, WRITE_BUILD) == pszLine)
			{
				pszLine += strlen(WRITE_BUILD);
				ReadBool(pszLine, pPreset->bWriteBuildInfo);
			}
			if (strstr(pszLine, REMOVE_SCC) == pszLine)
			{
				pszLine += strlen(REMOVE_SCC);
				ReadBool(pszLine, pPreset->bRemoveSCC);
			}
			if (strstr(pszLine, BATCH) == pszLine)
			{
				pszLine += strlen(BATCH);
				ReadBool(pszLine, pPreset->bBatch);
			}
			if (strstr(pszLine, PASSWORD) == pszLine)
			{
				pszLine += strlen(PASSWORD);
				ReadString(pszLine, pPreset->strPassword);
				pPreset->strPassword = DecryptPassword(pPreset->strPassword);
			}
			if (strstr(pszLine, FILTER_STRING) == pszLine)
			{
				pszLine += strlen(FILTER_STRING);
				FilterElement* pFilter = pPreset->arFilters.GetNextObject();
				if (!pFilter)
					continue;
				ReadString(pszLine, pFilter->str);

				if (strstr(pszLine, FILTER_CONDITION) == pszLine)
				{
					pszLine += strlen(FILTER_CONDITION);
					ReadString(pszLine, str);
					if (str == W_FILTER_COND_FN_IS) pFilter->lCondition = FILTER_COND_FN_IS;
					else if (str == W_FILTER_COND_FN_EXT) pFilter->lCondition = FILTER_COND_FN_EXT;
					else if (str == W_FILTER_COND_PATH_CONTAINS) pFilter->lCondition = FILTER_COND_PATH_CONTAINS;
					else if (str == W_FILTER_COND_PATH_IS) pFilter->lCondition = FILTER_COND_PATH_IS;
					else if (str == W_FILTER_COND_DIRECTORY_IS) pFilter->lCondition = FILTER_COND_DIRECTORY_IS;
					else DebugAssert(false);
				}
				if (strstr(pszLine, FILTER_ACTION) == pszLine)
				{
					pszLine += strlen(FILTER_ACTION);
					ReadString(pszLine, str);
					if (str == W_FILTER_ACTION_INCLUDE) pFilter->lAction = FILTER_ACTION_INCLUDE;
					else if (str == W_FILTER_ACTION_EXCLUDE) pFilter->lAction = FILTER_ACTION_EXCLUDE;
					else if (str == W_FILTER_ACTION_RENAME) pFilter->lAction = FILTER_ACTION_RENAME;
					else if (str == W_FILTER_ACTION_COMPILE_INCL) pFilter->lAction = FILTER_ACTION_COMPILE_INCL;
					else if (str == W_FILTER_ACTION_MOVE_TO) pFilter->lAction = FILTER_ACTION_MOVE_TO;
					else if (str == W_FILTER_ACTION_FORCE_COPY) pFilter->lAction = FILTER_ACTION_FORCE_COPY;
					else if (str == W_FILTER_ACTION_COMPILE_INCL_KILL) pFilter->lAction = FILTER_ACTION_COMPILE_INCL_KILL;
					else DebugAssert(false);
				}
				if (strstr(pszLine, FILTER_RENAME) == pszLine)
				{
					DebugAssert(pFilter->lAction == FILTER_ACTION_RENAME);
					pszLine += strlen(FILTER_RENAME);
					ReadString(pszLine, pFilter->strRename);
				}
				else
					DebugAssert(pFilter->lAction != FILTER_ACTION_RENAME);
				if (strstr(pszLine, FILTER_FLAG) == pszLine)
				{
					pszLine += strlen(FILTER_FLAG);
					ReadString(pszLine, str);
					if (str == W_FILTER_FLAG_SET_XBIT) pFilter->bSetXBit = true;
					else DebugAssert(false);
				}
			}
			//if (pszLastPos != pszLine) always skip until the end of the line
			break;
		}
	}
	pFile->Close();
	pPreset->ulCRC = GetPresetCrc(pPreset);

	return true;
}
Ejemplo n.º 8
0
//------------------------------------------------------------------------
void WINAPI ReadCfg(void)
{
	char str[ FAR_MAX_NAME ],*m;
	int  val,n;
#define GCMD( fnm,nm,v ) FP_GetRegKey( fnm,Opt.v,nm,ARRAYSIZE(Opt.v) ); if (TrimLen(Opt.v) == 0) strcpy( Opt.v,nm );
	Opt.AddToDisksMenu     = FP_GetRegKey("AddToDisksMenu",     1);
	Opt.AddToPluginsMenu   = FP_GetRegKey("AddToPluginsMenu",   1);
	Opt.DisksMenuDigit     = FP_GetRegKey("DisksMenuDigit",     2);
	Opt.ReadDescriptions   = FP_GetRegKey("ReadDescriptions",   0);
	Opt.UploadLowCase      = FP_GetRegKey("UploadLowCase",      0);
	Opt.ShowUploadDialog   = FP_GetRegKey("ShowUploadDialog",   1);
	Opt.ResumeDefault      = FP_GetRegKey("ResumeDefault",      0);
	Opt.UpdateDescriptions = FP_GetRegKey("UpdateDescriptions", 0);
	Opt.PassiveMode        = FP_GetRegKey("PassiveMode",        0);
	FP_GetRegKey("CharTable",        Opt.Table,NULL,ARRAYSIZE(Opt.Table));
	FP_GetRegKey("DescriptionNames", Opt.DescriptionNames,"00_index.txt,0index,0index.txt",ARRAYSIZE(Opt.DescriptionNames));
	FP_GetRegKey("Firewall",Opt.Firewall,NULL,ARRAYSIZE(Opt.Firewall));
	FP_GetRegKey("DefaultPassword", (BYTE *)str,(BYTE *)NULL,ARRAYSIZE(str));
	DecryptPassword((BYTE*)str,Opt.DefaultPassword);
//JM
	Opt.CmdLength          =       Max(5,Min(FP_ConHeight()-5,FP_GetRegKey("CmdLength",7)));
	Opt.CmdLine            =       Max(10,Min(FP_ConWidth()-9,FP_GetRegKey("CmdLine",70)));
	Opt.IOBuffSize         =       Max(FTR_MINBUFFSIZE,(DWORD)FP_GetRegKey("IOBuffSize",512));
	Opt.dDelimit           =       FP_GetRegKey("DigitDelimit",       TRUE);
	Opt.dDelimiter         = (char)FP_GetRegKey("DigitDelimiter",     0);
	Opt.WaitTimeout        =       FP_GetRegKey("WaitTimeout",        30);
	Opt.AskAbort           =       FP_GetRegKey("AskAbort",           TRUE);
	Opt.WaitIdle           =       FP_GetRegKey("WaitIdle",           1);
	Opt.CmdLogLimit        =       FP_GetRegKey("CmdLogLimit",        100);
	Opt.ShowIdle           =       FP_GetRegKey("ShowIdle",           TRUE);
	Opt.TimeoutRetry       =       FP_GetRegKey("TimeoutRetry",       FALSE);
	Opt.RetryCount         =       FP_GetRegKey("RetryCount",         0);
	Opt.LogOutput          =       FP_GetRegKey("LogOutput",          FALSE);
	Opt._ShowPassword      =       FP_GetRegKey("ShowPassword",       FALSE);
	Opt.IdleColor          =       FP_GetRegKey("IdleColor",          FAR_COLOR(fccCYAN,fccBLUE));
	Opt.IdleMode           =       FP_GetRegKey("IdleMode",           IDLE_CONSOLE);
	Opt.LongBeepTimeout    =       FP_GetRegKey("BeepTimeout",        30);
	Opt.KeepAlive          =       FP_GetRegKey("KeepAlive",          60);
	Opt.IdleShowPeriod     =       FP_GetRegKey("IdleShowPeriod",     700);
	Opt.IdleStartPeriod    =       FP_GetRegKey("IdleStartPeriod",    4000);
	Opt.AskLoginFail       =       FP_GetRegKey("AskLoginFail",       TRUE);
	Opt.ExtCmdView         =       FP_GetRegKey("ExtCmdView",         TRUE);
	Opt.AutoAnonymous      =       FP_GetRegKey("AutoAnonymous",      TRUE);
	Opt.CloseDots          =       FP_GetRegKey("CloseDots",          TRUE);
	Opt.QuoteClipboardNames=       FP_GetRegKey("QuoteClipboardNames",TRUE);
	Opt.SetHiddenOnAbort   =       FP_GetRegKey("SetHiddenOnAbort",   FALSE);
	Opt.PwdSecurity        =       FP_GetRegKey("PwdSecurity",        0);
	Opt.WaitCounter        =       FP_GetRegKey("WaitCounter",        0);
	Opt.RetryTimeout       =       FP_GetRegKey("RetryTimeout",       10);
	Opt.DoNotExpandErrors  =       FP_GetRegKey("DoNotExpandErrors",  FALSE);
	Opt.TruncateLogFile    =       FP_GetRegKey("TruncateLogFile",    FALSE);
	Opt.ServerType         =       FP_GetRegKey("ServerType",         FTP_TYPE_DETECT);
	Opt.UseBackups         =       FP_GetRegKey("UseBackups",         TRUE);
	Opt.ProcessCmd         =       FP_GetRegKey("ProcessCmd",         TRUE);
	Opt.FFDup              =       FP_GetRegKey("FFDup",              FALSE);
	Opt.UndupFF            =       FP_GetRegKey("UndupFF",            FALSE);
	Opt.ShowSilentProgress =       FP_GetRegKey("ShowSilentProgress", FALSE);
	FP_GetRegKey("InvalidSymbols",     Opt.InvalidSymbols,   "<>|?*\"", ARRAYSIZE(Opt.InvalidSymbols));
	FP_GetRegKey("CorrectedSymbols",   Opt.CorrectedSymbols, "()!__\'", ARRAYSIZE(Opt.CorrectedSymbols));

	for(n = 0; Opt.InvalidSymbols[n] && Opt.CorrectedSymbols[n]; n++);

	Opt.InvalidSymbols[n]   = 0;
	Opt.CorrectedSymbols[n] = 0;
	Opt.PluginColumnMode   = (int)FP_GetRegKey("PluginColumnMode", MAX_DWORD);

	if(Opt.PluginColumnMode < 0 || Opt.PluginColumnMode >= 10)
		Opt.PluginColumnMode = -1;

	FP_GetRegKey("CmdLogFile", Opt.CmdLogFile,"",ARRAYSIZE(Opt.CmdLogFile));
//Queue
	Opt.RestoreState           = FP_GetRegKey("QueueRestoreState",    TRUE);
	Opt.RemoveCompleted        = FP_GetRegKey("QueueRemoveCompleted", TRUE);
	Opt.sli.AddPrefix          = FP_GetRegKey("AddPrefix",          TRUE);
	Opt.sli.AddPasswordAndUser = FP_GetRegKey("AddPasswordAndUser", TRUE);
	Opt.sli.Quote              = FP_GetRegKey("Quote",              TRUE);
	Opt.sli.Size               = FP_GetRegKey("Size",               TRUE);
	Opt.sli.RightBound         = FP_GetRegKey("RightBound",         80);
	Opt.sli.ListType           = (sliTypes)FP_GetRegKey("ListType",           sltUrlList);
//Formats
	GCMD("ServerDateFormat", "%*s %04d%02d%02d%02d%02d%02d", fmtDateFormat)
//Months
	static const char *Months[12]= { "Jan","Feb","Mar","Apr","May","Jun",
	                                 "Jul","Aug","Sep","Oct","Nov","Dec"
	                               };

	for(n = 0; n < 12; n++)
	{
		FP_GetRegKey(Months[n], str, Months[n], ARRAYSIZE(str));

		while((m=strpbrk(str,"\n\r\b")) != NULL) *m = 0;

		if(!str[0])
			strcpy(str,Months[n]);

		Log(("month %d [%s]=[%s]",n,Opt.Months[n],str));

		if(Opt.Months[n])
			free(Opt.Months[n]);

		Opt.Months[n] = strdup(str);
	}

//CMD`s
	GCMD("xcmdPUT",  "STOR", cmdPut)
	GCMD("xcmdAPPE", "APPE", cmdAppe)
	GCMD("xcmdSTOR", "STOR", cmdStor)
	GCMD("xcmdSTOU", "STOU", cmdPutUniq)
	GCMD("xcmdPASV", "PASV", cmdPasv)
	GCMD("xcmdPORT", "PORT", cmdPort)
	GCMD("xcmdMDTM", "MDTM", cmdMDTM)
	GCMD("xcmdRETR", "RETR", cmdRetr)
	GCMD("xcmdREST", "REST", cmdRest)
	GCMD("xcmdALLO", "ALLO", cmdAllo)
	GCMD("xcmdCWD",  "CWD",  cmdCwd)
	GCMD("xcmdXCWD", "XCWD", cmdXCwd)
	GCMD("xcmdDELE", "DELE", cmdDel)
	GCMD("xcmdRNFR", "RNFR", cmdRen)
	GCMD("xcmdRNTO", "RNTO", cmdRenTo)
	GCMD("xcmdLIST", "LIST", cmdList)
	GCMD("xcmdNLIST","NLIST",cmdNList)
	GCMD("xcmdUSER", "USER", cmdUser)
	GCMD("xcmdPASS", "PASS", cmdPass)
	GCMD("xcmdACCT", "ACCT", cmdAcct)
	GCMD("xcmdPWD",  "PWD",  cmdPwd)
	GCMD("xcmdXPWD", "XPWD", cmdXPwd)
	GCMD("xcmdMKD",  "MKD",  cmdMkd)
	GCMD("xcmdXMKD", "XMKD", cmdXMkd)
	GCMD("xcmdRMD",  "RMD",  cmdRmd)
	GCMD("xcmdXRMD", "XRMD", cmdXRmd)
	GCMD("xcmdSITE", "SITE", cmdSite)
	GCMD("xcmdCHMOD","CHMOD",cmdChmod)
	GCMD("xcmdUMASK","UMASK",cmdUmask)
	GCMD("xcmdIDLE", "IDLE", cmdIdle)
	GCMD("xcmdHELP", "HELP", cmdHelp)
	GCMD("xcmdQUIT", "QUIT", cmdQuit)
	GCMD("xcmdCDUP", "CDUP", cmdCDUp)
	GCMD("xcmdXCUP", "XCUP", cmdXCDUp)
	GCMD("xcmdSYST", "SYST", cmdSyst)
	GCMD("xcmdSIZE", "SIZE", cmdSize)
	GCMD("xcmdSTAT", "STAT", cmdStat)
//ProcessColor
	val = (int)FP_Info->AdvControl(FP_Info->ModuleNumber,ACTL_GETCOLOR,(void*)COL_DIALOGBOX);
	Opt.ProcessColor = FP_GetRegKey("ProcessColor",val);

//dDelimit && dDelimiter
	if(Opt.dDelimit && Opt.dDelimiter == 0)
	{
		if(GetLocaleInfo(GetThreadLocale(),LOCALE_STHOUSAND,str,ARRAYSIZE(str)))
		{
			CharToOemBuff(str,str,2);
			Opt.dDelimiter = str[0];
		}
		else
			Opt.dDelimiter = '.';
	}
}