CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35
  1. #31
    Join Date
    May 2013
    Posts
    46

    Re: c++ injection does not work on windows 8.1

    Good morning ,

    Here is the situation now, i did try using the Debugger inside the Visual Studio IDE and when i created my DLL and called it inside another program, it gave the following output.

    Code:
    'ViewCppDLL.exe': Loaded 'C:\Users\Emi\Documents\Visual Studio 2012\Projects\EmefoBankApp\ViewCppDLL\Debug\ViewCppDLL.exe', Symbols loaded.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\mscoree.dll', Cannot find or open the PDB file.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\msvcr110d.dll', Symbols loaded.
    'ViewCppDLL.exe': Loaded 'C:\Users\Emi\Documents\Visual Studio 2012\Projects\EmefoBankApp\ViewCppDLL\Debug\DLLTest.dll', Symbols loaded.
    'ViewCppDLL.exe': Loaded 'C:\Windows\SysWOW64\msvcp110d.dll', Symbols loaded.
    Welcome To C++ Dll
    First-chance exception at 0x77e8e0b2 in ViewCppDLL.exe: 0xC0000142: DLL Initialization Failed.
    Unhandled exception at 0x77e8e0b2 in ViewCppDLL.exe: 0xC0000142: DLL Initialization Failed.
    The program '[5940] ViewCppDLL.exe: Native' has exited with code -1 (0xffffffff).
    it loaded this sucessfully , the source code of the DLL
    Code:
    #include <stdio.h>
    #include "hellodll.h"
    #include <stdlib.h>
    #include <windows.h>
    
    extern "C" _declspec(dllexport)void sayHello()
    {
    	OutputDebugString("Welcome To C++ Dll\n");
    }
    
    BOOL DllMain(HINSTANCE hInstDLL, DWORD ul_reason_for_call, LPVOID lpReserved)
    {
    	switch (ul_reason_for_call)
    	{
    	case DLL_PROCESS_ATTACH:
    		sayHello();
    		break;
    	case DLL_PROCESS_DETACH:
    		break;
    	case DLL_THREAD_ATTACH:
    		sayHello();
    		break;
    	case DLL_THREAD_DETACH:
    		break;
    	default:
    		break;
    	}
    }
    As you can see , No worries. Now here is what, i injected the code into another Exe using the Injector source code i showed on here when i tried using Ollydbg to reverse the program to see if the code was injected i didnt see the string. i decided to use Debugview, to see if i can debug the application, i havent seen this 'Welcome to C++' inside the debugger.

    Am i getting the process correctly or is there something i am missing, kindly let me know

  2. #32
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: c++ injection does not work on windows 8.1

    Quote Originally Posted by mindjos View Post
    ...
    Am i getting the process correctly or is there something i am missing, kindly let me know
    No, you are not.
    As you see there was
    First-chance exception at 0x77e8e0b2 in ViewCppDLL.exe: 0xC0000142: DLL Initialization Failed.
    Have a look at
    http://forums.codeguru.com/showthrea...31#post1288531
    and some other discussions of this "0xC0000142: DLL Initialization Failed" problem:
    https://www.google.ch/search?q=0xC00...m=122&ie=UTF-8
    Victor Nijegorodov

  3. #33
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: c++ injection does not work on windows 8.1

    Quote Originally Posted by mindjos View Post
    I also get your point, but see what am trying to do.
    I absolutely understood what you're trying to do, and that's why I recommended what I recommended. So far your dll is not prepared for being injected. Please read this twice. Until you get it realy ready for injection, there is no point to fumble with injection. I don't know how to make this simple thought be more clear. When you craft a spaceship, you test it on earth first, only then you launch it.

    By the way, there is much more easy way to make sure your dll is successfully injected. The way is called Process Explorer. So you just get rid of all the odd stuff in dll, and inject it with your injector, and inspect your victim with Process Explorer.
    Best regards,
    Igor

  4. #34
    Join Date
    May 2013
    Posts
    46

    Re: c++ injection does not work on windows 8.1

    Guess I still need to learn a lot then. Suppose I saw a video, maybe it would be more clearer.
    Been battling with this all night haven't even slept peacefully lol

    I see what I can come up with by tomorrow and get back to you, maybe other examples or tutorials you could render could be helpful

    Thanking you again @igor most grateful

  5. #35
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: c++ injection does not work on windows 8.1

    Quote Originally Posted by mindjos View Post
    Am i getting the process correctly or is there something i am missing, kindly let me know
    Afraid your DllMain does not return TRUE which makes Windows believe the loading has failed.
    Best regards,
    Igor

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured