What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Altering incoming text

Altering incoming text
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Altering incoming text
quote:
Originally posted by RooJ
Well i changed the text:

Porn! [01sec]
porn? :P
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? :P
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? :P

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.

This post was edited on 04-24-2004 at 02:50 PM by Choli.
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
04-24-2004 02:47 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Altering incoming text - by RooJ on 04-23-2004 at 02:41 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 03:49 PM
RE: Altering incoming text - by eXXon on 04-23-2004 at 04:19 PM
RE: RE: Altering incoming text - by optimism_ on 04-23-2004 at 04:37 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 04:44 PM
RE: Altering incoming text - by eXXon on 04-23-2004 at 04:49 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 04:52 PM
RE: Altering incoming text - by optimism_ on 04-23-2004 at 04:59 PM
RE: Altering incoming text - by RooJ on 04-23-2004 at 05:14 PM
RE: Altering incoming text - by RooJ on 04-23-2004 at 11:46 PM
RE: Altering incoming text - by optimism_ on 04-23-2004 at 11:50 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:18 AM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:23 AM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:38 AM
RE: Altering incoming text - by Mike on 04-24-2004 at 05:03 AM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:25 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:31 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 12:48 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:54 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 01:14 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 01:32 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 01:34 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 01:55 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 02:07 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 02:09 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 02:21 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 02:35 PM
RE: RE: Altering incoming text - by optimism_ on 04-24-2004 at 09:37 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 02:47 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 03:04 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 03:21 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 11:06 PM
RE: Altering incoming text - by optimism_ on 04-25-2004 at 03:51 PM
RE: Altering incoming text - by RooJ on 04-26-2004 at 01:09 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On