#include "rar.hpp"
CmdExtract::CmdExtract(CommandData *Cmd)
{ … }
CmdExtract::~CmdExtract()
{ … }
void CmdExtract::FreeAnalyzeData()
{ … }
void CmdExtract::DoExtract()
{ … }
void CmdExtract::ExtractArchiveInit(Archive &Arc)
{ … }
EXTRACT_ARC_CODE CmdExtract::ExtractArchive()
{ … }
bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
{ … }
void CmdExtract::UnstoreFile(ComprDataIO &DataIO,int64 DestUnpSize)
{ … }
bool CmdExtract::ExtractFileCopy(File &New,const std::wstring &ArcName,const std::wstring &RedirName,const std::wstring &NameNew,const std::wstring &NameExisting,int64 UnpSize)
{ … }
void CmdExtract::ExtrPrepareName(Archive &Arc,const std::wstring &ArcFileName,std::wstring &DestName)
{ … }
#ifdef RARDLL
bool CmdExtract::ExtrDllGetPassword()
{
if (!Cmd->Password.IsSet())
{
if (Cmd->Callback!=NULL)
{
wchar PasswordW[MAXPASSWORD];
*PasswordW=0;
if (Cmd->Callback(UCM_NEEDPASSWORDW,Cmd->UserData,(LPARAM)PasswordW,ASIZE(PasswordW))==-1)
*PasswordW=0;
if (*PasswordW==0)
{
char PasswordA[MAXPASSWORD];
*PasswordA=0;
if (Cmd->Callback(UCM_NEEDPASSWORD,Cmd->UserData,(LPARAM)PasswordA,ASIZE(PasswordA))==-1)
*PasswordA=0;
CharToWide(PasswordA,PasswordW,ASIZE(PasswordW));
cleandata(PasswordA,sizeof(PasswordA));
}
Cmd->Password.Set(PasswordW);
cleandata(PasswordW,sizeof(PasswordW));
Cmd->ManualPassword=true;
}
if (!Cmd->Password.IsSet())
return false;
}
return true;
}
#endif
#ifndef RARDLL
bool CmdExtract::ExtrGetPassword(Archive &Arc,const std::wstring &ArcFileName,RarCheckPassword *CheckPwd)
{ … }
#endif
#if defined(_WIN_ALL) && !defined(SFX_MODULE)
void CmdExtract::ConvertDosPassword(Archive &Arc,SecPassword &DestPwd)
{
if (Arc.Format==RARFMT15 && Arc.FileHead.HostOS==HOST_MSDOS)
{
wchar PlainPsw[MAXPASSWORD];
Cmd->Password.Get(PlainPsw,ASIZE(PlainPsw));
char PswA[MAXPASSWORD];
CharToOemBuffW(PlainPsw,PswA,ASIZE(PswA));
PswA[ASIZE(PswA)-1]=0;
CharToWide(PswA,PlainPsw,ASIZE(PlainPsw));
DestPwd.Set(PlainPsw);
cleandata(PlainPsw,sizeof(PlainPsw));
cleandata(PswA,sizeof(PswA));
}
}
#endif
void CmdExtract::ExtrCreateDir(Archive &Arc,const std::wstring &ArcFileName)
{ … }
bool CmdExtract::ExtrCreateFile(Archive &Arc,File &CurFile)
{ … }
bool CmdExtract::CheckUnpVer(Archive &Arc,const std::wstring &ArcFileName)
{ … }
#ifndef SFX_MODULE
void CmdExtract::AnalyzeArchive(const std::wstring &ArcName,bool Volume,bool NewNumbering)
{ … }
#endif
#ifndef SFX_MODULE
void CmdExtract::GetFirstVolIfFullSet(const std::wstring &SrcName,bool NewNumbering,std::wstring &DestName)
{ … }
#endif
bool CmdExtract::CheckWinLimit(Archive &Arc,std::wstring &ArcFileName)
{ … }