Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[SOLVED]Close WLM Ad Window
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Sat Dec 27, 2008 7:40 pm    Post subject: Reply with quote

Rot1 wrote:
DoomsDay wrote:
Rot1, add the following to the restricted sites lists (under internet settings):
rad.msn.com


This, right ?
Code:
http://rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMSHIS&AP=1007
Correct Razz
Blocking the host should keep it for the long term
Back to top
View user's profile Send private message
ElJEffro
Grandmaster Cheater Supreme
Reputation: 0

Joined: 15 Apr 2007
Posts: 1881
Location: La Tierra

PostPosted: Sun Dec 28, 2008 1:02 am    Post subject: Reply with quote

Or use pidgin
But destroying it didn't work? I don't even have MSNM installed Laughing
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Dec 28, 2008 1:13 am    Post subject: Reply with quote

Efficiency!

Code:

HWND Get_MSN_Ad_Handle()
 {
  return FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindow("MSBLWindowClass",NULL),NULL,"DirectUIHWND",NULL),NULL,"CtrlNotifySink",NULL),NULL,"MSNMSBLGeneric",NULL),NULL,"Shell Embedding",NULL),NULL,"Shell DocObject View",NULL),NULL,"Internet Explorer_Server",NULL);
 }


No use of variables!
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Dec 28, 2008 1:24 am    Post subject: Reply with quote

ughhhh

i would check the before / after on the assembly that the compiler spit out. just because you used a variable, doesn't mean it didn't get optimized out.
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Dec 28, 2008 1:47 am    Post subject: Reply with quote

slovach wrote:
ughhhh

i would check the before / after on the assembly that the compiler spit out. just because you used a variable, doesn't mean it didn't get optimized out.


Yes, that is possible, but he checks if every handle is a valid one, then on the main code he checks again, so it's best to just check on the main code.

anyway, for anyone that wants to see the assembly:

My code:
Code:

00401000   /$  56                 PUSH ESI
00401001   |.  6A 00              PUSH 0                                           ; /Title = NULL
00401003   |.  68 14214000        PUSH ASM.00402114                                ; |Class = "Internet Explorer_Server"
00401008   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
0040100A   |.  6A 00              PUSH 0                                           ; |/Title = NULL
0040100C   |.  68 30214000        PUSH ASM.00402130                                ; ||Class = "Shell DocObject View"
00401011   |.  6A 00              PUSH 0                                           ; ||hAfterWnd = NULL
00401013   |.  6A 00              PUSH 0                                           ; ||/Title = NULL
00401015   |.  68 48214000        PUSH ASM.00402148                                ; |||Class = "Shell Embedding"
0040101A   |.  6A 00              PUSH 0                                           ; |||hAfterWnd = NULL
0040101C   |.  6A 00              PUSH 0                                           ; |||/Title = NULL
0040101E   |.  68 58214000        PUSH ASM.00402158                                ; ||||Class = "MSNMSBLGeneric"
00401023   |.  6A 00              PUSH 0                                           ; ||||hAfterWnd = NULL
00401025   |.  6A 00              PUSH 0                                           ; ||||/Title = NULL
00401027   |.  68 68214000        PUSH ASM.00402168                                ; |||||Class = "CtrlNotifySink"
0040102C   |.  6A 00              PUSH 0                                           ; |||||hAfterWnd = NULL
0040102E   |.  6A 00              PUSH 0                                           ; |||||/Title = NULL
00401030   |.  68 78214000        PUSH ASM.00402178                                ; ||||||Class = "DirectUIHWND"
00401035   |.  6A 00              PUSH 0                                           ; ||||||hAfterWnd = NULL
00401037   |.  6A 00              PUSH 0                                           ; ||||||/Title = NULL
00401039   |.  68 88214000        PUSH ASM.00402188                                ; |||||||Class = "MSBLWindowClass"
0040103E   |.  FF15 B8204000      CALL DWORD PTR DS:[<&USER32.FindWindowA>]        ; ||||||\FindWindowA
00401044   |.  8B35 B4204000      MOV ESI,DWORD PTR DS:[<&USER32.FindWindowExA>]   ; ||||||USER32.FindWindowExA
0040104A   |.  50                 PUSH EAX                                         ; ||||||hParent = 00882F70
0040104B   |.  FFD6               CALL ESI                                         ; |||||\FindWindowExA
0040104D   |.  50                 PUSH EAX                                         ; |||||hParent = 00882F70
0040104E   |.  FFD6               CALL ESI                                         ; ||||\FindWindowExA
00401050   |.  50                 PUSH EAX                                         ; ||||hParent = 00882F70
00401051   |.  FFD6               CALL ESI                                         ; |||\FindWindowExA
00401053   |.  50                 PUSH EAX                                         ; |||hParent = 00882F70
00401054   |.  FFD6               CALL ESI                                         ; ||\FindWindowExA
00401056   |.  50                 PUSH EAX                                         ; ||hParent = 00882F70
00401057   |.  FFD6               CALL ESI                                         ; |\FindWindowExA
00401059   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
0040105A   |.  FFD6               CALL ESI                                         ; \FindWindowExA
0040105C   |.  5E                 POP ESI                                          ;  ASM.00401065
0040105D   \.  C3                 RETN





