Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7997229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:55:29+00:00 2026-06-04T14:55:29+00:00

In response to my question about Windows API’s, I have successfully gotten it to

  • 0

In response to my question about Windows API’s, I have successfully gotten it to work. My question is in regards to this code:

push STD_OUTPUT_HANDLE
    call GetStdHandle
    push NULL
    push offset other
    push mlen
    push offset msg
    push eax
    call WriteConsole
push    0
call ExitProcess

This code is supposed to print the value of msg. Why does one need to do:

a)

push STD_OUTPUT_HANDLE
    call GetStdHandle
    push NULL

And:

b)

push offset other
    push mlen
    push offset msg
    push eax

I am just wondering what the need is for getting a StdHandle and pushing offsets.

Thanks in advance,

Progrmr

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:55:30+00:00Added an answer on June 4, 2026 at 2:55 pm

    Look at the definition of WriteConsole. The NULL is the last argument of the function, the lpReserved argument. Arguments are pushed in right-to-left order. The first function argument is the console handle, the one you got from GetStdHandle and you pass by pushing eax.

    So properly commenting the assembly code:

    push STD_OUTPUT_HANDLE          ; GetStdHandle nStdHandle argument
    call GetStdHandle               ; eax = Console handle
    push NULL                       ; lpReserved = null
    push offset other               ; lpNumberOfCharsWritten = pointer to "other"
    push mlen                       ; nNumberOfCharsToWrite = length of "msg"
    push offset msg                 ; lpBuffer = pointer to "msg"
    push eax                        ; hConsoleOutput = console handle from GetStdHandle
    call WriteConsole               ; Write string
    push    0                       ; exit code = 0
    call ExitProcess                ; terminate program
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question on superuser , but haven't gotten a response. Maybe here
I have been looking at the answer to this question: Pulling details from response
I'm new to Coffeescript, and I have a question about Ajax. jQuery -> api
There was a highly rated response in a question about header ordering with the
Yesterday I ask a question about videos for websites, and I get response with
This question and my answer below are mainly in response to an area of
I posted this question on Reddit Programming and did not get a single response.
I've asked this question on the Awesomium forms but I haven't received any response
Ok, so this question has been asked before here . In the response/answer to
Another question about Web proxy. Here is my code: IWebProxy Proxya = System.Net.WebRequest.GetSystemWebProxy(); Proxya.Credentials

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.