flat assembler
Message board for the users of flat assembler.

Index > Windows > Some error with program...:(

Author
Thread Post new topic Reply to topic
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13
Please, help with this source:

Code:
format PE console
entry start
include '%fasminc%\win32a.inc'
section '.data' data readable writeable
stdin   dd ?
stdout  dd ?
buffer  rb 256
sizeof.buffer = $-buffer
cW      dd ?
cR      dd ?
section '.code' code readable writeable executable
start:
        invoke  GetStdHandle,STD_OUTPUT_HANDLE
        mov     [stdout],eax
        invoke  GetStdHandle,STD_INPUT_HANDLE
        mov     [stdin],eax
        invoke  ReadConsole,[stdin],buffer,sizeof.buffer,cR,0
        invoke  WriteConsole,[stdout],buffer,[cR],cW
        invoke  ExitProcess,0
section '.idata' import data readable writeable
        library kernel32,'kernel32.dll'
        import kernel32,ExitProcess,'ExitProcess'
        import kernel32,GetStdHandle,'GetStdHandle'
        import kernel32,WriteConsole,'WriteConsoleA'
        import kernel32,ReadConsole,'ReadConsoleA'
    


FASM finds some error in this line:
Code:
import kernel32,GetStdHandle,'GetStdHandle'     

I can't understand why...[/code]

_________________
FASM Rulezzzzzz!
Post 18 Oct 2007, 14:24
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
It is
Code:
        
section '.idata' import data readable writeable 
        library kernel32,'kernel32.dll'

        import kernel32,\
               ExitProcess,'ExitProcess',\
               GetStdHandle,'GetStdHandle',\
               WriteConsole,'WriteConsoleA',\
               ReadConsole,'ReadConsoleA'          
Post 18 Oct 2007, 14:41
View user's profile Send private message Reply with quote
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13
oh.. Thanks:)
Now it really works:))
Post 18 Oct 2007, 14:46
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number 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.