Rot1's code:

Code:
00401000   /$  51                 PUSH ECX                                         ;  MSVCR90.__initenv
00401001   |.  6A 00              PUSH 0                                           ; /Title = NULL
00401003   |.  68 14214000        PUSH ASM.00402114                                ; |Class = "MSBLWindowClass"
00401008   |.  FF15 B8204000      CALL DWORD PTR DS:[<&USER32.FindWindowA>]        ; \FindWindowA
0040100E   |.  85C0               TEST EAX,EAX
00401010   |.  74 6D              JE SHORT ASM.0040107F
00401012   |.  56                 PUSH ESI
00401013   |.  8B35 B4204000      MOV ESI,DWORD PTR DS:[<&USER32.FindWindowExA>]   ;  USER32.FindWindowExA
00401019   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040101B   |.  68 24214000        PUSH ASM.00402124                                ; |Class = "DirectUIHWND"
00401020   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401022   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401023   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401025   |.  85C0               TEST EAX,EAX
00401027   |.  74 4F              JE SHORT ASM.00401078
00401029   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040102B   |.  68 34214000        PUSH ASM.00402134                                ; |Class = "CtrlNotifySink"
00401030   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401032   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401033   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401035   |.  85C0               TEST EAX,EAX
00401037   |.  74 3F              JE SHORT ASM.00401078
00401039   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040103B   |.  68 44214000        PUSH ASM.00402144                                ; |Class = "MSNMSBLGeneric"
00401040   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401042   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401043   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401045   |.  85C0               TEST EAX,EAX
00401047   |.  74 2F              JE SHORT ASM.00401078
00401049   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040104B   |.  68 54214000        PUSH ASM.00402154                                ; |Class = "Shell Embedding"
00401050   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401052   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401053   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401055   |.  85C0               TEST EAX,EAX
00401057   |.  74 1F              JE SHORT ASM.00401078
00401059   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040105B   |.  68 64214000        PUSH ASM.00402164                                ; |Class = "Shell DocObject View"
00401060   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401062   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401063   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401065   |.  85C0               TEST EAX,EAX
00401067   |.  74 0F              JE SHORT ASM.00401078
00401069   |.  6A 00              PUSH 0                                           ; /Title = NULL
0040106B   |.  68 7C214000        PUSH ASM.0040217C                                ; |Class = "Internet Explorer_Server"
00401070   |.  6A 00              PUSH 0                                           ; |hAfterWnd = NULL
00401072   |.  50                 PUSH EAX                                         ; |hParent = 00882F70
00401073   |.  FFD6               CALL ESI                                         ; \FindWindowExA
00401075   |.  5E                 POP ESI                                          ;  ASM.00401095
00401076   |.  59                 POP ECX                                          ;  ASM.00401095
00401077   |.  C3                 RETN
00401078   |>  8B4424 04          MOV EAX,DWORD PTR SS:[ESP+4]                     ;  ASM.0040121D
0040107C   |.  5E                 POP ESI                                          ;  ASM.00401095
0040107D   |.  59                 POP ECX                                          ;  ASM.00401095
0040107E   |.  C3                 RETN
0040107F   |>  8B0424             MOV EAX,DWORD PTR SS:[ESP]                       ;  ASM.00401095
00401082   |.  59                 POP ECX                                          ;  ASM.00401095
00401083   \.  C3                 RETN




Back to top
View user's profile Send private message MSN Messenger
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Dec 28, 2008 5:10 am    Post subject: Reply with quote

