flat assembler
Message board for the users of flat assembler.

Index > Windows > weird result using win32wx.inc

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 9133
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
hi,
using the default TEMPLATE.ASM file (coming with fasm latest)
i tried the following and discover (maybe buffer overflow or etc)

i change the following for TEMPLATE.ASM

Code:
include 'win32w.inc'
to
include 'win32wx.inc'

then i add the following.
        cmp     [wmsg],WM_CREATE
        je      .wmcreate

  .wmcreate:
        invoke  MessageBox,0,'Yahoo',0
        jmp     .finish
    


now, u assemble it, it will runs and pop up a messagebox 'Yahoo'.

then u do the following.

u change the
Code:
_title TCHAR 'Win32 program template',0
to
_title TCHAR 'A',0
    


then the messagebox will not coming anymore.
am using the fasm IDE, F9 to assemble & run.
Post 25 Nov 2011, 23:05
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Wrong !
Code:
invoke  MessageBox,0,'Yahoo',0 
    


Correct

Code:
invoke  MessageBox,0,'Yahoo',0,0
    


MessageBox API takes 4 arguments not 3
Post 26 Nov 2011, 03:07
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9133
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
oh, damn stupid mistake i made, lol.
Post 26 Nov 2011, 05:54
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Switch to 'win32wxp.inc' so you can detect errors like these.
Post 26 Nov 2011, 15:07
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9133
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
thanks LocoDelAssembly, will try it ! Smile
Post 27 Nov 2011, 14:50
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.