I have a populated nested structure in memory. I want to change values of few members.
struct evp_cipher_ctx_st {
const EVP_CIPHER *cipher;
int somevalue;
} /* EVP_CIPHER_CTX */ ;
Here the cipher element is also a structure and its like this :
struct evp_cipher_st {
int nid;
int block_size;
} /* EVP_CIPHER */ ;
I want to change the value of "block_size" element of the structure EVP_CIPHER nested inside EVP_CIPHER_CTX.
So I did this:
EVP_CIPHER_CTX ctx;
EVP_CIPHER *MY_EVP_CYPHER;
MY_EVP_CYPHER = (EVP_CIPHER*)ctx.cipher;
MY_EVP_CYPHER -> block_size = 20;
My Program is crashing at this point :
37: MY_EVP_CYPHER = (EVP_CIPHER*)ctx.cipher;
00D914C5 8B 85 6C FF FF FF mov eax,dword ptr [ebp-94h]
00D914CB 89 85 60 FF FF FF mov dword ptr [ebp-0A0h],eax
38: MY_EVP_CYPHER -> block_size = 20;
00D914D1 8B 85 60 FF FF FF mov eax,dword ptr [ebp-0A0h]
00D914D7 C7 40 04 11 00 00 00 mov dword ptr [eax+4],11h
Can someone point out the problem.