Zerith: Holy shit, i think it's because i used WideChar and not AnsiChar, i will check again.

also, i installed MSVS 2008 COMPLETE and WLM 2009 BETA 2, now when i compile the project in Debug mode and execute it, and runs an error saying "variable hAd is not being initialized", that's weird cause when i run it in Release mode it will output "Handle Found".

DoomsDay wrote:
Rot1 wrote:
DoomsDay wrote:
Rot1, add the following to the restricted sites lists (under internet settings):
rad.msn.com


This, right ?
Code:
http://rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMSHIS&AP=1007
Correct Razz
Blocking the host should keep it for the long term


It works like a charm Smile, but i still want to destory the window to feel "I did it !" Very Happy.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Dec 28, 2008 9:51 am    Post subject: Reply with quote

Rot1 wrote:
Zerith: Holy shit, i think it's because i used WideChar and not AnsiChar, i will check again.


So dumb so dumb so dumb so dumb.

You think what's because you used unicode??
All the extra shit code you have?

It's because you do so many checks, seeing if the handles are valid.

What's the point of all those checks??
The only thing that really matters is that your code returns hAD with a valid handle which isn't possible, regardless of all the checks.

If the previous calls to FindWindowEx fail, they will just return NULL, and then hAD will return NULL.


Useless checks are useless.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Dec 28, 2008 1:36 pm    Post subject: Reply with quote

smartz993 wrote:
Rot1 wrote:
Zerith: Holy shit, i think it's because i used WideChar and not AnsiChar, i will check again.


So dumb so dumb so dumb so dumb.

You think what's because you used unicode??
All the extra shit code you have?

It's because you do so many checks, seeing if the handles are valid.

What's the point of all those checks??
The only thing that really matters is that your code returns hAD with a valid handle which isn't possible, regardless of all the checks.

If the previous calls to FindWindowEx fail, they will just return NULL, and then hAD will return NULL.


Useless checks are useless.


No offence, but i don't want help from people like you who don't know SHIT, also it's important to do this check.

cause if 1 fails without checking, the rest fails and hAd will return nothing, so this way i can know from which one the error comes from.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Dec 28, 2008 1:56 pm    Post subject: Reply with quote

Rot1 wrote:
smartz993 wrote:
Rot1 wrote:
Zerith: Holy shit, i think it's because i used WideChar and not AnsiChar, i will check again.


So dumb so dumb so dumb so dumb.

You think what's because you used unicode??
All the extra shit code you have?

It's because you do so many checks, seeing if the handles are valid.

What's the point of all those checks??
The only thing that really matters is that your code returns hAD with a valid handle which isn't possible, regardless of all the checks.

If the previous calls to FindWindowEx fail, they will just return NULL, and then hAD will return NULL.


Useless checks are useless.


No offence, but i don't want help from people like you who don't know SHIT, also it's important to do this check.

cause if 1 fails without checking, the rest fails and hAd will return nothing, so this way i can know from which one the error comes from.


Judging by the lack of code, you'll never know which one failed. You are an absolute retard. Thanks so much<3 i love your siggy meng<3333333

Right Rot1, i'm the one who knows nothing, when you think Zerith's comparison between your code and his, is because you are using unicode. RIGHT !
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Dec 28, 2008 2:05 pm    Post subject: Reply with quote

smartz993 wrote:
Rot1 wrote:
smartz993 wrote:
Rot1 wrote:
Zerith: Holy shit, i think it's because i used WideChar and not AnsiChar, i will check again.


So dumb so dumb so dumb so dumb.

You think what's because you used unicode??
All the extra shit code you have?

It's because you do so many checks, seeing if the handles are valid.

What's the point of all those checks??
The only thing that really matters is that your code returns hAD with a valid handle which isn't possible, regardless of all the checks.

If the previous calls to FindWindowEx fail, they will just return NULL, and then hAD will return NULL.


Useless checks are useless.


No offence, but i don't want help from people like you who don't know SHIT, also it's important to do this check.

cause if 1 fails without checking, the rest fails and hAd will return nothing, so this way i can know from which one the error comes from.


Judging by the lack of code, you'll never know which one failed. You are an absolute retard. Thanks so much<3 i love your siggy meng<3333333

Right Rot1, i'm the one who knows nothing, when you think Zerith's comparison between your code and his, is because you are using unicode. RIGHT !


