亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ziparchive.cpp

?? 允許創建
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
		{
			m_storage.m_pFile->Seek(uStartOffset + TotalWritten, CFile::begin);
			m_storage.m_pFile->Write(buf, size_read);
		}
		TotalWritten += size_read;
	}
	while (size_read == BytesToCopy);
	if (uTotalToWrite != TotalWritten)
		ThrowError(CZipException::generic);
	DWORD uRemoved = (uEndOffset - uStartOffset);
	m_storage.m_pFile->SetLength(m_storage.m_pFile->GetLength() - uRemoved);
	return uRemoved;
}


void CZipArchive::DeleteInternal(WORD uIndex)
{
	CZipFileHeader* pfh = m_centralDir.m_headers[uIndex];
	DWORD uOtherOffsetChanged = 0;
	
	if (uIndex == GetNoEntries() - 1) // last entry or the only one entry
		m_storage.m_pFile->SetLength(pfh->m_uOffset + m_centralDir.m_uBytesBeforeZip);						
	else
		uOtherOffsetChanged = RemovePackedFile(pfh->m_uOffset, m_centralDir.m_headers[uIndex + 1]->m_uOffset);
	
	
	m_centralDir.RemoveFile(uIndex);
	
	// teraz uaktualnij offsety w pozosta硑ch pozycjach central dir 
	// (update offsets in file headers in the central dir)
	if (uOtherOffsetChanged)
		for (int i = uIndex; i < GetNoEntries(); i++)
			m_centralDir.m_headers[i]->m_uOffset -= uOtherOffsetChanged;
}

bool CZipArchive::IsDriveRemovable(LPCTSTR lpszFilePath)
{
	return GetDriveType(GetDrive(lpszFilePath)) == DRIVE_REMOVABLE;
}

CString CZipArchive::GetDrive(LPCTSTR lpszFilePath)
{
	TCHAR szDrive[_MAX_DRIVE];
	_tsplitpath(lpszFilePath, szDrive, NULL, NULL, NULL);
	return szDrive;
}

bool CZipArchive::AddNewFile(LPCTSTR lpszFilePath,  
							 int iLevel,          
                             bool bFullPath,      
                             ZIPCALLBACKFUN pCallback,
                             void* pUserData,         
                             unsigned long nBufSize)
{
	if (!nBufSize)
		return false;
	
	CZipFileHeader header;
	header.SetFileName(bFullPath ? GetFileDirAndName(lpszFilePath) : GetFileName(lpszFilePath));
	if (header.GetFileNameSize() == 0)
		return false;
	if (!OpenNewFile(header, iLevel, lpszFilePath))
		return false;
	
	if (!IsDirectory(header.m_uExternalAttr))
	{
		CFile f;
		CFileException* e = new CFileException;
		BOOL bRet = f.Open(lpszFilePath, CFile::modeRead | CFile::shareDenyWrite, e);
		e->Delete();
		if (!bRet)
			return false;
		
		DWORD iRead, iFileLength = pCallback ? f.GetLength() : 0, iSoFar = 0;
		CZipAutoBuffer buf(nBufSize);
		do
		{
			iRead = f.Read(buf, nBufSize);
			if (iRead)
			{
				WriteNewFile(buf, iRead);
				iSoFar += iRead;
				if (pCallback)
					if (!pCallback(iFileLength, iSoFar, pUserData))
						break;
			}
		}
		while (iRead == buf.GetSize());
	}
	CloseNewFile();
	return true;
}

int CZipArchive::GetSpanMode()
{
	return m_storage.m_iSpanMode * m_storage.IsSpanMode();
}

CString CZipArchive::GetArchivePath()
{
	return m_storage.m_pFile->GetFilePath();
}

CString CZipArchive::GetGlobalComment()
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return _T("");
	}
	CString temp;	
	if (SingleToWide(m_centralDir.m_pszComment, temp) != -1)
		return temp;
	else 
		return _T("");
}

bool CZipArchive::SetGlobalComment(const CString &szComment)
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return false;
	}
	if (m_storage.IsSpanMode() == -1)
	{
		TRACE(_T("You cannot modify the global comment of the existing disk spanning archive.\n"));
		return false;
	}

	WideToSingle(szComment, m_centralDir.m_pszComment);
	m_centralDir.RemoveFromDisk();
	return true;
}

bool CZipArchive::IsDirectory(DWORD uAttr)
{
	return (uAttr & FILE_ATTRIBUTE_DIRECTORY) != 0;
}

int CZipArchive::GetCurrentDisk()
{
	return m_storage.GetCurrentDisk() + 1;
}

bool CZipArchive::SetFileComment(WORD uIndex, CString szComment)
{
	if (IsClosed())
	{
		TRACE(_T("ZipArchive is closed.\n"));
		return false;
	}
	if (m_storage.IsSpanMode() == -1)
	{
		TRACE(_T("You cannot modify the file comment in the existing disk spanning archive.\n"));
		return false;
	}
	
	if (!m_centralDir.IsValidIndex(uIndex))
		return false;
	m_centralDir.m_headers[uIndex]->SetComment(szComment);
	m_centralDir.RemoveFromDisk();
	return true;
}

int CZipArchive::CompareWords(const void *pArg1, const void *pArg2)
{
	WORD w1 = *(WORD*)pArg1;
	WORD w2 = *(WORD*)pArg2;
	return w1 == w2 ? 0 :(w1 < w2 ? - 1 : 1);
}

void CZipArchive::CryptInitKeys()
{
	ASSERT(m_pszPassword.GetSize());
	m_keys[0] = 305419896L;
	m_keys[1] = 591751049L;
	m_keys[2] = 878082192L;
	for (DWORD i = 0; i < m_pszPassword.GetSize(); i++)
		CryptUpdateKeys(m_pszPassword[i]);
}

void CZipArchive::CryptUpdateKeys(char c)
{
	
	m_keys[0] = CryptCRC32(m_keys[0], c);
	m_keys[1] += m_keys[0] & 0xff;
	m_keys[1] = m_keys[1] * 134775813L + 1;
	c = char(m_keys[1] >> 24);
	m_keys[2] = CryptCRC32(m_keys[2], c);
}

bool CZipArchive::CryptCheck()
{
	CZipAutoBuffer buf(ENCR_HEADER_LEN);
	m_storage.Read(buf, ENCR_HEADER_LEN, false);
	BYTE b = 0;
	for (int i = 0; i < ENCR_HEADER_LEN; i++)
	{
		b = buf[i]; // only temporary
		CryptDecode((char&)b);
	}
	// check the last byte
	if (CurrentFile()->IsDataDescr()) // Data descriptor present
		return BYTE(CurrentFile()->m_uModTime >> 8) == b;
	else
		return BYTE(CurrentFile()->m_uCrc32 >> 24) == b;
}

char CZipArchive::CryptDecryptByte()
{
	int temp = (m_keys[2] & 0xffff) | 2;
	return (char)(((temp * (temp ^ 1)) >> 8) & 0xff);
}

void CZipArchive::CryptDecode(char &c)
{
	c ^= CryptDecryptByte();
	CryptUpdateKeys(c);
}

bool CZipArchive::SetPassword(LPCTSTR lpszPassword)
{
	if (m_iFileOpened != nothing)
	{
		TRACE(_T("You cannot change the password when the file is opened\n"));
		return false; // it's important not to change the password when the file inside archive is opened
	}
	if (IsClosed())
	{
		TRACE(_T("Setting the password for a closed archive has no effect.\n"));
	}
	if (lpszPassword)
	{
		int iLen = WideToSingle(lpszPassword, m_pszPassword);
		if (iLen == -1)
			return false;
		for (size_t i = 0; (int)i < iLen; i++)
			if (m_pszPassword[i] > 127)
			{
				m_pszPassword.Release();
				TRACE(_T("The password contains forbidden characters. Password cleared.\n"));
				return false;
			}
	}
	else
		m_pszPassword.Release();
	return true;
}

DWORD CZipArchive::CryptCRC32(DWORD l, char c)
{
	const DWORD *CRC_TABLE = get_crc_table();
	return CRC_TABLE[(l ^ c) & 0xff] ^ (l >> 8);
}

void CZipArchive::CryptCryptHeader(long iCrc, CZipAutoBuffer &buf)
{
	CryptInitKeys();
	srand(UINT(GetTickCount()*time(NULL)));
	// genereate pseudo-random sequence
	char c;
	for (int i = 0; i < ENCR_HEADER_LEN - 2; i++)
	{
		int t1 = rand();
		c = (char)(t1 >> 6);
		if (!c)
			c = (char)t1;
		CryptEncode(c);
		buf[i] = c;

	}
	c = (char)((iCrc >> 16) & 0xff);
	CryptEncode(c);
	buf[ENCR_HEADER_LEN - 2] = c;
	c = (char)((iCrc >> 24) & 0xff);
	CryptEncode(c);
	buf[ENCR_HEADER_LEN - 1] = c;
}

void CZipArchive::CryptEncode(char &c)
{
	char t = CryptDecryptByte();
	CryptUpdateKeys(c);
	c ^= t;
}

void CZipArchive::CryptEncodeBuffer()
{
	if (CurrentFile()->IsEncrypted())
		for (DWORD i = 0; i < m_info.m_uComprLeft; i++)
			CryptEncode(m_info.m_pBuffer[i]);
}

void CZipArchive::CloseFileAfterTestFailed()
{
	if (m_iFileOpened != extract)
	{
		TRACE(_T("No file opened.\n"));
		return;
	}
	m_info.m_pBuffer.Release();
	m_centralDir.Clear(false);
	m_iFileOpened = nothing;
}

bool CZipArchive::TestFile(WORD uIndex, ZIPCALLBACKFUN pCallback, void* pUserData, DWORD uBufSize)
{
	if (!uBufSize)
		return false;
	CZipFileHeader* pHeader = m_centralDir.m_headers[uIndex];
	if (IsFileDirectory(uIndex))
	{
		
			// we do not test whether the password for the encrypted directory
		// is correct, since it seems to be senseless (anyway password 
		// encrypted directories should be avoided - it adds 12 bytes)
		DWORD iSize = pHeader->m_uComprSize;
		if ((iSize != 0 || iSize != pHeader->m_uUncomprSize)
			// different treating compressed directories
			&& !(pHeader->IsEncrypted() && iSize == 12 && !pHeader->m_uUncomprSize))
			ThrowError(CZipException::dirWithSize);
		return true;
	}
	else
	{
		try
		{
			if (!OpenFile(uIndex))
				return false;
			CZipAutoBuffer buf(uBufSize);
			DWORD iRead, iSoFar = 0;
			do
			{	
				iRead = ReadFile(buf, buf.GetSize());
				iSoFar += iRead;
				if (pCallback)
					if (!pCallback(pHeader->m_uUncomprSize, iSoFar, pUserData))
						break;
			}
			while (iRead == buf.GetSize());
			CloseFile();
		}
		catch(CException*)
		{
			CloseFileAfterTestFailed();
			throw;
		}
	}
	return true;

}

int CZipArchive::WideToSingle(LPCTSTR lpWide, CZipAutoBuffer &szSingle)
{
	size_t wideLen = _tcslen(lpWide);
	if (wideLen == 0)
	{
		szSingle.Release();
		return 0;
	}

#ifdef _UNICODE	
	// iLen does not include terminating character
	int iLen = WideCharToMultiByte(CP_ACP,0, lpWide, wideLen, szSingle, 
		0, NULL, NULL);
	if (iLen > 0)
	{
		szSingle.Allocate(iLen, true);
		iLen = WideCharToMultiByte(CP_ACP,0, lpWide , wideLen, szSingle, 
			iLen, NULL, NULL);
		ASSERT(iLen != 0);
	}
	else // here it means error
	{
		szSingle.Release();
		iLen --;
	}
	return iLen;
		
#else // if not UNICODE just copy
	// 	iLen does not include the NULL character
	szSingle.Allocate(wideLen);
	memcpy(szSingle, lpWide, wideLen);
	return wideLen;
#endif

}

int CZipArchive::SingleToWide(CZipAutoBuffer &szSingle, CString& szWide)
{
	int singleLen = szSingle.GetSize();
#ifdef _UNICODE	
	// iLen doesn't include terminating character
	int iLen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szSingle, singleLen, NULL, 0);
	if (iLen > 0)
	{
		iLen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szSingle, singleLen, 
			szWide.GetBuffer(iLen) , iLen);
		szWide.ReleaseBuffer(iLen);
		ASSERT(iLen != 0);
	}
	else
	{
		szWide.Empty();
		iLen --;
	}
	return iLen;

#else // if not UNICODE just copy
	// 	iLen does not include the NULL character
	memcpy(szWide.GetBuffer(singleLen), szSingle, singleLen);
	szWide.ReleaseBuffer(singleLen);
	return singleLen;
#endif
}

const DWORD* CZipArchive::GetCRCTable()
{
	return get_crc_table();
}

void CZipArchive::CryptDecodeBuffer(DWORD uCount)
{
	if (CurrentFile()->IsEncrypted())
		for (DWORD i = 0; i < uCount; i++)
			CryptDecode(m_info.m_pBuffer[i]);
}

void CZipArchive::EmptyPtrList()
{
	if (m_list.GetCount())
	{
		// if some memory hasn't been freed due to an error in zlib, so free it now
		POSITION pos = m_list.GetHeadPosition();
		while (pos)
			delete[] m_list.GetNext(pos);
	}

}



void CZipArchive::EnableFindFast(bool bEnable)
{
	if (IsClosed())
	{
		TRACE(_T("Set it after opening the archive"));
		return;
	}

	if (m_centralDir.m_bFindFastEnabled == bEnable)
		return;
	m_centralDir.m_bFindFastEnabled = bEnable;
	if (bEnable)
		m_centralDir.BuildFindFastArray();
	else
		m_centralDir.m_findarray.RemoveAll();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片一区二区| 在线观看成人小视频| 欧美sm极限捆绑bd| 久久成人av少妇免费| 久久精品夜夜夜夜久久| 成人精品国产免费网站| 一区二区视频在线| 欧美蜜桃一区二区三区| 韩国视频一区二区| 亚洲欧洲日韩女同| 欧美日韩精品一区视频| 捆绑变态av一区二区三区| 久久网站热最新地址| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美狂野另类xxxxoooo| 日本亚洲电影天堂| 国产午夜亚洲精品午夜鲁丝片| av在线综合网| 日韩电影在线观看网站| 久久久久久久综合日本| 色欧美日韩亚洲| 日韩av一二三| 国产精品毛片高清在线完整版| 日本韩国欧美一区| 欧美aaa在线| 欧美激情一区二区三区| 欧美系列日韩一区| 国产精品一区2区| 亚洲制服丝袜av| 久久久久久亚洲综合影院红桃| 色婷婷综合激情| 国产在线视频一区二区| 亚洲欧美日韩一区| 欧美mv日韩mv国产| 在线亚洲+欧美+日本专区| 国内精品久久久久影院一蜜桃| 亚洲精品视频在线看| 26uuu精品一区二区| 色老汉一区二区三区| 国产一区91精品张津瑜| 午夜一区二区三区视频| 中文字幕久久午夜不卡| 欧美草草影院在线视频| 在线视频你懂得一区二区三区| 国模娜娜一区二区三区| 天堂久久久久va久久久久| 中文字幕va一区二区三区| 欧美一区二区国产| 欧美日韩一区二区在线观看视频| 国产69精品久久777的优势| 美女被吸乳得到大胸91| 亚洲电影在线免费观看| 中文字幕在线视频一区| 2019国产精品| 日韩欧美视频一区| 7777精品伊人久久久大香线蕉经典版下载 | 一本大道av一区二区在线播放| 国产综合色在线视频区| 美女脱光内衣内裤视频久久影院| 亚洲另类一区二区| 国产精品色呦呦| 久久亚洲春色中文字幕久久久| 欧美一区二区三区四区五区| 欧美性xxxxx极品少妇| a美女胸又www黄视频久久| 国产成人小视频| 国产乱子轮精品视频| 极品美女销魂一区二区三区| 美女免费视频一区二区| 久久精品久久99精品久久| 日本中文在线一区| 五月激情综合婷婷| 日一区二区三区| 日韩专区一卡二卡| 婷婷久久综合九色综合绿巨人 | 一区二区三区高清不卡| 1区2区3区欧美| 亚洲男人的天堂在线aⅴ视频| 中文字幕在线观看不卡视频| 美女视频黄 久久| 久久精品国产亚洲一区二区三区| 石原莉奈在线亚洲二区| 日韩国产精品久久久| 日本欧美一区二区| 国产综合色视频| 国产成a人亚洲精品| av中文字幕在线不卡| 91丝袜国产在线播放| 色www精品视频在线观看| 91精品蜜臀在线一区尤物| 日韩视频免费直播| 久久综合九色综合97婷婷| 久久久蜜臀国产一区二区| 中文字幕电影一区| 有码一区二区三区| 亚洲成人7777| 精品一区二区三区在线观看| 国产成人综合自拍| 色综合久久综合| 正在播放亚洲一区| 欧美精品一区二| 中文字幕在线免费不卡| 亚洲电影一区二区三区| 激情综合网激情| 成人看片黄a免费看在线| 欧美亚洲一区二区在线观看| 欧美一级夜夜爽| 日本一区二区视频在线| 亚洲最快最全在线视频| 美女免费视频一区| 成人黄动漫网站免费app| 欧美日韩你懂的| 久久久久国产成人精品亚洲午夜 | 久久你懂得1024| 一区二区三区波多野结衣在线观看 | 日韩欧美aaaaaa| 国产精品国产馆在线真实露脸 | 国产成人午夜精品影院观看视频 | 亚洲精品一线二线三线| 亚洲欧洲日产国产综合网| 三级欧美在线一区| 国产69精品久久99不卡| 欧美日韩精品一区二区在线播放| 久久久www免费人成精品| 一区二区免费看| 国产精品一区专区| 717成人午夜免费福利电影| 国产精品久久久99| 久久国产精品色婷婷| 色综合中文综合网| 亚洲综合视频在线观看| 国产精品一级二级三级| 欧美精品三级日韩久久| 国产精品国产馆在线真实露脸| 美美哒免费高清在线观看视频一区二区 | 丁香六月久久综合狠狠色| 欧美日韩第一区日日骚| 亚洲欧洲日韩在线| 国产一区不卡精品| 日韩一级黄色大片| 亚洲国产一区二区a毛片| 国产成人午夜视频| 精品少妇一区二区三区| 婷婷一区二区三区| 在线观看亚洲一区| 中文字幕第一区二区| 国产精品正在播放| 精品日韩一区二区三区免费视频| 一区二区三区四区蜜桃| 99re这里只有精品首页| 国产亚洲美州欧州综合国| 精品无人码麻豆乱码1区2区| 欧美一区二区三区免费观看视频| 一区二区欧美精品| 日本久久一区二区| 亚洲三级在线免费观看| 成人妖精视频yjsp地址| 国产女人18毛片水真多成人如厕 | 国产精品一区二区久激情瑜伽| 日韩一级免费一区| 另类人妖一区二区av| 日韩一级片网址| 美女视频免费一区| 日韩精品一区在线| 国产综合久久久久久鬼色 | 综合激情成人伊人| 97久久精品人人澡人人爽| 亚洲欧美在线观看| 91农村精品一区二区在线| 中文字幕亚洲精品在线观看 | 欧美综合久久久| 亚洲女子a中天字幕| 在线观看精品一区| 亚洲mv在线观看| 日韩精品一区二区三区中文不卡| 久久电影网电视剧免费观看| 26uuu久久综合| 国产成人精品三级| 中文字幕在线一区免费| 色婷婷久久99综合精品jk白丝| 亚洲综合久久久| 欧美日韩国产精品成人| 久久99精品国产麻豆婷婷洗澡| 欧美不卡一二三| 国产精品一品视频| 综合欧美亚洲日本| 欧美顶级少妇做爰| 国产综合色在线视频区| 国产精品三级电影| 在线看一区二区| 日韩av网站免费在线| 久久毛片高清国产| 99麻豆久久久国产精品免费| 亚洲国产一区二区在线播放| 精品久久久网站| 岛国一区二区在线观看| 亚洲综合色丁香婷婷六月图片| 欧美日韩激情一区二区三区| 韩国理伦片一区二区三区在线播放| 国产精品久久久久久妇女6080|