 |
|
 |
a warm hello to all msn gurus 
hi i am trying to develop a badword filter for msn/messenger to help protect my kids from bad words... "yes those words ...that later i we have to make up a fake definition when they ask dad what is the meaning of f**k :x"
anyways, i started using winpcap to capture the incoming socket but later found out that since sp2 xp will not allowed this"
the big question:
while reading this article it came to my attention that maybe i could filter at the application level....
do you think if taking this/your aproche would eventually end up in a simple badword_filter.dll.
thanks
Ivo Gomez http://ivogomez.com
|
|
|
|
 |
|
 |
Hi
I require a application which can interact with MSN Messenger. It could be an add-in, or it could be a stand alone program.
The basic functionality is: It will be able to send a message to all your contacts.
This could be approached in a number of ways i'm sure, but I hope it can be done in win32 rather than .NET. Either C++ or Delphi, and lastly C# if nothing else.
If you can only do a part of it, please let me know. It would also require an 'add-in' to be able to install automatically, without having to click the 'add-in's section of the Messenger.
Let me know if you can do any part of this project. I can pay through PayPal for your time, please email: wizzer90@hotmail.com
Kind regards,
Chris.
|
|
|
|
 |
|
 |
Hello, every one
When conversation windows popup up, I want to get the conversation object pointer so I can get member signinname in this conversation window one by one, I use following code, but always failed, can you help me?
case DISPID_MUAE_ONIMWINDOWCREATED: if(SUCCEEDED(V_I4(&pDispParams->rgvarg[1]))) { pDisp=(IDispatch *)(&pDispParams->rgvarg[0]); hr = pDisp->QueryInterface(IID_IMessengerContacts, (void **)&pContacts); if(pDisp) pDisp->Release(); ...... } break;
-- modified at 19:05 Friday 14th April, 2006
|
|
|
|
 |
|
 |
Hi
Where does it fail? You dont get Dispatch. I have never tried something like it and its been quite a while since I did anything with Messenger.
Can you send me your test code for this so that I can have a look?
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
I solved this problem by following sentence: pDispParams->rgvarg[0].pdispVal->QueryInterface(__uuidof(IMessengerConversationWnd),(void**)&m_pConvWnd);
Thanks you very much!
|
|
|
|
 |
|
 |
