Re: Is MASM32 an evil Microsoft plot?
From: hutch-- (hutch_at_movsd.com)
Date: 11/13/04
- Next message: Betov: "Re: Is MASM32 an evil Microsoft plot?"
- Previous message: The Wannabee: "Re: Is MASM32 an evil Microsoft plot?"
- Maybe in reply to: Annie: "Re: Is MASM32 an evil Microsoft plot?"
- Next in thread: C: "Re: Is MASM32 an evil Microsoft plot?"
- Reply: C: "Re: Is MASM32 an evil Microsoft plot?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Nov 2004 00:09:59 -0800
Now lets have a look at this can of worms.
> WndProc:
> CMP dword ptr[ESP+8],WM_DESTROY ;Destroy window?
> JNZ DefWindowProcA ;No, pass msg to default msg handler
> PUSH 0
> CALL PostQuitMessage ;Send WM_QUIT message
> XOR EAX,EAX ;Return code
> RET 16
First you make a direct jump into the guts of an API call without
having a clue about what goes on inside the system code, a
particularly dangerous coding practice that risks falling down around
your ears if Microsoft change any of the internals of how the function
works.
What you are assuming here is the architecture of old DOS junk where
byte level size optimisation was supposed to matter but any script
kiddie already knows that procedure alignment trashes most of the so
called advantages of doing so.
Now your next blunder is to call the default windows message handler
when you are following it with a PostQuitMessage() function call. Now
if you had bothered to track down what actually happens when the
PostQuitMessage() sends the WM_QUIT message you would have found out
that the WM_QUIT message is documented to do the following.
WIN32.HLP
======================
Return Values
This message does not have a return value, because it causes the
message loop to terminate before the message is sent to the
application's window procedure.
======================
A classic example of a redundant function call by a highly self
acclaimed leading assembler guru who has all of 5 minutes experience
at programming windows code.
> If you're going to brag about how small the code can be with MASM, at least
> write small code. Nobody is going to believe the propaganda on your site
> until you do. The problem is that you will have to give up all the PROC,
> PROTO and LOCAL nonsense that makes MASM such a travesty to assembly. Then
> you could use most any assembler and the whole advocacy for MASM disappears.
It seems that there is the assumption that you are the only person
around who knows how to manually lay out a procedure.
label:
; your code
retn
Lets do it in HEX to please the kiddies.
;; label:
;; your code to be added
C3 ;; retn
Is there supposed to be some profundity at addressing the stack
manually or is it supposed to be some form of hidden knowledge that a
stack address without a stack frame begins at [esp+4] ?
> Thanks for proving my point.
Not even divine intervention could help you here.
Regards,
hutch at movsd dot com
- Next message: Betov: "Re: Is MASM32 an evil Microsoft plot?"
- Previous message: The Wannabee: "Re: Is MASM32 an evil Microsoft plot?"
- Maybe in reply to: Annie: "Re: Is MASM32 an evil Microsoft plot?"
- Next in thread: C: "Re: Is MASM32 an evil Microsoft plot?"
- Reply: C: "Re: Is MASM32 an evil Microsoft plot?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|