flat assembler
Message board for the users of flat assembler.

Index > Windows > Why MessageBoxA don't work..

Author
Thread Post new topic Reply to topic
asm0day_ru



Joined: 11 Jul 2014
Posts: 2
Location: russia
asm0day_ru
attach


Description: attach
Download
Filename: 0.asm
Filesize: 926 Bytes
Downloaded: 63 Time(s)


_________________
http://asm0day.xe0.ru
Post 07 Jan 2015, 15:26
View user's profile Send private message Send e-mail Visit poster's website ICQ Number Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
because you have hardcoded this?
Code:
mb db 6ah,?,6ah,?,6ah,?,6ah,?,0e8h,0bh,0edh,7fh,76h,0c3h    

you don't really pass valid pointer to MessageBox API.
Post 07 Jan 2015, 18:25
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
asm0day_ru,

Are you sure that VirualAlloc() will return proper address so that call rel32 will transfer control to MessageBoxA()? call ptr16:32 probably can alleviate that problem, to a some extent. Wink
Post 08 Jan 2015, 15:51
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1419
Location: Toronto, Canada
AsmGuru62
I tried his code in OllyDbg.
Allocation is ok, but he hardcoded the address of (presumably) MessageBoxA - these last bytes at 'mb' vector.
They point to inaccessible memory.
Post 08 Jan 2015, 16:05
View user's profile Send private message Send e-mail Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
AsmGuru62,

Guess why? It seems to me that he's not understanding what that code's doing (allocation of one byte is just marvelous). Wink
Post 08 Jan 2015, 17:02
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1419
Location: Toronto, Canada
AsmGuru62
If he knows API - he kows that allocating 1 byte is actually allocating a page of memory.
Smile
Post 08 Jan 2015, 17:53
View user's profile Send private message Send e-mail 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.