Commit 58c00745 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 4015e8ba
...@@ -198,7 +198,6 @@ void CPPTFileReader::ReadEncryptedSummary() ...@@ -198,7 +198,6 @@ void CPPTFileReader::ReadEncryptedSummary()
if (!pStream) return; if (!pStream) return;
SRecordHeader oHeader; SRecordHeader oHeader;
ULONG nRd = 0;
if (oHeader.ReadFromStream(pStream) == false ) if (oHeader.ReadFromStream(pStream) == false )
{ {
...@@ -225,12 +224,10 @@ void CPPTFileReader::ReadDocumentSummary() ...@@ -225,12 +224,10 @@ void CPPTFileReader::ReadDocumentSummary()
void CPPTFileReader::ReadPictures() void CPPTFileReader::ReadPictures()
{ {
if (m_oDocumentInfo.m_arUsers.empty()) return; if (m_oDocumentInfo.m_arUsers.empty()) return;
CFStreamPtr pStream = GetPictureStream(); CFStreamPtr pStream = GetPictureStream();
if (!pStream) return; if (!pStream) return;
SRecordHeader oHeader;
ULONG nRd = 0;
CRYPT::ECMADecryptor *pDecryptor = m_oDocumentInfo.m_arUsers[0]->m_pDecryptor; CRYPT::ECMADecryptor *pDecryptor = m_oDocumentInfo.m_arUsers[0]->m_pDecryptor;
while (true) while (true)
...@@ -238,25 +235,32 @@ void CPPTFileReader::ReadPictures() ...@@ -238,25 +235,32 @@ void CPPTFileReader::ReadPictures()
if (pStream->isEOF()) if (pStream->isEOF())
break; break;
int pos = pStream->getStreamPointer(); int pos = pStream->getStreamPointer();
POLE::Stream * pStreamTmp = pStream->stream_; SRecordHeader oHeader;
if (pDecryptor) if (pDecryptor)
{ {
m_oDocumentInfo.m_arUsers[0]->DecryptStream(pStreamTmp, 0); BYTE pHeader[8];
pStreamTmp = m_oDocumentInfo.m_arUsers[0]->m_arStreamDecrypt.back()->stream_; pStream->read(pHeader, 8);
pDecryptor->Decrypt((char*)pHeader, 8, 0);
unsigned short rec =0;
memcpy(&rec, pHeader + 0, 2);
memcpy(&oHeader.RecType,pHeader + 2, 2);
memcpy(&oHeader.RecLen, pHeader + 4, 4);
} oHeader.RecInstance = rec >> 4;
oHeader.ReadFromStream(pStreamTmp); oHeader.RecVersion = rec - (oHeader.RecInstance << 4);
}
else
oHeader.ReadFromStream(pStream->stream_);
CRecordOfficeArtBlip art_blip; CRecordOfficeArtBlip art_blip;
art_blip.m_strTmpDirectory = m_strTmpDirectory; art_blip.m_strTmpDirectory = m_strTmpDirectory;
art_blip.m_oDocumentInfo = &m_oDocumentInfo; art_blip.m_oDocumentInfo = &m_oDocumentInfo;
//
pStream->seekFromBegin(pos + 8);
pStreamTmp = pStream->stream_; //каждое поле отдельно нужно
art_blip.ReadFromStream(oHeader, pStreamTmp); art_blip.ReadFromStream(oHeader, pStream->stream_);
m_oDocumentInfo.m_mapStoreImageFile[ pos ] = art_blip.m_sFileName; m_oDocumentInfo.m_mapStoreImageFile[ pos ] = art_blip.m_sFileName;
pStream->seekFromBegin(pos + oHeader.RecLen + 8); pStream->seekFromBegin(pos + oHeader.RecLen + 8);
......
...@@ -643,14 +643,14 @@ namespace NSPresentationEditor ...@@ -643,14 +643,14 @@ namespace NSPresentationEditor
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void CMetaHeader::FromStream(POLE::Stream* pStream, CRYPT::ECMADecryptor *pDecryptor) void CMetaHeader::FromStream(POLE::Stream* pStream, CRYPT::ECMADecryptor *pDecryptor)
{ {
int size = 34; BYTE pData[34];
BYTE* pData = new BYTE[size]; pStream->read(pData, 34);
pStream->read(pData, size);
if (pDecryptor) if (pDecryptor)
{ {
pDecryptor->Decrypt((char*)pData, size, 0); pDecryptor->Decrypt((char*)pData, 34, 0);
} }
MemoryStream memStream(pData, size, false); MemoryStream memStream(pData, 34, false);
cbSize = memStream.ReadUInt32(); cbSize = memStream.ReadUInt32();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment