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

  • Home
  • SEARCH
  • 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 187793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:53:12+00:00 2026-05-11T15:53:12+00:00

Lets assume I’ve allocated the address where my codecave is placed using VirtualAllocEx (it

  • 0

Lets assume I’ve allocated the address where my codecave is placed using VirtualAllocEx (it returns the address) and I write my code into that address using WriteProcessMemory().

Here’s the question:

How do I write a jump to my codecave? I know that jumps start with ‘E9‘, but how do I convert the address returned by VirtualAllocEx into a correct UInt32 (dword) so the debugger/compiler will understand the instruction?

For example:

I’m at address 00402020 (OEP of the native app). I write a jump to 004028CF (empty place) ‘JMP 004028CF‘. The instruction in bytes looks like this:

CPU Disasm Address   Hex dump      Command                                  Comments 00402020  E9 AA080000   JMP 004028CF 

‘E9‘ is how we indicate a JMP. What about ‘AA080000‘, how do I generate this?

I need to do something similar so I can initialize a JMP to my codecave, which will be located at an address returned by VirtualAllocEx().

Any help will be gratefully appreciated!

Thanks in advance.

  • 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. 2026-05-11T15:53:13+00:00Added an answer on May 11, 2026 at 3:53 pm

    E9 is a relative jump so the later 32 bits are just an offset to the current instruction pointer. See Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2A: Instruction Set Reference, A-M pages 549ff for details. For more information see Intel® 64 and IA-32 Architectures Software Developer’s Manuals.

    So the opcode to jump from 00402020 to 004028CF should be the following.

         E9  00 00 08 AA 
    Offset   = DestinationAddress - CurrentInstructionPointer 000008AA = 004028CF           - 00402025 

    When the jump instruction is executed, the instruction pointer is already set to the next instruction. So the offset of the jump instruction and the current instruction pointer value differ by 5.

    CurrentInstructionPointer = AddressOfJumpInstruction + 5 

    UPDATE

    Corrected error about the current instruction pointer value. Thanks jn.

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

Sidebar

Ask A Question

Stats

  • Questions 111k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use a System.Windows.Forms.Timer. Set its Interval property to be your… May 11, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer You can try using -[NSEntityDescription attributesByName]. This will give you… May 11, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer I just checked with this Online XPATH Evaluators and it… May 11, 2026 at 9:50 pm

Related Questions

Let's assume I have a model called product. Let's assume that product has three
Let's assume I'm a complete lazy bum and I don't want to invest the
Let's assume I'm creating a simple class to work similar to a C-style struct,
Let's assume I have a C# Winforms project, MainGUI. It references another project in
Let's assume I have a table with a CreatedBy Datetime column with a default

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.