I have a Dll which I inject into my target process. This Dll changes some variables at give memory addresses. Normaly I do it like:
int* variable = (int*)0x????????;
*variable = 1;
Now I want to do the same thing with a string. Reading the string works.
string* variable = (string*) 0x????????;
But changing the string crashes the process.
*variable = "hello world"; //crash
How can I fix this?