How to inject DLL from memory stream WITHOUT manual mapping (question) menu

User Tag List

Results 1 to 5 of 5
  1. #1
    TheNoobie's Avatar Private
    Reputation
    2
    Join Date
    Jul 2011
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to inject DLL from memory stream WITHOUT manual mapping (question)

    Well the title pretty much says it all. I'm looking for a method of injecting a DLL directly from a memory stream into a remote process WITHOUT using manual mapping. I have decided to stop using manual mapping for a variety of reasons and I'm looking for an equally safe alternative. Please move this if it's not in the right location, I think it may be better suited in the programming section.

    How to inject DLL from memory stream WITHOUT manual mapping (question)
  2. #2
    TheNoobie's Avatar Private
    Reputation
    2
    Join Date
    Jul 2011
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to be clear in case it confuses anyone, it doesn't really matter whether or not it's from a memory stream. The point is I want to be able to take an array of bytes and inject into a remote process in a similar way as manual mapping but with a different method. I get the weirdest bugs with manual mapping such as linking certain libraries crashes, using strings causes a C Runtime error, memory leaks, many other random crashes / bugs. I tried heavily modifying Darawk's code but I am just not skilled enough with C++ windows programming to create a bug free, nearly perfect version of manual mapping at the moment. I seriously doubt that anyone will have an answer to my question as I've searched long and hard for a solution but I figure it's worth a shot asking the MMOwned community.

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Manual mapping is the process of loading a DLL without using the Windows PE loader. That is, you have to do everything yourself, and if you're (as you say) not an expert you're unlikely to be able to do it correctly. Heck, even when you're an expert it's still very hard to get it 100% right.

    I'm a little confused by your question though. You say you want to inject directly from a byte array in memory, but that you DON'T want to manually map. If you want to use the Windows PE loader then you need to write your data out to disk, then call LoadLibrary. If you DON'T want to use the Windows PE loader then your only option is to manually map!

    Perhaps I'm missing your point, but your question seems to answer itself.

    P.S. I have written a much more stable and powerful manual mapper than the original version Darawk wrote, but it's currently unmaintained. You can dig it up from Misc/Backups in HadesMem if you wish though, it shouldn't be too hard to update/port. There are still quite a few issues with my implementation, but at least you can use exceptions, the STL, the C runtime, floating point code, TLS, etc without it crashing and burning.

  4. #4
    TheNoobie's Avatar Private
    Reputation
    2
    Join Date
    Jul 2011
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much Cypher that is a huge help. I was already pretty sure the only way to do what I was talking about would be to manually map, but given the fact that I am fairly new to Windows programming I thought I would ask if there was a more reliable method. I am glad that I did though, thanks a lot for that - it looks like you truly put a lot of time into it.

  5. #5
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Once I finish my rewrite of the rest of HadesMem I'm going to have another attempt at a manual mapper, there are more bugs I want to fix and more features I want to support. Eventually I'd like to get it to the point where a manually mapped DLL is nearly indistinguishable from one loaded by the PE loader, but I think that's a long way off, at least for the time being.

    I need to reverse engineer the exception dispatching mechanism under x64, as well as the more obscure/undocumented parts of the PE loader to try and emulate some of its 'quirks'.

Similar Threads

  1. How to Inject DLL safely
    By demonguy in forum WoW Memory Editing
    Replies: 5
    Last Post: 11-21-2012, 03:33 AM
  2. how to get from memory X and Y positions
    By jetcar in forum Diablo 3 Bots Questions & Requests
    Replies: 0
    Last Post: 09-02-2012, 01:04 PM
  3. [newbie guide] How to (not) get values from memory
    By zdud in forum Diablo 3 Memory Editing
    Replies: 0
    Last Post: 08-22-2012, 06:05 AM
  4. How to run multiple instances of D3 without copying maps.
    By blablabloto in forum Diablo 3 Guides
    Replies: 1
    Last Post: 06-13-2012, 03:51 PM
  5. [CODE] Dumping Python Modules (from an injected DLL)
    By GliderPro in forum Programming
    Replies: 0
    Last Post: 04-08-2009, 02:20 PM
All times are GMT -5. The time now is 10:40 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search