flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > invoke bug?

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 22 Aug 2005, 21:25
My program kept crashing and noticed something that didn't look right.

Code:
       ;the orginal invoke command
        invoke  CnvtSItoA64, debugtxt, 0, [edx+8*4]

        00402163 ff7220           push    dword ptr [edx+0x20]
        00402166 6a00             push    0x0 ;<---- Shouldn't this be a DWORD size?
        00402168 6828104000       push    0x401028
        0040216d ff1551324000     call    dword ptr [Winprint+0x3251 (00403251)]    
Post 22 Aug 2005, 21:25
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 22 Aug 2005, 21:38
Nothing is wrong with that, opcode 0x6a is "push byte constant" opcode, but it actually pushes a dword (substracts 4 from esp).
Hey, if it was a bug then almost no win32 app would work:
Code:
invoke MessageBox, 0, text, title, 0
    

Wink
Post 22 Aug 2005, 21:38
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 22 Aug 2005, 22:17
Hmmm, didn't know that Surprised. Thanks for clearing that up Smile . Looked from the disassembly that something was wrong. Oh well, back to programming, false alarm Smile
Post 22 Aug 2005, 22:17
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 22 Aug 2005, 22:22
Push opcode always moves dword value on the stack. It's just a feature in x86 that when the value is between -128 and 127 it is stored as a byte. You can always manually do like this: 'db 68h, 00h, 00h, 00h, 00h'
Post 22 Aug 2005, 22:22
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.