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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:40:16+00:00 2026-06-09T19:40:16+00:00

Ok so I have a question about step 3 of C++ Dll Injection ,

  • 0

Ok so I have a question about step 3 of C++ Dll Injection, that is:

Use CreateRemoteThread(). You can point it at LoadLibrary() as the entry point and the file path from steps 1 and 2 as the argument. That’s a bit hacky, to be honest, but if you are injecting a DLL you’re already being quite hacky. Another technique would be to use steps 1 & 2 to load some machine code into the remote proceess and point it at that.

So my question is: After I allocated memory using VirtualAllocEx, and writing the code with WriteProcessMemory, how do I make the call to CreateRemoteThread — and by that I mean what are the fourth and fifth parameters?

My code:

AllocatedMem = VirtualAllocEx(Proc, IntPtr.Zero, code.Length,
    AllocationType.Reserve | AllocationType.Commit, MemoryProtection.ReadWrite);

WriteProcessMemory(Proc, AllocatedMem, code, code.Length, IntPtr.Zero);

CreateRemoteThread(Proc, IntPtr.Zero, 0, AllocatedMem,
    IntPtr.Zero, 0, IntPtr.Zero);
  • 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-09T19:40:18+00:00Added an answer on June 9, 2026 at 7:40 pm

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms682437(v=vs.85).aspx

    HANDLE WINAPI CreateRemoteThread(
      _In_   HANDLE hProcess,
      _In_   LPSECURITY_ATTRIBUTES lpThreadAttributes,
      _In_   SIZE_T dwStackSize,
      _In_   LPTHREAD_START_ROUTINE lpStartAddress,
      _In_   LPVOID lpParameter,
      _In_   DWORD dwCreationFlags,
      _Out_  LPDWORD lpThreadId
    );
    

    hProcess ia handle to the process in which the thread should be created.

    lpThreadAttributes can be NULL to specify “use default”

    dwStackSize can be zero to specify “use default”

    lpStartAddress is the address IN THE FOREIGN PROCESS where the thread will begin executing

    lpParameter is the argument passed to the ThreadMain in the foreign process (i.e. in the foreign process, lpStartAddress is assumed called using WINAPI calling convention with lpParameter as the only parameter).

    dwCreationFlags can be zero.

    lpThreadId should be a pointer to a DWORD that receives the thread id if successful.

    If you set lpStartAddress to the address of LoadLibraryW and set lpParameter to a pointer IN THE FOREIGN PROCESS to L”foo.dll”, then when the thread starts in the foreign process it will immediately call LoadLibraryW(L”foo.dll”) in the foreign process, allowing you to run code from inside your DllMain.

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

Sidebar

Related Questions

I have a general question about debugging a .NET process that has been built
i have a question about modelstate in asp.net mvc3 that , i have a
I have a question about python standard logging mechanism. So if I use logging.config.fileConfig
I have a question regarding how I should go about fixing an error that
I have a basic question. 1- I want to use Science.dll provided at http://www.sciencecode.com/
I have question about parsing in Html helper : I have sth like: @foreach
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
I have question about XSLT1.0. The task is to write out in HTML all
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,

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.