flat assembler
Message board for the users of flat assembler.

Index > Windows > Write user tex to console ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1807
Roman 28 Jul 2024, 10:05
I have main window WS_POPUP. And I want add console.
This code work.
Code:
.code
  start:
        invoke  AllocConsole
        invoke GetStdHandle,STD_OUTPUT_HANDLE
        invoke  WriteConsole,eax,tex,12,dummy,0
        invoke  Sleep,-1
.end start

.data
tex     TCHAR   'Hello World!'
dummy   rd      1  
    

But my console not do input text, if i write on keyboard.
How fix this ?
And ReadConsole not get text from console. But must returned 'Hello World!'
Post 28 Jul 2024, 10:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20358
Location: In your JS exploiting you and your system
revolution 28 Jul 2024, 10:42
You are writing to STD_OUTPUT_HANDLE, but instead you need to write to the console you allocated.
Post 28 Jul 2024, 10:42
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1807
Roman 28 Jul 2024, 13:54
ReadConsole wait input to console and halts all program.
Post 28 Jul 2024, 13:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20358
Location: In your JS exploiting you and your system
revolution 28 Jul 2024, 20:01
Using the STD_*_HANDLE doesn't talk to the allocated console.

You need to talk to the console you allocated. When you allocate the console you get a handle to it. Use that handle to talk to it.
Post 28 Jul 2024, 20:01
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.