quote:
Originally posted by RooJ
Well i changed the text:
Porn! [01sec]
porn?
what dody thing did you do?
quote:
Originally posted by RooJ
There will be ways to intercept and modify the copy Plus makes but it would be easier to add a function to the plugins to allow us to change it
the best way it's do the same plus does, ie use the messenger apis and/or hooking techniques
or maybe you can use the messenger objects plus sends...?
quote:
Originally posted by RooJ
Choli any idea which dll makes the copy? MsgPlusH1.dll maybe?
I have no idea, but what do you want to do?? hack it?
inside a plugin you don't know the address where plus stores the original string, only the address of the copy, which, btw, its useless for these pourposes.
quote:
Originally posted by optimism_
choli
code:
const char* szMyString = "Hello World";
strcpy(szMyString, "hi"); //Compiler error
strcpy((char*)szMyString. "hi ho"); //Runtime error
but you are right... change the definition of sText and you could write to the string. Not sure what would happen in plus itself tho if you were to do that
that's because the compiler creates the string in a readonly zone of teh memory because you said you won't modify it (you said const)....
make this test:
make a dll that exports this function:
code:
/*if strlen(str) > 0, this function replaces the first character by a X */
void f(cont char * str) {
char * str2 = (char*)str;
if(*str2)
*str2='X';
}
and now, make a program that calls that dll, something like:
code:
char mystring[6];
/*let's fill the string this way so we assure the string is not read only
we could have declared it as
char * mystring = "Hello";
however, the following way makes sure no compiler will put the string in a read only zone of the memory*/
mystring[0]='H';
mystring[1]='e';
mystring[2]='l';
mystring[3]='l';
mystring[4]='o';
mystring[5]=0;
/* now display the string, you can do a MessageBox, or a printf*/
printf("%s\n",mystring); // Hello is printed
//call the dll
f(mystring);
/*display the string again*/
printf("%s\n",mystring); // Xello is printed
note the diference?
in a function you can declare a cont pointer to tell the compiler not let you modiy where it points to, but it is still a ponter, ie you can use it to access the memory and modify it.
note: about the line
char * str2 = (char*)str;
maybe the compiler doesn't let you compile that, i dunno, but there are ways to get rid of that restriction, sure (using another function, using casts to void *, etc..)
Edit:
quote:
Originally posted by optimism_
but you are right... change the definition of sText and you could write to the string. Not sure what would happen in plus itself tho if you were to do that
i've read again your post. Nothing happens if you modify the copy that plus makes. Plus just ignores it and makes another copy for the next plugin.
quote:
Originally posted by RooJ
Obviously this is impractical though, and finding the location of the copy plus makes (if it does) would be a better find. Shouldnt be too hard with a little debugging.
the copy is where sText points to.