Hi every one
I Hooked CoRegisterClassObject() and implement an IDispatch interface with "MSNMessenger.UIAutomation",
but in the function "Invok()" of IDispatch, when I response "DISPID_MUAE_ONIMWINDOWCREATED" event, and use "pDispParams->rgvarg[0].pdispVal" to query "IMessengerConversationWnd", I find it returns "E_NOINTERFACE". It says "pIMWindow [in] Pointer to a IDispatch interface on the MessengerConversationWnd object that corresponds to the added contact. Using this pointer, clients can now code to its IMessengerConversationWnd interface." by MSDN, but seems not work, why?
some of the code is showing below:
class MessengerEvents; class msgr_impl : public IUnknown { public: msgr_impl(IMessenger* pMsgr); ~msgr_impl();
ULONG STDMETHODCALLTYPE AddRef(); ULONG STDMETHODCALLTYPE Release(); STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject);
protected: MessengerEvents* m_pMessengerEvents; DWORD m_dwRefCount; IMessenger * m_pIMessenger; IConnectionPoint* m_pConnectionPoint; DWORD m_dwCookie; };
////////////////////////////////////////////////////////////////////////// class MessengerEvents : public IDispatch { public: MessengerEvents(msgr_impl *pmsn); ~MessengerEvents();
STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject); ULONG STDMETHODCALLTYPE AddRef(); ULONG STDMETHODCALLTYPE Release(); HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int FAR* pctinfo); HRESULT STDMETHODCALLTYPE GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo); HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId); HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* parResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr);
private: msgr_impl* m_pmsn; };
////////////////////////////////////////////////////////////////////////// msgr_impl::msgr_impl(IMessenger* pMsgr) : m_pIMessenger(pMsgr) { IConnectionPointContainer* pCPContainer; IID iid;
m_dwRefCount = 1; HRESULT hr = m_pIMessenger->QueryInterface(IID_IConnectionPointContainer,(void**)(&pCPContainer)); m_dwCookie = 0; if (SUCCEEDED(hr)) { // IID of DMSNMessengerEvents IIDFromString(OLESTR("{3824755B-F0AB-409A-A30D-14B8107DE0EA}"), &iid); hr = pCPContainer->FindConnectionPoint(iid, &m_pConnectionPoint);
if (SUCCEEDED(hr)) { m_pMessengerEvents = new MessengerEvents(this); hr = m_pConnectionPoint->Advise(m_pMessengerEvents, &m_dwCookie); }
if (pCPContainer) pCPContainer->Release(); } } msgr_impl::~msgr_impl() { m_pConnectionPoint->Unadvise(m_dwCookie); m_pConnectionPoint->Release(); if (m_pMessengerEvents) delete m_pMessengerEvents; }
ULONG STDMETHODCALLTYPE msgr_impl::AddRef() { return ++m_dwRefCount; } ULONG STDMETHODCALLTYPE msgr_impl::Release() { if(!--m_dwRefCount) delete this; return m_dwRefCount; }
STDMETHODIMP msgr_impl::QueryInterface(REFIID iid, void ** ppvObject) { if(ppvObject == NULL) return E_INVALIDARG; *ppvObject = NULL;
if(iid == IID_IUnknown) *ppvObject = (IUnknown*)this; else if(iid == DIID_DMessengerEvents || iid == IID_IDispatch) *ppvObject = m_pMessengerEvents; if(*ppvObject == NULL) return E_NOINTERFACE;
AddRef();
return S_OK; }
////////////////////////////////////////////////////////////////////////// MessengerEvents::MessengerEvents(msgr_impl *pmsn) { m_pmsn = pmsn; } MessengerEvents::~MessengerEvents() {}
STDMETHODIMP MessengerEvents::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* parResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr) { if (!pDispParams) return E_INVALIDARG;
switch (dispIdMember) { case DISPID_MUAE_ONSIGNIN: { if (pDispParams->rgvarg[0].lVal == S_OK) { } } break; case DISPID_MUAE_ONSIGNOUT: { } break; case DISPID_MUAE_ONIMWINDOWCREATED: { IDispatch * pDispIMWnd = pDispParams->rgvarg[0].pdispVal; IMessengerConversationWnd* pWnd = NULL; HRESULT hres = pDispIMWnd->QueryInterface(__uuidof(IMessengerConversationWnd),(void**)&pWnd);
int i = 0; } break; case DISPID_MUAE_ONIMWINDOWADD: { IDispatch * pDispContact = pDispParams->rgvarg[0].pdispVal; IMessengerContact* pContact = NULL; HRESULT hres = pDispContact->QueryInterface(__uuidof(IMessengerConversationWnd),(void**)&pContact);
IDispatch * pDispIMWnd = pDispParams->rgvarg[1].pdispVal; IMessengerConversationWnd* pWnd = NULL; hres = pDispIMWnd->QueryInterface(__uuidof(IMessengerContact),(void**)&pWnd);
int i = 0; } break; default: break; }
return S_OK; }
STDMETHODIMP MessengerEvents::QueryInterface(REFIID iid, void ** ppvObject) { return m_pmsn->QueryInterface(iid, ppvObject); }
ULONG STDMETHODCALLTYPE MessengerEvents::AddRef() { return m_pmsn->AddRef(); }
ULONG STDMETHODCALLTYPE MessengerEvents::Release() { return m_pmsn->Release(); }
HRESULT STDMETHODCALLTYPE MessengerEvents::GetTypeInfoCount(unsigned int FAR* pctinfo) { return E_NOTIMPL; }
HRESULT STDMETHODCALLTYPE MessengerEvents::GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo) { return E_NOTIMPL; }
HRESULT STDMETHODCALLTYPE MessengerEvents::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId) { return E_NOTIMPL; }
msgr_impl* pMsn; BOOL _TryHookIMessenger(REFCLSID rclsid, IClassFactory *pIClassFactory) { CLSID clsid; IID iid;
HRESULT clsidFromProg = CLSIDFromProgID(OLESTR("MSNMessenger.UIAutomation"), &clsid); if(clsidFromProg != S_OK) { return FALSE; }
if (!IsEqualCLSID(rclsid, clsid)) { return FALSE; } // IID of IMSNMessenger HRESULT iidFromStr = IIDFromString(OLESTR("{249E2D41-44DD-4D64-9B6B-D5FD76BD85B1}"), &iid); if (iidFromStr != S_OK) { return FALSE; }
IMessenger* pIMessenger = NULL; HRESULT createInstance = pIClassFactory->CreateInstance(NULL, iid, (void **)&pIMessenger); if (createInstance != S_OK) { return FALSE; }
pMsn = new msgr_impl(pIMessenger); return TRUE; }
HRESULT STDAPICALLTYPE MyCoRegisterClassObject( REFCLSID rclsid, IUnknown *pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister ) { IClassFactory *pIClassFactory = NULL; HRESULT queryClassFacResult = pUnk->QueryInterface(IID_IClassFactory, (void **)&pIClassFactory);
if (queryClassFacResult == S_OK) { _TryHookIMessenger(rclsid, pIClassFactory); }
CoRegisterClassObject_Type OldFn = (CoRegisterClassObject_Type)HookOLE32Fun.Functions[COREG_CoRegisterClassObject]. OrigFun;
HRESULT hr = OldFn( rclsid, pUnk, dwClsContext, flags, lpdwRegister );
return hr; }
By the way, my MSN version is 8.1.0178.0
|
|
|
|
 |
