Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MSN Messenger bot vb6

Posted on 2007-07-27
32
Medium Priority
?
1,747 Views
Last Modified: 2012-06-27
I am trying to write a small application that connects to MSN Messenger sends a few messages to people and log off.

Ive been trying to use the "Messenger API Type Library" but I havnt realy made much progress.

What dependencies would I need to include with my program if i use this? Also does it have the option to set a display picture as it seems to be pointing to the old Windows Messenger?

I would also need to auto-accept any invitations coming in, how would this be done?
0
Comment
Question by:Nightma12
  • 13
  • 13
  • 4
30 Comments
 
LVL 9

Expert Comment

by:justchat_1
ID: 19582653
This tutorial should give you a head start:
http://www.fanatic.net.nz/2003/05/31/introduction-to-messenger-api-type-library/

I don't think this works with live messenger (on the sending end of course) but im not positive so hopefully another expert can shed some light on that.
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19584036
This requires my client to have MSN Messenger installed though?


>>>You can either manually sign in by launching the sign in dialog box (unfortunately, the password doesnt work, but I added it anyway), or you can do an auto sign in. If there is no saved password, then it just goes to manual sign in. Ive added 2 error handlers, the first is the one thats returned if the password is not saved (for auto sign in) and the other is if the user is already signed in.<<<

manually sign in? Thats not quite the kind of thing i was looking for to achieve via this. Im sort of looking for how to make another client, except i just wont be useing the full features of the protocol.
0
 
LVL 10

Expert Comment

by:sakuya_su
ID: 19584186
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28094&lngWId=1

this should give you a very comprehensive example, however you must note that to fully understand the example, you should be very familiar with Win Sock and have a good understanding of the MSN protocol

the protocol can be found here:
http://www.hypothetic.org/docs/msn/
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 9

Accepted Solution

by:
justchat_1 earned 1000 total points
ID: 19585618
Most examples out there for vb6 (including the planet-source-code examples) are outdated.... your best bet is http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=55650&lngWId=1  but you will probably need to update the code to support live messenger based off of http://www.hypothetic.org/docs/msn/
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19586987
The only one of those examples that was similer to what im after is the one that justchat_1 just posted.

I was hoping for some sort of dll or class that would make doing this easy but i guess their isnt one available.

There seems to be no mention of display pictures on that website? Also on the script i downloaded the display name does not get set correctly.

I dont really need to do much with my program, all i need to do is log onto MSN and set a display picture, display name and accept all contact list adds that are sent to the bot.

Every now and then, i will need to send a message to person x, if person x is not on the contact list then i need to add them. After sending person x a message i need to wait for a response if there is none then move onto the next person.

Nothing too hard but then again they key things that i need to do dont seem to be mentioned in those docs? I could easily port a VB.NET/C#/PHP client into VB6 so an MSNP10 example in a different language should be ok?
0
 
LVL 10

Expert Comment

by:sakuya_su
ID: 19587090
yes, but those clients tend to be really complicated and really translating isnt worth the time.

Yea I know what you mean by getting complicated, MSN Messenger protocols are a hassle to deal with, just login take ages with all the directs, handshakes and stuff.

And no You can set display pictures, I have done it before.

What you can do, if its not listed on the docs, is get a simple packet sniffer and go change the display pic. you can easily figure out how its done
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19587168
Having done a lot of work with instant messaging protocols and vb6 I completely agree with sakuya_su.  You have to keep in mind that vb6 has been abandoned long ago and live messenger (MSNP11) is very new...

Using the docs provided before and a packet sniffer to fill in the gaps...its really not too hard to figure out
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19587436
ok well im going to run though that doc and give it a go, I will post my progress in a few days to a week and if it works i wll accept.

Thanks for the help.
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19589149
Ah, well ive got everything to work by modifing the link that justchat_1 posted with my own code and filling in the gaps.

However, i am unable to figure out how i would start a conversation with somebody rather than just repling to them. Ive searched the protocol website but to no avail.

Im hoping this is the larst obstacle i come across as everything else seems to be working brilliant.

-Lee
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19589468
You need to first CAL (call) the new user and then when the JOI (join) message is received you may send them the message.
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19596053
what do i send that to? a Swichboard right? I tried opening a new switchboard but i never got a response back from the Notification Server. God this protocol is confuseing =|
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19596579
Trust me out of all three of the major protocols this one is the easiest...

Keep in mind that new switchboard communications are made on the same connection as the original switchboard communications...

"I tried opening a new switchboard but i never got a response back from the Notification Server"
-Thats because the switchboard and the notification server are completely separate servers

You may be better off using a program like wireshark or packetyzer to observe some msn conversations occurring on your own computer....then build your program to emulate what you observe
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19597226
The easiest.. wow, why did Microsoft have to make it so complicated? Im pretty confident it could off all been done in a single TCP session.

I tried sending a CAL to a swichboard but it simply invited the user rather than starting a new conversation, I was planning to look up nudgeing later on but if thats going to mean even more complicities to do a simple command then i will probably refain from doing so.

Yeah, i might try looking myself via a packet sniffer tommorrow as its almost 3 am. Im sure im sending the wrong commands to the SB/NS though.
0
 
