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

Pages: (4): « First « 1 2 [ 3 ] 4 » Last »
Altering incoming text
Author: Message:
RooJ
Junior Member
**


Posts: 18
Joined: Apr 2004
O.P. RE: Altering incoming text
Why not just:

If (StrComp(sNotifyCode, "msgbx", vbTextCompare) = 0) Then
        MsgBox sText
        ReceiveNotify = True
        Exit Function
    End If

Also if u cant get it to work you might want to look at the notifycode and check if ur recieving it ok.
04-24-2004 01:32 PM
Profile E-Mail PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
RE: Altering incoming text
Yep I also did that but i was trying dif. things...
YouTube closed-captions ripper (also allows you to download videos!)
04-24-2004 01:34 PM
Profile E-Mail PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Altering incoming text
quote:
Originally posted by optimism_
In both cases you will be getting a copy of the original. Presumable for c, patchou copies it into a new variable before passing it into the function or whatever. In VB it is defined as a copy
yes, plus makes a copy before calling the dll function. About VB, the ByVal in Strings is just a formalism... I bet you can change the decaration to ByVal bla as Long and you can cheat a bit with Windows APIs and modify the copy Plus makes.
quote:
Originally posted by optimism_
hence you CANNOT change the original text
(Y) not the original, of course, but yes the copy :P ;)
quote:
Originally posted by optimism_
ps, choli

Actually is a const char*
this means the compiler wont let you change it unless you cast it to (char*) and if you do a cast, it will cause a runtime error, so no, you cannot change it in c at all
(so it doent have to be copied at all actually, cos theres no write access to it)
the const keyword is only used by the compiler to not let you change it (ie make something like sText[0]=mychar; ) however the internal (read assembler) implementation of it it's the same as if you don't put const. That's why I said you can remove the const keyword and all will work the same, just that now you'd be able to modify it.

about the cast, i don't think it'll do a runtime error... Anyway, you can also make
int dummy_ptr; //assume sizeof(int)=4
dummy_ptr=(int)sText; /*that's dodgy, i know, if you don't like it you can use void* instead of int too (dodgy too)*/
and then use dummy_ptr in an API like CopyMemory (or what ever it's called)....

Sumarizing, you can modify the string plus passes as parameter to the function (and plus won't use it once your function finishes)
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
04-24-2004 01:55 PM
Profile PM Find Quote Report
RooJ
Junior Member
**


Posts: 18
Joined: Apr 2004
O.P. RE: Altering incoming text
Well i changed the text:

RooJ says:
Ping? [request]
motion - [blahblah] says:
Pong! [00sec]
RooJ says:
Ping? [request]
motion - [blahblah] says:
Porn! [01sec]

Just i dont think i intercepted the message so therefore things like the logfile will have the origional (Pong! [01sec]) in it i think.
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 :P.

Choli any idea which dll makes the copy? MsgPlusH1.dll maybe?

RooJ
04-24-2004 02:07 PM
Profile E-Mail PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
RE: Altering incoming text
Cool how did you do it? :P
Might you add me at msn if you want?(look at my profile)
YouTube closed-captions ripper (also allows you to download videos!)
04-24-2004 02:09 PM
Profile E-Mail PM Web Find Quote Report
optimism_
Senior Member
****

Avatar
Ctrl+Alt+Del - Tragically l337

Posts: 521
Reputation: 8
38 / Male / –
Joined: Jul 2003
RE: Altering incoming text
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
HTTP 404 - Signature Not Found
04-24-2004 02:21 PM
Profile E-Mail PM Web Find Quote Report
RooJ
Junior Member
**


Posts: 18
Joined: Apr 2004
O.P. RE: Altering incoming text
Just used a debugger to break on GetForegroundWindow which i think is called when someone messages you to check if the window is in the foreground, otherwise it will play a sound and flash. From there i found a huge string which contained the entire chat session, anything could be edited including names, it would then change on the chat window aswell.

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.

RooJ
04-24-2004 02:35 PM
Profile E-Mail PM Find Quote Report
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
RooJ
Junior Member
**


Posts: 18
Joined: Apr 2004
O.P. RE: Altering incoming text
Choli: what dody thing did you do?

I dont understand dody?

Choli: 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...?


Wow, maybe i could hook his hook lol.

Choli: I have no idea, but what do you want to do?? hack it?

Nah not at the moment, just if worse comes to worse i could use code injection to pass control to me and steal/alter the copy plus is gonna use to put in the chat window.

RooJ

This post was edited on 04-24-2004 at 03:05 PM by RooJ.
04-24-2004 03:04 PM
Profile E-Mail PM Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Altering incoming text
quote:
Originally posted by RooJ
I dont understand dody?
dodgy, sorry :P
quote:
Originally posted by RooJ
Nah not at the moment, just if worse comes to worse i could use code injection to pass control to me and steal/alter the copy plus is gonna use to put in the chat window.
:mipdodgy:
that sound weird :P, i think it's better to use the messenger apis (as plus does)
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
04-24-2004 03:21 PM
Profile PM Find Quote Report
Pages: (4): « First « 1 2 [ 3 ] 4 » Last »
« Next Oldest Return to Top Next Newest »


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