[arctool2] Add archive tool

This commit is contained in:
RD42
2024-05-23 23:22:12 +08:00
parent 16f92725a7
commit a630a523e1
15 changed files with 1348 additions and 1 deletions

View File

@ -20,6 +20,39 @@ CSigner::~CSigner(void)
//------------------------------------
#ifdef ARCTOOL
void CSigner::SignHash(CHasher *pHasher)
{
if (m_pbSignature != NULL)
delete[] m_pbSignature;
HCRYPTHASH hCryptHash = pHasher->GetContainer();
CryptSignHash(hCryptHash, AT_SIGNATURE, NULL, CRYPT_NOHASHOID, NULL, &m_dwLength);
m_pbSignature = new BYTE[m_dwLength];
CryptSignHash(hCryptHash, AT_SIGNATURE, NULL, CRYPT_NOHASHOID, m_pbSignature, &m_dwLength);
}
#endif
//------------------------------------
#ifdef ARCTOOL
BYTE* CSigner::GetSignature()
{
return m_pbSignature;
}
#endif
//------------------------------------
#ifdef ARCTOOL
DWORD CSigner::GetSignatureLength()
{
return m_dwLength;
}
#endif
//------------------------------------
void CSigner::SetSignature(DWORD dwLength, BYTE *pbSignature)
{
if (m_pbSignature != NULL)