Results 1 to 4 of 4
  1. #1
    ainkut's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    137
    Reputation
    10
    Thanks
    14
    My Mood
    Innocent

    Creating window from successful DLL attachment

    YES! I'm trying to do what GG Trainer in the Maple Story section does. Yep. I'm a copycat.

    So does it pretty much run a normal Windows procedure on successful attach, or how much more condensed is it, if at all possible? I've SEEN what it can do, but, the internet(people on it) say a window cannot be created from a DLL. So I hope I'm right and not blind.

    What do I need to do? I'm learning and playing with the windows part now, I've kinda made an address modifier for a game(didn't work perfectly, but compiled and I understood it. I lack a pointer scanner for it).

    Teach, please.

  2. #2
    ainkut's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    137
    Reputation
    10
    Thanks
    14
    My Mood
    Innocent
    Quote Originally Posted by NathanV2 View Post
    msdn.microsof*****m/en-us/librarydows/desktop/ms645505(v=vs.85).aspx ?
    kinda..?
    maybe i'm not reading that article deeply enough. i'm talking about the entirely in-depth "I can do lots of things with this window"..not really a confirm/deny popup window.

    edit: well if i could get one of those windows to pop up and allow text input, that might work..but i'd still like to know how GG v2 trainer does it's flippin sweet window.
    Last edited by ainkut; 05-15-2012 at 04:43 PM.

  3. #3
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Code:
    HWND myDialog;
    HWND editBox;
    
    void createWindow()
    {
    	myDialog = CreateWindowEx(0, WC_DIALOG,"Just a random window",WS_OVERLAPPEDWINDOW | WS_VISIBLE,	400,100,800,380,NULL,NULL,NULL,NULL	);
    
    	CreateWindow( "listbox", "",
    		WS_VISIBLE|WS_CHILD|LBS_HASSTRINGS|WS_HSCROLL|WS_VSCROLL,
    		0, 0, 780, 300, myDialog, (HMENU)156, 0, NULL);
    
    	editBox = CreateWindow( "edit", "",
    		WS_VISIBLE|WS_CHILD,
    		0, 305, 780, 20, myDialog, (HMENU)158, 0, NULL);
    }
    
    DWORD WINAPI mySexyThread( LPVOID lpParam )
    {
    	while(1)
    	{
    		MSG msg;
    		if(PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
    		{
    			if(msg.hwnd == editBox && msg.message == WM_KEYDOWN && msg.wParam == VK_RETURN)
    			{
    				int len = GetWindowTextLength(editBox);
    				char *tmp = new char[len+1];
    				GetWindowText(editBox, tmp, len+1);
    				string tmps(tmp);
    				if(tmps.find(" ") == string::npos)
    				{
    					if(cvar->FindVar(tmp) != NULL)
    					{
    						int selpos = SendDlgItemMessage(myDialog, 156, LB_ADDSTRING, 0, (LPARAM)tmp);
    						SendDlgItemMessage(myDialog, 156, LB_SETCURSEL, selpos, 0);
    						char tbuff[512] = "";
    						sprintf(tbuff, "\"%s\" = \"%s\" (def. \"%s\")", tmp, cvar->FindVar(tmp)->GetString(), cvar->FindVar(tmp)->m_pszDefaultValue);
    						selpos = SendDlgItemMessage(myDialog, 156, LB_ADDSTRING, 0, (LPARAM)tbuff);
    						SendDlgItemMessage(myDialog, 156, LB_SETCURSEL, selpos, 0);
    					}
    				}
    			}
    		}
    		Sleep(1);
            }
    }
    
    dllmain DLL_PROCESS_ATTACH:
    createWindow();
    CreateThread(0, 0, &mySexyThread, 0, 0, 0);
    it peeks in the message buffer but doesn't remove the message(so the application injected into will still have to handle those), you might be able to use PM_REMOVE for some applications without anything breaking(this was the case for vindictus), or peekmessage with PM_NOREMOVE and if it's supposed to go to your window peekmessage with PM_REMOVE to remove those messages from the buffer.

    Copied & pasted parts from one of my releases, copied in the browser so no idea if it'll work out of the box like that(might need some edits)

    @ainkut
    Last edited by Hell_Demon; 05-16-2012 at 03:39 AM.
    Ah we-a blaze the fyah, make it bun dem!

  4. #4
    ainkut's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    137
    Reputation
    10
    Thanks
    14
    My Mood
    Innocent
    That's cool, thanks. So it's essentially, literally a window from a DLL on thread. I'll look at that some more.

Similar Threads

  1. [Help] New Update from WH.dll pls the LINK!!
    By SacredGold in forum CrossFire Hacks & Cheats
    Replies: 19
    Last Post: 02-26-2010, 11:17 AM
  2. [Help] Dealing with pointers from a dll
    By ctpsolo in forum C++/C Programming
    Replies: 11
    Last Post: 01-26-2010, 11:19 PM
  3. Help with hooking from a dll
    By Anddos in forum C++/C Programming
    Replies: 5
    Last Post: 12-21-2009, 08:11 AM
  4. [Release] Windowed mode D3D9.dll
    By Ragehax in forum Combat Arms Hacks & Cheats
    Replies: 26
    Last Post: 09-17-2009, 11:58 PM
  5. [reposted] windowed mode d3d9.dll
    By Grim in forum Combat Arms Discussions
    Replies: 40
    Last Post: 09-03-2009, 03:39 AM