LVL 10

Expert Comment

by:sakuya_su
ID: 19597652
yea their MSN Protocol is really stupid.. and their Hotmail one is worse with all the stupid WebDAV stuff..

I agree with justchat_1, get a packet sniffer, do the actions on your MSN and simply replicate it. In the process you will get the hang of the whole thing.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19597674
Its been a while since i've been doing raw protocol interactions with msn but I remembered something along the lines of cal which results in a rng on the other end followed by a joi on your end.  

You should get a response back from the cal which states the status of the other user....what response did you receive when you tried the cal??
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19605263
I can never get packet sniffers to work for me =/

i recieve the normal RNG + JOI commands when useing CAL on a switchboard but it just invites the other user rather than opening a new convo window. If i use XFR on the NS to request a new Switchboard (XFR 15 SB) then it disconnects me
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19606636
Your getting a little confused here....using an xfer has no place in simple message communications.

after using the RNG+JOI messages successfully you will need to send a message for a new window to open up.  If your still having trouble, post a log of exactly what your trying and the responses you are receiving (aka all incoming and outgoing packets)...
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19613944
Well its not working at all now, typical lol

Ill give it a go tommorrow morning, its probably MSN screwing up again the bot is not recieveing any messages now. (and neither am i from the looks of it)
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19614106
Theres a good chance you were temporarily blocked....keep in mind MSN doesn't mind third parties creating clients but they don't want people playing around with their protocols.
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19620925
Possibly, i know AIM tries its best to block them.

Anyways it now works, here is my log file

Switchboard Outbound -- CAL 4 mark_lippert7@hotmail.com

Switchbord IN -- CAL 4 RINGING 1706735284

Switchbord IN -- JOI mark_lippert7@hotmail.com MR%20PERT%20:D:D:D:D

That invites someone into the conversation.

When I start a conversation with the bot myself, i get this:

Dispatch/Notification Inbound -- RNG 1706735284 207.46.27.18:1863 CKI 12354199.21824898 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)

Switchboard Outbound -- ANS 1 TsuGaming@hotmail.com 12354199.21824898 1706735284

Switchbord IN -- IRO 1 1 1 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)


TsuGaming is the bot, lee.dalchow is my addy, and mark_lippert is a test account i created to use CAL on
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19621477
Glad I could help
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19621848
Its not working??? lol the CAL invites a user rather than starting a new conversation? lol

oo, when i said "it now works" i meant MSN Messenger now works rather than the solution works - sorry if i was not clear.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19621862
oh...sorry for misreading that

After this line "JOI mark_lippert7@hotmail.com MR%20PERT%20:D:D:D:D" you can send a message-im not sure where your having trouble
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19623470
useing JOI invites them into the conversation.

My goal was to start a *new* conversation with them.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19630105
I just realized I misunderstood you a few posts ago and probably confused you quite a bit...

If you are trying to start a brand new session you will need to open a new connection to the switchboard (Dest. port 1863, source port random) resend your authentication and then send the CAL

Also-the switchboard you open the connection to will need to be the one you are transferred to (XFR) during initial login (if you were transferred) not the one you logged into.
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19630900
Here is a section from my log file.

====================================================================

Dispatch/Notification Inbound -- RNG 1706735284 207.46.27.18:1863 CKI 12354199.21824898 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)

Switchboard Outbound -- ANS 1 TsuGaming@hotmail.com 12354199.21824898 1706735284

Switchbord IN -- IRO 1 1 1 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)

===========================================================================

Dispatch/Notification Inbound -- XFR 3 NS 207.46.111.78:1863 0 65.54.239.20:1863

==========================================================================


the RNG command clearly gives me the authinfo to send to the switchboard, but unless somebody has already started a conversation with me i wont have them will I?  I see the XFR command gives me 2 IPs but with no authentication to send off before sending the CAL.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19630988
By authentication im talking about the USR command-way before you get to the actual conversation....
0
 
LVL 1

Author Comment

by:Nightma12
ID: 19631751
Im totally confused now... I just checked my log file and i did not see a USR command being sent to the switchboard server on connecting. I have this:

=========================================================================

Dispatch/Notification Inbound -- RNG 1706735284 207.46.27.18:1863 CKI 12354199.21824898 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)

Dispatch/Notification Outbound -- REA 63 TsuGaming@hotmail.com NightRegulator%20Test%20Bot%20%3AD

Switchboard Outbound -- ANS 1 TsuGaming@hotmail.com 12354199.21824898 1706735284

Switchbord IN -- IRO 1 1 1 lee.dalchow@aohost.co.uk *komen(*):D°¨¨°º"°¨¨°(6)(_.·´¯`·«¤°Lee°¤»·´¯`·._)(6)°¨¨°º"°¨¨°:D(*)

==================================================================================


Do you think you could give me a step - by -step instruction on how i would do this?

for example...

1) Create a TCP Connection to x on port y

2) Upon connection wait to recieve z1 z2 z3 from the server, z2 is the IP of blah blah
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 19632869
Well you need to think over what your looking at....Does it seem possible that msn knows who you are without ever receiving a username or password?  The log clearly is missing the entire login procedure.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question