I solved it, thanks to everyone in this thread except you, cause all you did was troll due to lack of knowledge.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Dec 28, 2008 2:28 pm    Post subject: Reply with quote

How efficient can it be? it's just like 5 function calls...
Anyhow, if you really wanna make it a little more efficient:
Code:
wchar_t* WindowsNames[] = { L"DirectUIHWND", L"CtrlNotifySink", L"MSNMSBLGeneric", L"Shell Embedding", L"Shell DocObject View", L"Internet Explorer_Server" };

HWND hwnd = FindWindow(L"MSBLWindowClass", NULL);
for (int i = 0; i < sizeof(WindowsNames) / sizeof(wchar_t*) && hwnd; i++)
hwnd = FindWindowEx(hwnd, NULL, WindowsNames[i], NULL);


By the way, Rot1, smartz is right, useless checks are useless. Rolling Eyes
I could remove the "&& hwnd" part, but I don't want to keep trying getting handles if the handle is 0, because then the return value is obviously 0.
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Sun Dec 28, 2008 9:21 pm    Post subject: Re: [SOLVED]Close WLM Ad Window Reply with quote

Rot1 wrote:

Code:
HWND Get_MSN_Ad_Handle()
{
   HWND hAd;

   HWND hMSN = FindWindow(TEXT("MSBLWindowClass"), NULL);
   if(hMSN)
   {
      HWND hDirectUI = FindWindowEx(hMSN, NULL, TEXT("DirectUIHWND"), NULL);
      if(hDirectUI)
      {
         HWND hNotifySink = FindWindowEx(hDirectUI, NULL, TEXT("CtrlNotifySink"), NULL);
         if(hNotifySink)
         {
            HWND hMSNGeneric = FindWindowEx(hNotifySink, NULL, TEXT("MSNMSBLGeneric"), NULL);
            if(hMSNGeneric)
            {
               HWND hShellEmbed = FindWindowEx(hMSNGeneric, NULL, TEXT("Shell Embedding"), NULL);
               if(hShellEmbed)
               {
                  HWND hShellObjectView = FindWindowEx(hShellEmbed, NULL, TEXT("Shell DocObject View"), NULL);
                  if(hShellObjectView)
                  {
                     hAd = FindWindowEx(hShellObjectView, NULL, TEXT("Internet Explorer_Server"), NULL);
                  }
               }
            }
         }
      }
   }

   return hAd;
}



So much extra useless stuff.. Hell, you could just do this.
Code:
HWND Get_MSN_Ad_Handle()
{
   return FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindowEx(FindWindow(TEXT("MSBLWindowClass"), NULL), NULL, TEXT("DirectUIHWND"), NULL), NULL, TEXT("CtrlNotifySink"), NULL), NULL, TEXT("MSNMSBLGeneric"), NULL), NULL, TEXT("Shell Embedding"), NULL), NULL, TEXT("Shell DocObject View"), NULL), NULL, TEXT("Internet Explorer_Server"), NULL);
}


Or at least this? :
Code:
HWND Get_MSN_Ad_Handle()
{
   HWND hMSN = FindWindow(TEXT("MSBLWindowClass"), NULL);
   HWND hDirectUI = FindWindowEx(hMSN, NULL, TEXT("DirectUIHWND"), NULL);
   HWND hNotifySink = FindWindowEx(hDirectUI, NULL, TEXT("CtrlNotifySink"), NULL);
   HWND hMSNGeneric = FindWindowEx(hNotifySink, NULL, TEXT("MSNMSBLGeneric"), NULL);
   HWND hShellEmbed = FindWindowEx(hMSNGeneric, NULL, TEXT("Shell Embedding"), NULL);
   HWND hShellObjectView = FindWindowEx(hShellEmbed, NULL, TEXT("Shell DocObject View"), NULL);
   return FindWindowEx(hShellObjectView, NULL, TEXT("Internet Explorer_Server"), NULL);
}


On a side note, your signature reads:

Quote:
List Of People Who Are Jealous Of Smart People:

Smartz993 AKA Idiotz993


That's not a list, that's one fucking person. Looks like you tried and failed to copy his signature.
Back to top
View user's profile Send private message Visit poster's website
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Mon Dec 29, 2008 6:41 am    Post subject: Reply with quote

He forgot to add "Rot1" to his list..., He could add a few to that list, including me O.o, who wouldnt like to be as smart as Dark Byte, smartz, x0r, etc...?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites