Compare commits

..

5 Commits

Author SHA1 Message Date
cd12777c68 up 2017-06-22 18:27:00 +03:00
0708c1f45a . 2017-06-22 12:32:00 +03:00
ee577e629a DocFormat - fix user file 2017-06-21 19:50:02 +03:00
f230dc2555 add binary test (file as resource) 2017-06-21 18:36:06 +03:00
11c9d74e68 fix bug #35161 2017-06-21 17:16:00 +03:00
16 changed files with 362 additions and 257 deletions

View File

@ -507,9 +507,9 @@ namespace DocFileFormat
class FileInformationBlock
{
public:
bool m_bOlderVersion;
int m_CodePage;
FibBase m_FibBase;
bool m_bOlderVersion;
int m_CodePage;
FibBase m_FibBase;
RgW97 m_RgW97;
RgLw97 m_RgLw97;

View File

@ -0,0 +1,60 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "RegularContainer.h"
namespace DocFileFormat
{
class OfficeArtFRITContainer: public RegularContainer
{
public:
static const unsigned short TYPE_CODE_0xF118 = 0xF118;
OfficeArtFRITContainer () : RegularContainer()
{
}
OfficeArtFRITContainer (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : RegularContainer (_reader, size, typeCode, version, instance)
{
}
virtual ~OfficeArtFRITContainer()
{
}
virtual Record* NewObject (IBinaryReader* _reader, unsigned int bodySize, unsigned int typeCode, unsigned int version, unsigned int instance)
{
return new OfficeArtFRITContainer( _reader, bodySize, typeCode, version, instance );
}
};
}

View File

@ -50,6 +50,7 @@
#include "GroupShapeRecord.h"
#include "OfficeArtClientTextbox.h"
#include "UnknownRecord.h"
#include "OfficeArtFRITContainer.h"
namespace DocFileFormat
{
@ -135,6 +136,7 @@ namespace DocFileFormat
case GroupContainer::TYPE_CODE_0xF003 : return new GroupContainer();
case GroupShapeRecord::TYPE_CODE_0xF009 : return new GroupShapeRecord ();
case OfficeArtClientTextbox::TYPE_CODE_0xF00D : return new OfficeArtClientTextbox ();
case OfficeArtFRITContainer::TYPE_CODE_0xF118 : return new OfficeArtFRITContainer ();
default:
return new UnknownRecord();

View File

@ -247,9 +247,8 @@ namespace DocFileFormat
{
freeform = false;
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())));
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
}
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
if (pShape->is<LineType>())
{
@ -446,7 +445,7 @@ namespace DocFileFormat
{
yCoord = iter->op;
}break;
// OUTLINE
// LINE
case lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
@ -493,6 +492,21 @@ namespace DocFileFormat
{
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ));
}break;
case cxstyle:
{
if (pShape->GetShapeType() == NULL)
{
freeform = false;
m_pXmlWriter->WriteAttribute(L"type", L"#_x0000_t32");
}
switch(iter->op)
{
case 0: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"straight"); break;
case 1: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"elbow"); break;
case 2: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"curved"); break;
case 3: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"none"); break;
}
}break;
// FILL
case fillColor:
{
@ -544,6 +558,14 @@ namespace DocFileFormat
appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ));
}
}break;
case fillBlipName:
{
std::wstring name;
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex.get(), iter->op, ENCODING_UTF16);
if (!name.empty())
appendValueAttribute(&m_fill, L"o:title", FormatUtils::XmlEncode(name));
}break;
case fillOpacity:
{
appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ));

View File

@ -64,7 +64,8 @@ long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring
m_pReader = new CPPTFileReader(pStgFrom, m_strTempDirectory);
CPPTFileReader* pptReader = (CPPTFileReader*)m_pReader;
pptReader->m_oDocumentInfo.m_strFileDirectory= GetDirectory(sFileName.c_str());
pptReader->m_oDocumentInfo.m_strFileDirectory = GetDirectory(sFileName.c_str());
pptReader->m_oDocumentInfo.m_strPassword = password;
if (pptReader->IsPowerPoint() == false)
{
@ -73,14 +74,14 @@ long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring
return AVS_ERROR_FILEFORMAT;
}
if (pptReader->ReadPersistDirectory() == false)
return AVS_ERROR_FILEFORMAT;
if (pptReader->ReadPersists() == false)
return AVS_ERROR_FILEFORMAT;
if (pptReader->IsEncrypted())
{
CEncryptionHeader *pEncryptionHeader = pptReader->GetEncryptionHeader();
if (password.empty()) return AVS_ERROR_DRM;
if (!pEncryptionHeader) return AVS_ERROR_FILEFORMAT;
if (password.empty()) return AVS_ERROR_DRM;
if (pEncryptionHeader->bStandard)
{
@ -92,7 +93,8 @@ long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring
}
if (DecryptOfficeFile(&Decryptor) == false) return AVS_ERROR_DRM;
return OpenFile(m_sTempDecryptFileName, L"");
return AVS_ERROR_PASSWORD;
//return OpenFile(m_sTempDecryptFileName, L"");
}
else
{
@ -106,12 +108,15 @@ long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring
}
if (DecryptOfficeFile(&Decryptor) == false) return AVS_ERROR_DRM;
return OpenFile(m_sTempDecryptFileName, L"");
return AVS_ERROR_PASSWORD;
pptReader->ReadDocument(&Decryptor);
//return OpenFile(m_sTempDecryptFileName, L"");
}
}
else
{
pptReader->ReadSlideList();
pptReader->ReadDocument(NULL);
m_Status = READMODE;
}

View File

@ -40,6 +40,7 @@ public:
std::vector<CPPTUserInfo*> m_arUsers;
std::wstring m_strFileDirectory;
std::map<int, std::wstring> m_mapStoreImageFile;
std::wstring m_strPassword;
CPPTDocumentInfo() : m_oCurrentUser(), m_arUsers()
{
@ -63,7 +64,7 @@ public:
}
}
bool ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream, std::wstring strFolderMem)
bool ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream)
{
m_oCurrentUser.FromAtom(pCurrentUser);
@ -86,8 +87,9 @@ public:
pInfo->m_strFileDirectory = m_strFileDirectory;
pInfo->m_bEncrypt = m_oCurrentUser.m_bIsEncrypt;
pInfo->m_strPassword = m_strPassword;
bool bResult = pInfo->ReadFromStream(&oUserAtom, pStream, strFolderMem);
bool bResult = pInfo->ReadFromStream(&oUserAtom, pStream);
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
@ -104,13 +106,16 @@ public:
pInfo = NULL;
}
if (m_arUsers.empty() == false)
{
if (m_arUsers[0]->m_bEncrypt == false)
{
m_arUsers[0]->FromDocument();
}
}
return true;
}
bool LoadDocument(std::wstring strFolderMem)
{
if (m_arUsers.empty()) return false;
m_arUsers[0]->ReadExtenalObjects(strFolderMem);
m_arUsers[0]->FromDocument();
return true;
}
};

View File

@ -47,6 +47,7 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
m_mapMasters(),
m_mapNotes(),
m_mapSlides(),
m_bEncrypt(false),
m_arOffsetPictures()
{
m_pDocumentInfo = NULL;
@ -128,7 +129,7 @@ void CPPTUserInfo::Clear()
m_arOffsetPictures.clear();
}
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem)
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream)
{
m_oUser.FromAtom(pUser);
@ -149,8 +150,9 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
oPersist.ReadFromStream(oHeader, pStream);
oPersist.ToMap(&m_mapOffsetInPIDs);
//--------------------------------------------------------------------------------------------------
CRYPT::ECMADecryptor *pDecryptor = NULL;
std::map<DWORD, DWORD>::iterator pPair = m_mapOffsetInPIDs.find(m_oUser.m_nEncryptRef);
if (pPair != m_mapOffsetInPIDs.end())
{
StreamUtils::StreamSeek(pPair->second, pStream);
@ -161,7 +163,17 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
m_bEncrypt = true;
m_oEncryptionHeader.ReadFromStream(oHeader, pStream);
return true;
pDecryptor = new CRYPT::ECMADecryptor();
pDecryptor->SetCryptData(m_oEncryptionHeader.crypt_data_aes);
if (pDecryptor->SetPassword(m_strPassword) == false)
{
delete pDecryptor;
pDecryptor = NULL;
//return true;
}
return true;//read persis decrypt
}
}
//--------------------------------------------------------------------------------------------------
@ -170,15 +182,45 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (pPair == m_mapOffsetInPIDs.end())
return false;
StreamUtils::StreamSeek(pPair->second, pStream);
DWORD offset_stream = pPair->second;
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
if (RECORD_TYPE_DOCUMENT != oHeader.RecType)
if (pDecryptor)
{
return false;
}
POLE::Storage *pStorageOut = NULL;
POLE::Stream *pStreamTmp = NULL;
m_oDocument.ReadFromStream(oHeader, pStream);
std::wstring sTemp = m_strFileDirectory + FILE_SEPARATOR_STR + L"~tempFile.ppt";
pStorageOut = new POLE::Storage(sTemp.c_str());
pStorageOut->open(true, true);
pStreamTmp = new POLE::Stream(pStorageOut, "Tmp", true, oHeader.RecLen);
unsigned char* data_stream = new unsigned char[oHeader.RecLen];
pStream->read(data_stream, oHeader.RecLen);
pDecryptor->Decrypt((char*)data_stream, oHeader.RecLen, m_oUser.m_nDocumentRef);
pStreamTmp->write(data_stream, oHeader.RecLen);
pStreamTmp->flush();
pStreamTmp->seek(0);
m_oDocument.ReadFromStream(oHeader, pStreamTmp);
delete pStream;
delete pStorageOut;
//NSFile::DeleteFile(sTemp);
}
else
{
if (RECORD_TYPE_DOCUMENT != oHeader.RecType)
{
return false;
}
m_oDocument.ReadFromStream(oHeader, pStream);
}
Clear();
@ -190,11 +232,12 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (nIndexPsrRef != m_mapOffsetInPIDs.end())
{
long offset = (long)nIndexPsrRef->second;
offset_stream = nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
CRecordSlide* pSlide = new CRecordSlide();
pSlide->ReadFromStream(oHeader, pStream);
pSlide->m_oPersist = m_oDocument.m_arMasterPersists[index];
@ -215,8 +258,8 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
offset_stream = nIndexPsrRef->second;
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
CRecordSlide* pSlide = new CRecordSlide();
@ -240,9 +283,9 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
offset_stream = (long)nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
@ -283,9 +326,9 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
offset_stream = nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
@ -300,9 +343,9 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
offset_stream = nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
StreamUtils::StreamSeek(offset_stream, pStream);
oHeader.ReadFromStream(pStream);
@ -314,7 +357,11 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
m_mapHandoutMasters.insert( std::pair<DWORD, CRecordSlide*>(0, pSlide ));
}
}
return true;
}
//--------------------------------------------------------------------------------------------
void CPPTUserInfo::ReadExtenalObjects(std::wstring strFolderMem)
{
// так... теперь берем всю инфу о ExObject -----------------------------
m_oExMedia.m_strPresentationDirectory = strFolderMem;
m_oExMedia.m_strSourceDirectory = m_strFileDirectory;
@ -364,20 +411,12 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
m_arrFonts.push_back(oFont);
}
//FromDocument();
// FromDocument - должен вызываться после того, как загрузятся все (!!!) юзеры
// теперь заполним пустые картинки
//std::vector<CRecordBlipStoreContainer*> oArray;
m_oDocument.GetRecordsByType(&m_arrBlipStore, true, true);
if (0 < m_arrBlipStore.size())
{
m_bIsSetupEmpty = TRUE;
m_arrBlipStore[0]->SetUpPicturesInfos(&m_arOffsetPictures);
}
return TRUE;
}
void CPPTUserInfo::FromDocument()

View File

@ -50,6 +50,7 @@ public:
CEncryptionHeader m_oEncryptionHeader;
bool m_bEncrypt;
std::wstring m_strPassword;
std::map<DWORD, CRecordSlide*> m_mapSlides;
std::map<DWORD, CRecordSlide*> m_mapMasters;
@ -122,7 +123,8 @@ public:
void Clear();
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem);
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream);
void ReadExtenalObjects(std::wstring strFolderMem);
void FromDocument();
void NormalizeCoords(long lWidth, long lHeight);

View File

@ -56,7 +56,6 @@ public:
m_bIsPPTFile(false),
m_pDocStream(NULL),
m_pPictureStream(NULL),
m_lImagesCount(0),
m_strMemoryForder(strTemp),
m_oDocumentInfo()
{
@ -114,7 +113,7 @@ public:
if (m_oDocumentInfo.m_arUsers.empty())
return m_oDocumentInfo.m_oCurrentUser.m_bIsEncrypt; //wps не выставляет флаг!
return &m_oDocumentInfo.m_arUsers[0]->m_bEncrypt;
return m_oDocumentInfo.m_arUsers[0]->m_bEncrypt;
}
CEncryptionHeader* GetEncryptionHeader()
{
@ -122,26 +121,14 @@ public:
return &m_oDocumentInfo.m_arUsers[0]->m_oEncryptionHeader;
}
bool ReadPersistDirectory()
bool ReadPersists()
{
// нужно вызывать РОВНО один раз...
bool bRes = SavePictures();
return m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, GetDocStream(), m_strMemoryForder);
return m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, GetDocStream());
}
void ReadSlideList()
void ReadDocument(CRYPT::ECMADecryptor *pDecryptor)
{
if (m_oDocumentInfo.m_arUsers.size() > 0)
{
DWORD nPID = m_oDocumentInfo.m_arUsers[0]->m_oUser.m_nDocumentRef;
std::map<DWORD, DWORD>::iterator pPair = m_oDocumentInfo.m_arUsers[0]->m_mapOffsetInPIDs.find(nPID);
if (pPair == m_oDocumentInfo.m_arUsers[0]->m_mapOffsetInPIDs.end()) return;
DWORD offset = pPair->second;
StreamUtils::StreamSeek((long)offset, GetDocStream());
}
ReadPictures(pDecryptor);
m_oDocumentInfo.LoadDocument(m_strMemoryForder);
}
protected:
@ -194,20 +181,13 @@ protected:
return m_pPictureStream;
}
bool SavePictures()
void ReadPictures(CRYPT::ECMADecryptor *pDecryptor)
{
POLE::Stream* pStream = GetPictureStream();
if (NULL == pStream) return;
if (NULL == pStream)
{
return false;
}
SRecordHeader oHeader;
ULONG nRd = 0;
m_lImagesCount = 0;
// удаление картинок при завершении программы
while (true)
{
@ -220,11 +200,39 @@ protected:
art_blip.m_strMemoryForder = m_strMemoryForder;
art_blip.m_oDocumentInfo = &m_oDocumentInfo;
art_blip.ReadFromStream(oHeader, pStream);
if (pDecryptor)
{
POLE::Storage *pStorageOut = NULL;
POLE::Stream *pStreamTmp = NULL;
std::wstring sTemp = m_strMemoryForder + FILE_SEPARATOR_STR + L"~tempFile.ppt";
pStorageOut = new POLE::Storage(sTemp.c_str());
pStorageOut->open(true, true);
pStreamTmp = new POLE::Stream(pStorageOut, "Tmp", true, oHeader.RecLen);
unsigned char* data_stream = new unsigned char[oHeader.RecLen];
pStream->read(data_stream, oHeader.RecLen);
pDecryptor->Decrypt((char*)data_stream, oHeader.RecLen, 0);
pStreamTmp->write(data_stream, oHeader.RecLen);
pStreamTmp->flush();
pStreamTmp->seek(0);
art_blip.ReadFromStream(oHeader, pStreamTmp);
delete pStream;
delete pStorageOut;
//NSFile::DeleteFile(sTemp);
}
else
{
art_blip.ReadFromStream(oHeader, pStream);
}
}
return true;
}
private:
bool m_bDualStorage;
@ -239,7 +247,6 @@ public:
std::wstring m_strMemoryForder;
std::vector<bool> m_arLoadImageFlags;
DWORD m_lImagesCount;
CPPTDocumentInfo m_oDocumentInfo;
};

View File

@ -35,11 +35,13 @@
#include "../Reader/ReadStructures.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h"
#include "../../../Common/3dParty/pole/pole.h"
#include "../../../OfficeCryptReader/source/CryptTransform.h"
using namespace NSPresentationEditor;
struct SRecordHeader
class SRecordHeader
{
public:
BYTE RecVersion;
USHORT RecInstance;
USHORT RecType;
@ -48,7 +50,8 @@ struct SRecordHeader
SRecordHeader()
{
RecVersion = 0;
RecInstance = RecType = 0;
RecInstance = 0;
RecType = 0;
RecLen = 0;
}

View File

@ -41,7 +41,7 @@ protected:
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
virtual unsigned int GetDefaultDiscardBytes() const {return 0;}
FixedSizeSecBlock<byte, 512> m_state;
FixedSizeSecBlock<byte, 256> m_state;
byte m_x, m_y;
};

View File

@ -381,8 +381,8 @@ bool EncryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYP
return true;
}
ARC4::Decryption rc4Decryption;
//CipherARCFOUR rc4Decryption;
//ARC4::Decryption rc4Decryption;
CipherARCFOUR rc4Decryption;
bool DecryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYPT_METHOD::_cipherAlgorithm algorithm,
StreamTransformationFilter::BlockPaddingScheme padding = StreamTransformationFilter::NO_PADDING)
@ -398,8 +398,8 @@ bool DecryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRY
}
else if (algorithm == CRYPT_METHOD::RC4)
{
//rc4Decryption.Decode(data_inp.ptr, data_inp.size, data_out.ptr, data_out.size);
rc4Decryption.ProcessData(data_out.ptr, data_inp.ptr, data_inp.size);
rc4Decryption.Decode(data_inp.ptr, data_inp.size, data_out.ptr, data_out.size);
//rc4Decryption.ProcessData(data_out.ptr, data_inp.ptr, data_inp.size);
}
else //AES
{
@ -485,7 +485,10 @@ bool ECMADecryptor::SetPassword(std::wstring _password)
CorrectHashSize(verifierKey, 16, 0); //40-bit crypt key !!!
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
rc4Decryption.SetKey(verifierKey.ptr, verifierKey.size);
{
//rc4Decryption.SetKey(verifierKey.ptr, verifierKey.size);
rc4Decryption.Init(CipherARCFOUR::rtl_Cipher_DirectionDecode, verifierKey.ptr, verifierKey.size, 0, 0);
}
//--------------------------------------------
_buf decryptedVerifierHashInputBytes;
@ -512,12 +515,12 @@ void ECMADecryptor::SetCryptData(_ecmaCryptData & data)
{
cryptData = data;
}
void ECMADecryptor::Decrypt(char* data , const size_t size, const unsigned long stream_pos)
void ECMADecryptor::Decrypt(char* data , const size_t size, const unsigned long start_iv_block)
{
if (bVerify)
{
unsigned char* data_out = NULL;
Decrypt((unsigned char*)data, size, data_out);
Decrypt((unsigned char*)data, size, data_out, start_iv_block);
if (data_out)
{
@ -565,7 +568,7 @@ bool ECMADecryptor::CheckDataIntegrity(unsigned char* data, int size)
return (hmac == expected);
}
void ECMADecryptor::Decrypt(unsigned char* data_ptr, int data_size, unsigned char*& data_out)
void ECMADecryptor::Decrypt(unsigned char* data_ptr, int data_size, unsigned char*& data_out, int start_iv_block)
{
data_out = NULL;
@ -592,7 +595,7 @@ void ECMADecryptor::Decrypt(unsigned char* data_ptr, int data_size, unsigned ch
_buf iv(cryptData.blockSize);
memset( iv.ptr, 0x00, cryptData.blockSize );
int i = 0, sz = 4096, pos = 0;
int i = start_iv_block, sz = 4096, pos = 0;
while (pos < size)
{
@ -611,50 +614,34 @@ void ECMADecryptor::Decrypt(unsigned char* data_ptr, int data_size, unsigned ch
pos += sz; i++;
}
//--------------------------------------------
_buf pEncVerKeyMac (cryptData.encryptedHmacKey);
_buf pEncVerValueMac (cryptData.encryptedHmacValue);
_buf iv1(cryptData.blockSize);
memset( iv1.ptr, 0x00, cryptData.blockSize );
i = 0;
_buf pIndex1((unsigned char*)&i, 4);
iv1 = HashAppend(pDataSalt, pIndex1, cryptData.hashAlgorithm);
CorrectHashSize(iv1, cryptData.blockSize, 0x36);
_buf pOut1(pEncVerKeyMac.size);
_buf pOut2(pEncVerValueMac.size);
DecryptCipher(pDecryptedKey, iv, pEncVerKeyMac, pOut1, cryptData.cipherAlgorithm);
DecryptCipher(pDecryptedKey, iv, pEncVerValueMac, pOut2, cryptData.cipherAlgorithm);
}
else
{
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
{
int i = 0, sz = 512, pos = 0;
int i = start_iv_block, sz = 512, pos = 0;
_buf pHashBuf = HashAppend(pSalt, pPassword, cryptData.hashAlgorithm);
while (pos < size)
{
if (pos + sz > size)
sz = size - pos;
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.spinCount, cryptData.hashAlgorithm, i);
CorrectHashSize(hashKey, cryptData.keySize, 0);
if (cryptData.keySize == 5)
CorrectHashSize(hashKey, 16, 0); //40-bit crypt key !!!
rc4Decryption.SetKey(hashKey.ptr, hashKey.size);
_buf pInp(data_inp + pos, sz, false);
_buf pOut(data_out + pos, sz, false);
_buf block ((unsigned char*)&i, 4, false);
DecryptCipher(empty, empty, pInp, pOut, cryptData.cipherAlgorithm);
_buf pDecryptedKey = HashAppend( pHashBuf, block, cryptData.hashAlgorithm);
CorrectHashSize(pDecryptedKey, cryptData.keySize, 0);
if (cryptData.keySize == 5)
CorrectHashSize(pDecryptedKey, 16, 0); //40-bit crypt key !!!
pos += sz; i++;
CipherARCFOUR rc4;
rc4.Init(CipherARCFOUR::rtl_Cipher_DirectionDecode, pDecryptedKey.ptr, pDecryptedKey.size, 0, 0);
rc4.Decode(data_inp + pos, sz, data_out + pos, sz);
pos += sz, i++;
}
}
else

View File

@ -128,9 +128,9 @@ public:
ECMADecryptor();
virtual ~ECMADecryptor();
void Decrypt (unsigned char* data, int size, unsigned char*& data_out);
void Decrypt (unsigned char* data, int size, unsigned char*& data_out, int start_iv_block = 0);
virtual void Decrypt (char* data, const size_t size, const unsigned long stream_pos);
virtual void Decrypt (char* data, const size_t size, const unsigned long start_iv_block);
virtual bool SetPassword (std::wstring password);
virtual bool IsVerify();

View File

@ -38,7 +38,7 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.Office.Interop.Word;
//using Microsoft.Office.Interop.Word;
namespace WindowsFormsApplication1
{
@ -149,7 +149,17 @@ namespace WindowsFormsApplication1
}
numBytesToRead = bytes.Length;
textBox2.Text = Convert.ToBase64String(bytes, Base64FormattingOptions.None);
//textBox2.Text = Convert.ToBase64String(bytes, Base64FormattingOptions.None);
string s = "static const unsigned char c_res[" + Convert.ToString(bytes.Length) + "] = {";
int nLen = bytes.Length;
for (int i = 0; i < nLen; i++)
{
s += Convert.ToString(bytes[i]);
if (i != (nLen - 1))
s += ",";
}
s += "};";
textBox2.Text = s;
}
}

View File

@ -39,7 +39,6 @@
6967AFB11E2793A500A129E2 /* cextracttools.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967AFAF1E2793A500A129E2 /* cextracttools.h */; };
6967AFB51E27940600A129E2 /* ASCConverters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967AFB31E27940600A129E2 /* ASCConverters.h */; };
6967AFDF1E279B3600A129E2 /* libTxtXmlFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967AFDC1E279B2300A129E2 /* libTxtXmlFormatLib.a */; };
6967B0B31E27A07100A129E2 /* libPPTFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B0961E27A03800A129E2 /* libPPTFormatLib.a */; };
6967B0D41E27A36E00A129E2 /* libHtmlFile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B0D11E27A35F00A129E2 /* libHtmlFile.a */; };
6967B10A1E27A41B00A129E2 /* libPdfWriter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B1091E27A41400A129E2 /* libPdfWriter.a */; };
6967B10F1E27A65600A129E2 /* OfficeFileFormatChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967B10D1E27A65600A129E2 /* OfficeFileFormatChecker.h */; };
@ -242,20 +241,6 @@
remoteGlobalIDString = 6967AFBE1E2798B900A129E2;
remoteInfo = TxtXmlFormatLib;
};
6967B0951E27A03800A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 6967AFFB1E279D3900A129E2;
remoteInfo = PPTFormatLib;
};
6967B0B01E27A06900A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 6967AFFA1E279D3900A129E2;
remoteInfo = PPTFormatLib;
};
6967B0D01E27A35F00A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */;
@ -474,7 +459,6 @@
6967AFAF1E2793A500A129E2 /* cextracttools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cextracttools.h; path = ../../../../src/cextracttools.h; sourceTree = "<group>"; };
6967AFB31E27940600A129E2 /* ASCConverters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCConverters.h; path = ../../../../src/ASCConverters.h; sourceTree = "<group>"; };
6967AFD71E279B2300A129E2 /* TxtXmlFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TxtXmlFormatLib.xcodeproj; path = ../../../../ASCOfficeTxtFile/TxtXmlFormatLib/Mac/TxtXmlFormatLib/TxtXmlFormatLib.xcodeproj; sourceTree = "<group>"; };
6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTFormatLib.xcodeproj; path = ../../../../ASCOfficePPTFile/PPTFormatLib/Mac/PPTFormatLib.xcodeproj; sourceTree = "<group>"; };
6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = HtmlFile.xcodeproj; path = ../../../../HtmlFile/Mac/HtmlFile/HtmlFile.xcodeproj; sourceTree = "<group>"; };
6967B1031E27A41300A129E2 /* PdfWriter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PdfWriter.xcodeproj; path = ../../../../DesktopEditor/ios_projects/PdfWriter/PdfWriter.xcodeproj; sourceTree = "<group>"; };
6967B10D1E27A65600A129E2 /* OfficeFileFormatChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OfficeFileFormatChecker.h; path = ../../../../../Common/OfficeFileFormatChecker.h; sourceTree = "<group>"; };
@ -503,7 +487,6 @@
6967B1D11E27B9D700A129E2 /* libRtfFormatLib.a in Frameworks */,
6967B10A1E27A41B00A129E2 /* libPdfWriter.a in Frameworks */,
6967B0D41E27A36E00A129E2 /* libHtmlFile.a in Frameworks */,
6967B0B31E27A07100A129E2 /* libPPTFormatLib.a in Frameworks */,
6967AFDF1E279B3600A129E2 /* libTxtXmlFormatLib.a in Frameworks */,
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */,
69DA32F11CEE100E00E10AF0 /* libagg_ios.a in Frameworks */,
@ -548,7 +531,6 @@
6967B1C91E27B9C400A129E2 /* RtfFormatLib.xcodeproj */,
6967B1031E27A41300A129E2 /* PdfWriter.xcodeproj */,
6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */,
6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */,
6967AFD71E279B2300A129E2 /* TxtXmlFormatLib.xcodeproj */,
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */,
69415FAE1CB5243F003E771B /* mng.xcodeproj */,
@ -704,14 +686,6 @@
name = Products;
sourceTree = "<group>";
};
6967B0921E27A03800A129E2 /* Products */ = {
isa = PBXGroup;
children = (
6967B0961E27A03800A129E2 /* libPPTFormatLib.a */,
);
name = Products;
sourceTree = "<group>";
};
6967B0CD1E27A35E00A129E2 /* Products */ = {
isa = PBXGroup;
children = (
@ -865,7 +839,6 @@
6967B1D01E27B9D000A129E2 /* PBXTargetDependency */,
6967B10C1E27A42500A129E2 /* PBXTargetDependency */,
6967B0D31E27A36800A129E2 /* PBXTargetDependency */,
6967B0B11E27A06900A129E2 /* PBXTargetDependency */,
6967AFDE1E279B2D00A129E2 /* PBXTargetDependency */,
69EC66D81E01774D003527E2 /* PBXTargetDependency */,
69DA32F01CEE100700E10AF0 /* PBXTargetDependency */,
@ -995,10 +968,6 @@
ProductGroup = 69415FB21CB5243F003E771B /* Products */;
ProjectRef = 69415FB11CB5243F003E771B /* png.xcodeproj */;
},
{
ProductGroup = 6967B0921E27A03800A129E2 /* Products */;
ProjectRef = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
},
{
ProductGroup = 69DA325D1CEE09BB00E10AF0 /* Products */;
ProjectRef = 69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */;
@ -1128,13 +1097,6 @@
remoteRef = 6967AFDB1E279B2300A129E2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6967B0961E27A03800A129E2 /* libPPTFormatLib.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libPPTFormatLib.a;
remoteRef = 6967B0951E27A03800A129E2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6967B0D11E27A35F00A129E2 /* libHtmlFile.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1331,11 +1293,6 @@
name = TxtXmlFormatLib;
targetProxy = 6967AFDD1E279B2D00A129E2 /* PBXContainerItemProxy */;
};
6967B0B11E27A06900A129E2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = PPTFormatLib;
targetProxy = 6967B0B01E27A06900A129E2 /* PBXContainerItemProxy */;
};
6967B0D31E27A36800A129E2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = HtmlFile;

View File

@ -758,41 +758,41 @@ namespace NExtractTools
// ppsx -> pptx
int ppsx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
std::wstring sTempUnpackedPPSX = sTemp + FILE_SEPARATOR_STR + L"ppsx_unpacked";
NSDirectory::CreateDirectory(sTempUnpackedPPSX);
int nRes = ppsx2pptx_dir(sFrom, sTempUnpackedPPSX, params);
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, -1))
return 0;
}
// std::wstring sTempUnpackedPPSX = sTemp + FILE_SEPARATOR_STR + L"ppsx_unpacked";
// NSDirectory::CreateDirectory(sTempUnpackedPPSX);
//
// int nRes = ppsx2pptx_dir(sFrom, sTempUnpackedPPSX, params);
// if(SUCCEEDED_X2T(nRes))
// {
// COfficeUtils oCOfficeUtils(NULL);
// if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, -1))
// return 0;
// }
return AVS_FILEUTILS_ERROR_CONVERT;
}
int ppsx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params)
{
COfficeUtils oCOfficeUtils(NULL);
if (S_OK == oCOfficeUtils.ExtractToDirectory(sFrom, sTo, NULL, 0))
{
std::wstring sContentTypesPath = sTo + FILE_SEPARATOR_STR + L"[Content_Types].xml";
if(NSFile::CFileBinary::Exists(sContentTypesPath))
{
std::wstring sData;
if(NSFile::CFileBinary::ReadAllTextUtf8(sContentTypesPath, sData))
{
std::wstring sCTFrom = L"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml";
std::wstring sCTTo = L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
sData = string_replaceAll(sData, sCTFrom, sCTTo);
if(NSFile::CFileBinary::SaveToFile(sContentTypesPath, sData, true))
{
return 0;
}
}
}
}
// COfficeUtils oCOfficeUtils(NULL);
// if (S_OK == oCOfficeUtils.ExtractToDirectory(sFrom, sTo, NULL, 0))
// {
// std::wstring sContentTypesPath = sTo + FILE_SEPARATOR_STR + L"[Content_Types].xml";
// if(NSFile::CFileBinary::Exists(sContentTypesPath))
// {
// std::wstring sData;
// if(NSFile::CFileBinary::ReadAllTextUtf8(sContentTypesPath, sData))
// {
// std::wstring sCTFrom = L"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml";
// std::wstring sCTTo = L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
//
// sData = string_replaceAll(sData, sCTFrom, sCTTo);
//
// if(NSFile::CFileBinary::SaveToFile(sContentTypesPath, sData, true))
// {
// return 0;
// }
// }
// }
// }
return AVS_FILEUTILS_ERROR_CONVERT;
}
@ -812,70 +812,76 @@ namespace NExtractTools
}
return AVS_FILEUTILS_ERROR_CONVERT;
}
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
COfficePPTFile pptFile;
pptFile.put_TempDirectory(sTemp);
return S_OK == pptFile.LoadFromFile(sFrom, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
//COfficePPTFile pptFile;
//pptFile.put_TempDirectory(sTemp);
//return S_OK == pptFile.LoadFromFile(sFrom, sTo, params.getPassword()) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// ppt -> pptt
int ppt2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
//std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
//std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
NSDirectory::CreateDirectory(sResultPpttDir);
//NSDirectory::CreateDirectory(sResultPpttDir);
int nRes = ppt2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
if (SUCCEEDED_X2T(nRes))
{
// zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
//int nRes = ppt2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
//if (SUCCEEDED_X2T(nRes))
//{
// // zip pptt folder to output file
// COfficeUtils oCOfficeUtils(NULL);
// nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
//}
//return nRes;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// ppt -> pptt_bin
int ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
// unzip pptx to temp folder
std::wstring sTempUnpackedPPTX = sTemp + FILE_SEPARATOR_STR + L"pptx_unpacked"+ FILE_SEPARATOR_STR; // leading slash is very important!
NSDirectory::CreateDirectory(sTempUnpackedPPTX);
COfficePPTFile pptFile;
pptFile.put_TempDirectory(sTemp);
if ( pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX) != S_OK) return AVS_FILEUTILS_ERROR_CONVERT;
// convert unzipped pptx to unzipped pptt
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
int nRes = 0;
if (pptx_file)
{
#if defined(_WIN32) || defined (_WIN64)
BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
BSTR bstrTempUnpackedPPTX = SysAllocString(sTempUnpackedPPTX.c_str());
BSTR bstrTo = SysAllocString(sTo.c_str());
pptx_file->SetFontDir (bstrFontPath);
nRes = (S_OK == pptx_file->OpenFileToPPTY (bstrTempUnpackedPPTX, bstrTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
SysFreeString(bstrFontPath);
SysFreeString(bstrTempUnpackedPPTX);
SysFreeString(bstrTo);
#else
pptx_file->SetFontDir (params.getFontPath());
nRes = (S_OK == pptx_file->OpenFileToPPTY (sTempUnpackedPPTX, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
#endif
delete pptx_file;
}
return nRes;
// std::wstring sTempUnpackedPPTX = sTemp + FILE_SEPARATOR_STR + L"pptx_unpacked"+ FILE_SEPARATOR_STR; // leading slash is very important!
//
// NSDirectory::CreateDirectory(sTempUnpackedPPTX);
//
// COfficePPTFile pptFile;
//
// pptFile.put_TempDirectory(sTemp);
//
// if ( pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword()) != S_OK) return AVS_FILEUTILS_ERROR_CONVERT;
//
// // convert unzipped pptx to unzipped pptt
// CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
//
// int nRes = 0;
//
// if (pptx_file)
// {
//#if defined(_WIN32) || defined (_WIN64)
// BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
// BSTR bstrTempUnpackedPPTX = SysAllocString(sTempUnpackedPPTX.c_str());
// BSTR bstrTo = SysAllocString(sTo.c_str());
//
// pptx_file->SetFontDir (bstrFontPath);
// nRes = (S_OK == pptx_file->OpenFileToPPTY (bstrTempUnpackedPPTX, bstrTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
//
// SysFreeString(bstrFontPath);
// SysFreeString(bstrTempUnpackedPPTX);
// SysFreeString(bstrTo);
//#else
// pptx_file->SetFontDir (params.getFontPath());
// nRes = (S_OK == pptx_file->OpenFileToPPTY (sTempUnpackedPPTX, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
//#endif
// delete pptx_file;
// }
//
// return nRes;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// rtf -> docx