|
 |
I work on VOIP recording software - on the transmitter part. I can easily record most voip applications since they all use DirectSHow. Since DitectShow capturing doesn't implement a special capture filter but use classic multimedia functions, I simply hook these functions and implement my own recording. Problem is with MSN Messenger (and also Windows Messenger) which implement something else. It uses waveInOpen only for query, and I don't know how to trace the blocks being sent to the other side. I saw somewhere (probably in this group) that its using full-duplex com object, but this information doesn't help me, since it doesn't exports any helpful function for hooking.
Does anyone have some experience with that and/or can some suggestions?
Regards
Kalish
|
|
|
|
 |
|
 |
Hi
Most of applications I have seen use wave API for recording/playing in VoIP world. Anyway, I have never tried something like recording the call out of process but you can probably hook to waveInAddBuffer which is called by application just after it calls waveInOpen and this function is called each time a buffer is filled by OS. So, you should hook to take the pointer of that buffer whenever a call to waveInAddBuffer is called and copy it when that application's callback function is called.
In VoIP world most protocols used are open source so its easier to catch data at network level. The other way would be to hook to socket API itself. If VoIP application is using RTP for media transmission than you can simply hook to sendto (not send as VoIP apps use UDP socks) function and parse the RTP header (simple) and record the audio data out of it. This would be easier way if you are recording both incoming and outgoing data. You will need intelligence in your hook to see if that is an RTP packet or not.
If application is not using RTP then you can find out the protocol it uses for voice and then you can hook to its sendto and recvfrom functions. I think MSN Messenger uses RTP/RTCP also. 3 famous VoIP protocols SIP, MGCP and H323 usually use RTP for their media transmission.
Research on voip clients and protocols they are using and then adapt your approach. There are some softwares on linux for recording and decoding RTP data like that. Check www.sf.net for that.
I hope I was of some help.
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
Thanks Mr. Tili,
It seems that you helped me alot. With most VOIP applications I manged to hook the multimedia functions and doing the recording. Regarding MSN Messenger, it doesn't use waveInAddBuffer since I couldn't hook it (while I could, the other mulimedia functions). Thats why I was stack with this application. However, I'm going to learn the RTP protocol, and implement your advises. I hope it'll work.
Meantime thanks and good luck.
kalish
|
|
|
|
 |
|
 |
hi can you help me to record conversation made on particular IP phone over the LAN. is there any way to do it in vc++ code and any API which assist to do it??
waiting for your reply!!!
Rajeche
|
|
|
|
 |
|
 |
Do Messenger windows have associated E-mail addresses like cell phones with text messaging have? I have been sending text messages to cell phones using Outlook and want to switch to sending the message to a Messenger window/conversation.
Paul sends...
|
|
|
|
 |
|
 |
Hi, I tried your exe but it doesn't work on my system (win2000 and MSN 6.1). Apparently it is not able to start MSN. Is it expected to work on this configuration?
Thanks Stefano
|
|
|
|
 |
|
 |
Hi.
Well this was written with MSN Messenger 3.6 and worked till MSN Messenger 5 came. From then the interfaces pretty much changed and we also lost control as we had on earlier versions.
To try this article you will have to get msn messenger 3.6 or 4. 3.6 was very open so try to get it.
Mail me if you get any problems. Thanks.
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
can you update this for msn 6.1?
|
|
|
|
 |
|
 |
Hi.
I will try to get something for MSN 6.1
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
just want to make sure one thing, since the type lib for msn messenger 6.1 is not registered under windows xp, I wonder if there still a way to get the type lib from windows xp.
I know msn messenger 6.1 still implement most of the COM interface as of windows messenger. I want to make sure the automationg works for all version of windows. here what I have tried so far:
since the type lib is still enbeded in the msnmsgr.exe, but the interface is changed slightly. so I imported those registry key from win 2k and found the type lib. I extracted the type lib IDL file but having trouble compiling it into type lib.
can you clarify this?
thx
koo9
|
|
|
|
 |
|
 |
Hi.
I guess for this purpose we will need to create 2 versions of application and allow users to download one for each type of messenger. (i.e., Windows XP and other windows).
Can you mail me the code you are using. I might be able to help then.
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
Tile,
Very useful project and neatly done. I'm also looking forward to the forthcoming MSN 6.1 implementation. Any idea when?
Thanks. Franz J. E. Almondsbury UK
|
|
|
|
 |
|
 |
Hi.
I am working on it. It should be available soon. Do you have any special application in mind to build with it.
bye
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
|
 |
|
 |
Hi, this is a cool article. I've been looking for the VB.Net equivalent for QueryInterface to try and automate a custom COM control for an application. Could you post a VB.Net version?
Thanks in advance for any help you can give.
Tad
|
|
|
|
 |
|
 |
I doubt the author will supply a VB.NET version. Anyhow, you should look into COMInterop libraries (on msdn.microsoft.com) of .NET if you want to use COM objects from .NET . Keep in mind there is substantial overhead with using interop b/c the CLR has to marshall calls from an unmanaged environment to a managed environment (.NET).
R.Bischoff .NET, Kommst du mit?
|
|
|
|
 |
|
 |
Hi, thank you for your nice working.
When someone sends a voice conversation invitation to me, how could I get the event/notify?
I know there may be one way using messenger service as p2p. But it will limit to both sides installed with third-party defined software. Is there a better solution without that limit?
vrf
~Bingle~
|
|
|
|
 |
|
 |
Hi. Sorry i am out of country so and i dont have access to my code.
But as far as voice notification is concerned try to check APP NOTIFY event. where it notifies for app INVITE. I dont remember exact name.
Yes SDK for 6 is not available. But may be its the same as old one.
I dont know about Yahoo SDK.
But if you are trying to build your own messenger then you can get some info on their internal protocols. and open source messenger softwares. like Jabber.
----------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
Thank you, Tili.
Are you sure any version of MSN Messenger API/SDK ever provide the NOTIFY event for Voice conversation invitaion? I only have MSN API for Windows Messenger 4.7 @ 2001-2003 Microsoft Corporation copyright. I could not find NOTIFY event of voice conversation invitaion from it.
I wonder if you have some version of MSN Messenger API/SDK I haven't. For example, the formers. How many versions do you have? if you could give me any advices about where and how to get some othere versions of MSN Messenger API/SDK? 
It is good if msn 6.0 still support old msn sdk.
I don't intend to make my own messenger but just some add-in functions for Messenger like ring of voice conversation invitaion coming.
~Bingle~
|
|
|
|
 |