Skip to content

Does the ReflectiveDllMain function also work in other DLLs? #136

@Alcinzal

Description

@Alcinzal

I have a working C++ DLL project where DllMain executes properly on load, however I wish to inject this DLL file from PowerShell fully in memory. This would work similarly to how your project works, specifically the Stager and the ReflectiveDllMain function. Initially I thought that all I needed was the Stager, but looking deeper into it, it seems I must also change the DLL file to include a ReflectiveDllMain function.

If I understand it correctly the Stager will load the DLL in memory, but can't call DllMain directly, therefore it calls ReflectiveDllMain which does all the heavy lifting of memory management and such, and then at last this function calls the DllMain function.

I guess what I am wondering is if your implementation of the ReflectiveDllMain function in this project also works for other DLLs with minimal/no changes? Or if it is necessary for me to make a lot of modifications for the function to work?

How would you suggest I approach/navigate this challenge?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions