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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:39:51+00:00 2026-05-21T15:39:51+00:00

I want to be able to find out where the code appearing at the

  • 0

I want to be able to find out where the code appearing at the entry point comes from by looking at the PE header.

For example, this piece of code is the starting code of my program(401000h)

00401000 >/$ 58             POP EAX                                  ;  kernel32.76E93677
00401001  |. 2D 77360100    SUB EAX,13677
00401006  |. BB 4A184000    MOV EBX,<JMP.&kernel32.VirtualProtect>

I want to know where this code comes from. How can I find it without manually scanning my file? (to complete the example, here’s an hexdump from the same file, the code now resides at 200h)

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000200   58 2D 77 36 01 00 BB 4A  18 40 00 

How can I get from my virtual entry point (401000h) to the raw entry point (200h)?
I tried solving it myself of course. But I’m missing something. At first I thought:

.text[ Entrypoint (1000h) – VirtualOffset (1000d) ] = raw entrypoint
since the file alignment = 200, and the raw entry point was at the very start of my .text section, I thought I could use this for all the executables.

Solved, I made stupid mistakes when calculating the raw entry point

.text[ Entry point – Virtual offset ] + File Alignment = Raw entry point (relative to .text section)

  • 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-21T15:39:51+00:00Added an answer on May 21, 2026 at 3:39 pm

    To locate the offset in the file by yourself you need to have a look at the _IMAGE_NT_HEADERS structure. From this you can get the IMAGE_OPTIONAL_HEADER where
    the member you are interested in ImageBase is. You can change its value with EditBin /REBASE so there is little need to roll your own tool.

    For reference how you can determine the entry point via dumpbin.

    You can use
    dumpbin /headers

    dumpbin /headers \Windows\bfsvc
    
    Dump of file \Windows\bfsvc.exe
    
    PE signature found
    
    File Type: EXECUTABLE IMAGE
    
    FILE HEADER VALUES
                 14C machine (x86)
                   4 number of sections
            4A5BBFB3 time date stamp Tue Jul 14 01:13:55 2009
                   0 file pointer to symbol table
                   0 number of symbols
                  E0 size of optional header
                 102 characteristics
                       Executable
                       32 bit word machine
    
    OPTIONAL HEADER VALUES
                 10B magic # (PE32)
                9.00 linker version
                DE00 size of code
                2000 size of initialized data
                   0 size of uninitialized data
                4149 entry point (01004149)
                1000 base of code
                F000 base of data
             1000000 image base (01000000 to 01011FFF)
                1000 section alignment
                 200 file alignment
    

    For the entry point the image base value is relevant. But this is only true for images that are not ASLR enabled. For them a random base address (1 of 128 different ones) is choosen.
    The flag that indicates if an image is ASLR enabled is the value 0x40 which is set in DLL characteristics.

    8140 DLL characteristics
    

    For svchost.exe for example it is set for older programs it is generally 0.

    Yours,
    Alois Kraus

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

Sidebar

Related Questions

I want to be able to find out if an event is hooked up
I want to be able to find out which DOM elements are present in
I want to be able to find out when a page element is on
I want to be able to limit Perl's File::Find to a directory depth (below
I want to be able to email a report daily from a glpi database
I want to be able to invoke an SSIS package at will from a
I'm new at OpenGL and I can't find out how to do this: I
So I've been searching around and cannot find out exactly how to do this.
I want to be able to get an estimate of how much code &
I want to be able to get an estimate of how much code &

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.