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 1808418
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:15:32+00:00 2026-05-17T06:15:32+00:00

I’ve been compiling simple Hello World applications in Visual Studio 2010 with the C++

  • 0

I’ve been compiling simple Hello World applications in Visual Studio 2010 with the C++ compiler (Win32 is the target) to see what the product looks like under the microscope when I run it with the Immunity debugger. What I’ve noticed, however, is that there is some code (quite a bit of code, actually) that gets run before my main function is reached. A lot of this stuff looks security related or maybe prepping the system to manage processes or what not, but there’s just a TON of it there. Morever, the EntryPoint part of the PE file header seems to point into the interior of my .text segment, while it appears that my main() function is resting at the very beginning of the .text segment. My question is this: is there some good documentation regarding this prelude that is getting slapped onto the front of my code AND/OR is the main() function typically placed at the very beginning of the .text segment by the VC++ compiler? Thanks for any insight you have!

  • 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-05-17T06:15:32+00:00Added an answer on May 17, 2026 at 6:15 am

    The compiler places your user code at the beginning of the .text segment because that’s where you would expect to find your code. All other non-user code is placed in the end after yours which are necessary to for the programs to work as you expect but you don’t need to worry about. When writing a C program, you expect certain things to be available such as the command line arguments in a local array, initializing global variables, making sure standard I/O is available and important other things needed by the C runtime things that need to be initialized.

    If you look at the source code for the routines, the comments explain why it is needed.

    These routines do the C runtime initialization, call the appropriate
    user entry function, and handle termination cleanup. For a managed
    app, they then return the exit code back to the calling routine, which
    is the managed startup code. For an unmanaged app, they call exit and
    never return.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

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.