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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:28:06+00:00 2026-05-14T15:28:06+00:00

i was looking how to inject a dll into a program (exe, or dll,

  • 0

i was looking how to inject a dll into a program (exe, or dll, etc). i have been googleing dll injecting but i have not found anything that is very helpful :(. i have not worked with dlls very much so im not sure on what to do, i really could use some help on this.

uhh the only thing i have really found is setwindowshookex but i can’t find any examples for it and i don’t how to use it. any questions just ask and i’ll try to help.

EDIT hey i was googling and this looks like something about dll injecting that is worth looking at but i can’t get the code to run :\ (How to hook external process with SetWindowsHookEx and WH_KEYBOARD)

  • 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-14T15:28:06+00:00Added an answer on May 14, 2026 at 3:28 pm

    The method I’m most familiar with was is was described by Jefferey Richter in Programming Applications for Microsoft Windows. I mention this because even if you don’t get your hands on the book itself there is probably sample code floating around. I think he may have also written some journal articles. He, also mentions a couple of alternative approaches, of which I will describe only one, from memory. He also may have written some MSJ / MSDN articles that are relevant.

    Anyway, the basic idea is to cause the process that you want to load your DLL to issue a call to LoadLibrary. This is done using CreateRemoteThread with the address of LoadLibary for lpStartAddress and the address of a string naming your DLL in for lpParameter. Arranging for and locating the string is done using VirtualAllocEx to allocate some memory in the remote process, and WriteProcessMemory to fill it with the string.

    PSEUDO CODE:

    void InjectDllIntoProcess(DWORD processId, char *dllName)
    {
      HANDLE hRemoteProcess = OpenProcess(
    
      // Assumes that dll and function addresses are the same in different processes
      // on the same system. I think that this is true even with ASLR, only issue I
      // can think of is to make sure that the source and target process are both 32
      // or both 64 bit, not a mixture.
      // Note that it is asking for the ASCII version
      HMODULE hDll = LoadLibrary(_T("Kernel32.dll"));
      void *loadLibAddr = GetProcAddress(hDll, _T("LoadLibraryA"));
    
    
      // Inject the DLL name
      char * remoteAddr = 
            (char *)VirtualAllocEx(hRemoteProcess, NULL, strlen(dllName) + 1, ...
      WriteProcessMemory(hRemoteProcess, remoteAddr, dllName, strlen(dllName) + 1 ...
    
      CreateRemoteThread(hRemoteProcess, ??, 0, loadLibAddr, remoteAddr, ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 366k
  • Answers 366k
  • 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 It is described in for the absoluteZ function: For the… May 14, 2026 at 4:36 pm
  • Editorial Team
    Editorial Team added an answer This is absolutely acceptable. We sell a couple products that… May 14, 2026 at 4:36 pm
  • Editorial Team
    Editorial Team added an answer It's OK. I was doing like with Rails 2. With… May 14, 2026 at 4:36 pm

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.