ManualMap - A manual mapper for x86 modules menu

User Tag List

Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 50
  1. #16
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ManualMap - A manual mapper for x86 modules
  2. #17
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    ..pic
    I think you scared him off... lol.... xD

  3. #18
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was excited somebody else was working on a public mapper. Now I'm sad.

  4. #19
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Well it just does not solve all my problems... Drivers would be the next step...

  5. #20
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    Well it just does not solve all my problems... Drivers would be the next step...
    wut is your problem son

  6. #21
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Manual mapping is the act of allocating a virtual block in the target process, then writing an image file to it, mapped in the same fashion as the native loader. The only benefits you have are, no peb ldr data entry, and no mapped section object. But you could still find the region with virtual queries. Unless you hooked ntqueryvirtualmemory. But then blizz could map the syscall id and call it manually, game over. Therefor rootkit/drivers

  7. #22
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    Manual mapping is the act of allocating a virtual block in the target process, then writing an image file to it, mapped in the same fashion as the native loader. The only benefits you have are, no peb ldr data entry, and no mapped section object. But you could still find the region with virtual queries. Unless you hooked ntqueryvirtualmemory. But then blizz could map the syscall id and call it manually, game over. Therefor rootkit/drivers
    "But then blizz could map the syscall id and call it manually, game over." <-- Similar to how Blizzard detected LuaNinja, so there's certainly precedent.

    Manual mapping isn't really useful for public cheats, but it's fun to try and write one! (More useful in packers etc)

  8. #23
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    More useful in packers? What is a packer... I guess I'm not up to date with the tech lingo.

    I would love to know what you think about drivers and how you would implement something like manual mapping with drivers. I know they are also not the best solution. As glider used drivers but became detected.

  9. #24
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    More useful in packers? What is a packer... I guess I'm not up to date with the tech lingo.

    I would love to know what you think about drivers and how you would implement something like manual mapping with drivers. I know they are also not the best solution. As glider used drivers but became detected.
    A packer as in a binary protector/packer. Something like UPX that takes a binary and 'packs' it somehow (either to compress it, or obfuscate it, or both).

    Anyway, writing a driver to cloak arbitrary memory regions is hard, especially in multi-core/multi-processor systems. It's not something I've investigated in a long long time (since about the time Glider was just getting popular, and a friend and I were toying with the idea of writing an injected bot protected by a memory cloaking driver), so I'm definitely not the person to ask for up-to-date information on how one might go about doing that.

    People have certainly tried implementing such rootkits, but I don't know of any off the top of my head that are much more than proof-of-concepts developed for presentations or white-papers. I can't even think of any public attempts to write one that worked on x64 and/or multi-processor/core systems (at least not without a gigantic perf hit).

    Sorry I can't be of any help. If you do try it though be sure to start a thread here recording your progress, it'd be quite interesting.

  10. #25
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit: first post was probably hard to understand, ill try harder.

    maybe you can as cypher said, start a project and post it here. I can help you because i have done this on multi-cpu platforms already.

    these steps aren't going to be great in detail, just the general idea of what you need to do.

    -determine cpu topology and number of logical processors (use the windows provided api's or CPUID. i personally used and prefer the latter)

    -determine a method to flush the L2 cache on all logical cpu's after your modification process.

    -find and locate the VAD of your target process

    -walk the VAD avl tree (recursion) and unlink the targeted memory region.

    -if this memory gets paged out, the page fault handler uses the VAD of the current task for the page-in process. if its not there - BSOD

    -add the pages to the working set with VirtualLock or lock them from your driver, but beware that a process terminating with locked pages also = BSOD. so register a callback?

    you can pm me if you need help.
    Last edited by sitnspinlock; 11-17-2012 at 08:34 PM.

  11. #26
    DarthTon's Avatar Contributor
    Reputation
    171
    Join Date
    Apr 2010
    Posts
    108
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can actually disable DEP for process in run-time. Just set only these flags in KPOCESS:
    Code:
    Flags.ExecuteEnable		
    Flags.ImageDispatchEnable	
    Flags.ExecuteDispatchEnable
    And voila! you can use SEH handlers out of image.

  12. #27
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarthTon View Post
    You can actually disable DEP for process in run-time. Just set only these flags in KPOCESS:
    Code:
    Flags.ExecuteEnable		
    Flags.ImageDispatchEnable	
    Flags.ExecuteDispatchEnable
    And voila! you can use SEH handlers out of image.
    yeh but i think their idea was to not implement a driver just for that single purpose of changing kexecute_flags.

    assuming no cert, they'd have to ask their users to install a driver with their machine booted in test mode.

    to that extent, some types of DRM know whether or not the system was booted with those flags and fail to work. (because CI.dll initializes in a different manner based on testsigning or /debug)

  13. #28
    DarthTon's Avatar Contributor
    Reputation
    171
    Join Date
    Apr 2010
    Posts
    108
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, using only usermode stuff you can write this function into target process

    PHP Code:
    typedef _EXCEPTION_DISPOSITION(__cdecl *_pexcept_handler)
        (
            
    _EXCEPTION_RECORD *ExceptionRecord,
            
    void EstablisherFrame,
            
    _CONTEXT *ContextRecord,
            
    void DispatcherContext
        
    );

    LONG CALLBACK VectoredHandler32_In_ PEXCEPTION_POINTERS ExceptionInfo )
    {
        
    EXCEPTION_REGISTRATION_RECORD  *pFs    = (EXCEPTION_REGISTRATION_RECORD*)__readfsdword(0);
        
    EXCEPTION_DISPOSITION            res    ExceptionContinueSearch;

        
    // Prevent CRT from calling handlers in chain with EH_UNWINDING
        
    for(; res == ExceptionContinueSearch && pFs && pFs != (EXCEPTION_REGISTRATION_RECORD*)0xffffffffpFs pFs->Next__writefsdword(0, (DWORD)pFs))
        {
            
    ExceptionInfo->ExceptionRecord->ExceptionFlags &= ~EXCEPTION_UNWIND;

            if(
    pFs->Handler)
            {
                
    // Last frame contains special handler with __stdcall convention
                
    if(pFs->Next != (EXCEPTION_REGISTRATION_RECORD*)0xffffffff)
                    
    res = ((_pexcept_handler)pFs->Handler)(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);
                else
                    
    res pFs->Handler(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);

                
    // Unwind stack properly
                
    if(res == ExceptionContinueSearch)
                {
                    
    ExceptionInfo->ExceptionRecord->ExceptionFlags |= EXCEPTION_UNWIND;

                    if(
    pFs->Next != (EXCEPTION_REGISTRATION_RECORD*)0xffffffff)
                        
    res = ((_pexcept_handler)pFs->Handler)(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);
                    else
                        
    res pFs->Handler(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);
                }
            }
        }

        
    // We are screwed if got here
        
    return EXCEPTION_CONTINUE_SEARCH;

    And execute "AddVectoredExceptionHandler(0, &VectoredHandler32)" there. This will redirect to first SEH frame handler, no matter where it resides.

    Edit: Should now work properly for nested SEH frames, C++ EHa and unwind C++ stack.
    Last edited by DarthTon; 11-22-2012 at 04:11 AM. Reason: Fail correction

  14. #29
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarthTon View Post
    Hm, using only usermode stuff you can write this function into target process

    PHP Code:
    typedef _EXCEPTION_DISPOSITION(__cdecl *_pexcept_handler)
        (
            
    _EXCEPTION_RECORD *ExceptionRecord,
            
    void EstablisherFrame,
            
    _CONTEXT *ContextRecord,
            
    void DispatcherContext
        
    );

    LONG CALLBACK VectoredHandler32_In_ PEXCEPTION_POINTERS ExceptionInfo )
    {
        
    EXCEPTION_REGISTRATION_RECORD  *pFs    = (EXCEPTION_REGISTRATION_RECORD*)__readfsdword(0);
        
    EXCEPTION_DISPOSITION            res    ExceptionContinueSearch;

        
    // Prevent CRT from calling handlers in chain with EH_UNWINDING
        
    for(; res == ExceptionContinueSearch && pFs && pFs != (EXCEPTION_REGISTRATION_RECORD*)0xffffffffpFs pFs->Next__writefsdword(0, (DWORD)pFs))
        {
            if(
    pFs->Handler)
            {
                
    // Last frame contains special handler with __stdcall convention
                
    if(pFs->Next != (EXCEPTION_REGISTRATION_RECORD*)0xffffffff)
                    
    res = ((_pexcept_handler)pFs->Handler)(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);
                else
                    
    res pFs->Handler(ExceptionInfo->ExceptionRecordpFsExceptionInfo->ContextRecordNULL);
            }
        }

        return 
    EXCEPTION_CONTINUE_SEARCH;

    And execute "AddVectoredExceptionHandler(0, &VectoredHandler32)" there. This will redirect to first SEH frame handler, no matter where it resides.

    Edit: Should now work properly for nested SEH frames.
    Neat! I'm curious, does that also cope with C++EH? I seem to remember issues caused by the CRT doing its own extra checks etc on C++EH.

  15. #30
    DarthTon's Avatar Contributor
    Reputation
    171
    Join Date
    Apr 2010
    Posts
    108
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My code does seem to work for C++EH. But if exception isn't caught by first frame, c++ stack won't be unwinded properly (no destructors will be called). For such cases manual unwinding is needed.

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [Request] want Morph for x86 5.2 UPDATED!
    By galadr1el in forum WoW Bots Questions & Requests
    Replies: 2
    Last Post: 12-14-2013, 10:20 AM
  2. [Release] Simple Wow Morpher for x86
    By dan934 in forum World of Warcraft Bots and Programs
    Replies: 244
    Last Post: 04-29-2013, 03:00 AM
  3. Generic Dll Injector for x86 and x64 + Export Caller
    By Cypher in forum WoW Memory Editing
    Replies: 14
    Last Post: 03-31-2013, 05:45 PM
  4. Looking for warden modules from 1.12.1
    By namreeb in forum WoW Memory Editing
    Replies: 12
    Last Post: 05-02-2012, 02:24 AM
All times are GMT -5. The time now is 12:05 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search