Exception thrown at 0x4296339C (cryptopp.dll) in CryptoppCPP.exe: 0xC0000005: Access violation reading location 0x6F57206F.
If there is a handler for this exception, the program may be safely continued.
/GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Fd"Release\vc140.pdb" /Zc:inline /fp:precise /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\CryptoppCPP.pch"
/OUT:"C:\Users\821973\Documents\Visual Studio 2015\Projects\CryptoppCPP\Release\CryptoppCPP.exe" /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:"C:\Users\821973\Documents\Visual Studio 2015\Projects\CryptoppCPP\Release\CryptoppCPP.pdb" /DYNAMICBASE "C:\Users\821973\Documents\Visual Studio 2015\Projects\CryptoppCPP\libs\x86\cryptopp.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"C:\Users\821973\Documents\Visual Studio 2015\Projects\CryptoppCPP\Release\CryptoppCPP.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\CryptoppCPP.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
#include "main.h"
using namespace std;
USING_NAMESPACE(CryptoPP)
#ifdef CRYPTOPP_IMPORTS
static PNew s_pNew = NULL;
static PDelete s_pDelete = NULL;
extern "C" __declspec(dllexport) void __cdecl SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler pSetNewHandler)
{
s_pNew = pNew;
s_pDelete = pDelete;
}
void * __cdecl operator new (size_t size)
{
return s_pNew(size);
}
void __cdecl operator delete (void * p)
{
s_pDelete(p);
}
#endif
int main()
{
std::cout << "Crypto++ Example" << endl;
SHA256 hash;
string message = "abcdefghijklmnopqrstuvwxyz";
string digest;
StringSource s(message, true, new HashFilter(hash, new HexEncoder(new StringSink(digest))));
cout << digest << endl;
system("pause");
return 0;
}
#pragma once
#ifndef __SPDCRYPTO_H
#define __SPDCRYPTY_H
#include <stdio.h>
#include <cstdlib>
#include <string>
#include <iostream>
#include "Include\dll.h"
# pragma comment ( lib, "cryptopp" )
#endif
Does anyone came across this issue before? How can I track what could be causing this issue?
StringSource s(message, true, new HashFilter(hash, new HexEncoder(new StringSink(digest))));
void Assign(const T *t, size_type len)
{
New(len);
memcpy_s(m_ptr, m_size*sizeof(T), t, len*sizeof(T)); //<--BREAKS HERE
}
Thank you JeffreyI do know how to use debugger and google :).Since issue is coming up in Release and not Debug I can't step inside the Crypto++ it just breaks on this line:
StringSource s(message, true, new HashFilter(hash, new HexEncoder(new StringSink(digest))));