Comments (12)
Well how does your executable get its arguments?
Is it via GetCommandLineA()/GetCommandLineW()? You can either hook that or replace the saved pointer.
MOV EAX, DS:[some address]
RETN
Starting with Win 7 (IIRC) it's in another DLL so you have to search in kernelbase.dll
Is it via int main(int argc, char** argv)
? That is set by your CRT, the one provided by Visual Studio uses msvcrt.dll's __getmainargswhich uses
_acmdln` (Both symbols are exported). You can either hook that or replace the saved pointer.
from memorymodule.
I don't want the solution to be limited to only one executable, I would like it to be working as if I did :
executables.exe -arg1 -arg2
is there a way to do that with MemoryModule ?
I don't know yet which executable I will be using and how it work internally
from memorymodule.
i have added support for arguments in a pull request (that has since been accepted) to a fork by another person -> https://github.com/kost/MemoryModule once his changes are included, arguments will work
from memorymodule.
I've partially implemented it in my fork.
https://github.com/FusixGit/MemoryModule
Interception takes place at the stage of import.
from memorymodule.
This can be done with MemoryLoadLibraryEx() by setting the *userdata to *argv[]. Both of our patches are not needed. (I recommend this issue be closed)
from memorymodule.
@vyrus001 Not quite. The exe will still call GetCommandLine
which returns whatever args were passed to the program using MemoryModule. In order to pass args to a memory loaded exe you will have to find and replace the GetCommandLine
function with a pointer to a string in memory that contains the arguments.
from memorymodule.
@kernel-sanders any illustration for that ?
from memorymodule.
It has been done in other projects, see: Invoke-ReflectivePEInjection.ps1#L2058
However, it is likely easier to just use donut.
from memorymodule.
how to pass arguments to a dll ? @kernel-sanders
from memorymodule.
It looks like you are attempting to write cryptomining malware. I suggest spending your talents elsewhere.
from memorymodule.
not really. I am making experiments. @kernel-sanders i work with security
from memorymodule.
from memorymodule.
Related Issues (20)
- Create Activation Context Implementation (with code)
- Bug results in crash when loading some DLLs. (with code fix!) HOT 4
- Starting Calc.exe fails (partial fix with code) HOT 2
- PDB Files Not Loaded for DLL's
- running the FARPROC type function fails
- Memory on kernel
- can MemoryCallEntryPoint accept parameters? just like a command line with parameters?
- c# compiled exe load supported ? HOT 1
- 64-bit DLL compiled by G++ failed to load. HOT 1
- cannot load DLL that use OpenSSL? HOT 2
- Link with dllloader
- new failed to allocate memory
- BUG in FinalizeSection
- .pyd files from Python - MemoryModule HOT 5
- Use Unicode version of LoadLibrary HOT 2
- Support for VirtualMachine Libraries
- Can not use CString in vs2015 and newer version , it seems like dynamiclly load Thread Local Storage can not be supported in MemmoryModule??
- Creation of Rust bindings
- MemoryGetProcAddress fails to import a function by ordinal number if dll has no exported names HOT 1
- Need to use it in C# with and unmanaged dll HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memorymodule.