[HELP] trying to do dll injection for the first time! menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] trying to do dll injection for the first time!

    Okey, i have made 2 applications:

    1x C# injector (i read that it was possible)
    1x C dll file

    Now, im trying to hack minesweeper(since im a noob and all). My C# application is the one doing the injection to the process MineSweeper.exe, i think its working, so i would like someone to comment my C dll please.

    DLLfile:
    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    DWORD ThreadID;
    int *mine1  = (int*)0x1F6C84C;    //Offset for score1
    int *mine2  = (int*)0x4485E8;    //Offset for score1
    
    DWORD WINAPI changeTime(LPVOID lParam) {
          while(1)
    	  {
                  *mine1 = 66;
    			  *mine2 = 66;
    	  }
                  
          ExitThread(0);
    }
    
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        if(reason == DLL_PROCESS_ATTACH) 
    	{
    		MessageBox(*(new HWND), LPWSTR("Dll Injection Successful! "), LPWSTR("Dll Injector"), MB_ICONEXCLAMATION | MB_OK);
    
            CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&changeTime, 0, 0, &ThreadID);
    	}
    
        return TRUE;
    }
    Reason why i have 2 of the *mine (mine1 and mine2) is that i used TSearch on Minesweeper application and found that both of them yield the count on total mineflags left. (im trying to edit the number to 66 as you can see)

    [HELP] trying to do dll injection for the first time!
  2. #2
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't directly cast to LPTHREAD_START_ROUTINE. Bad news for x64 folks. Don't create a msgbox in dllmain either.

    Also. One of those addresses looks like it would be in the .code section.

  3. #3
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Don't directly cast to LPTHREAD_START_ROUTINE. Bad news for x64 folks. Don't create a msgbox in dllmain either.

    Also. One of those addresses looks like it would be in the .code section.
    Will it not work then?

    tryed:
    Code:
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
    	MessageBox(0, LPWSTR("TEST"), LPWSTR("TEST"), MB_ICONEXCLAMATION | MB_OK);
    ...
    ...
    The messagebox(straight after DllMain) does not show up! (then i think its not loaded... or?)

  4. #4
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Create the messagebox inside the thread you create. Just make your thread function the correct way and you don't have to cast to LPTHREAD_START_ROUTINE. It's on MSDN.

  5. #5
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Create the messagebox inside the thread you create. Just make your thread function the correct way and you don't have to cast to LPTHREAD_START_ROUTINE. It's on MSDN.
    Tried to google it but i cant seem to find the example/page you are reffering to... if its not to much, could you write the code(just copy paste)/edit my code to what you would have written?

    It is my first C code ever!

  6. #6
    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)
    Originally Posted by Shutzler View Post
    Tried to google it but i cant seem to find the example/page you are reffering to... if its not to much, could you write the code(just copy paste)/edit my code to what you would have written?

    It is my first C code ever!
    You're retarded for trying to hack games without even knowing how to program in C.

Similar Threads

  1. Buying a wow account for the first time.
    By lt1camaro13 in forum Community Chat
    Replies: 1
    Last Post: 11-21-2009, 01:41 PM
  2. [Story] How KuRIoS got drunk for the first time.
    By [Ban Hammer] in forum Community Chat
    Replies: 7
    Last Post: 06-30-2009, 12:57 PM
  3. Compiling for the first time ~ LIBEAY32.dll Error
    By foxmulder135 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 05-15-2009, 02:12 AM
  4. i just got suspended for the first time
    By tweak9969 in forum World of Warcraft General
    Replies: 8
    Last Post: 05-10-2007, 10:28 AM
All times are GMT -5. The time now is 03:21 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