Results 1 to 5 of 5
  1. #1
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed

    Problems with C++

    Hi guys, I have a few problems, I'll list them here:

    When I try to compile a DLL in CodeBlocks the DDL is being made and all but when I try to run the DDL via PerX Injector, the code doesn't run.
    If you know to solve this tell me how.

    OK so I switched to LCC compiler and there it works, but I don't like the editor and the error log there. And it seems that I can't write a class there, either the syntax there is different or what?

    And a question with a code:
    Code:
    #include <windows.h>
    
    void is_activated()
    {
    	if (activated) MessageBox(NULL, "activated", "ERROR", MB_OK);
    }
    
    void mainP()
    {
    	HANDLE process = GetCurrentProcess();
    	
    	if (!process)
    	{
    		MessageBox(NULL, "Couldn't get process handle.", "ERROR", MB_OK | MB_ICONERROR);
    		return;// Halt the incoming lines.
    	}
    	
    	BOOL activated = TRUE;
    	
    	if (CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)is_activated, NULL, 0, NULL) == NULL)
    	{
    		MessageBox(NULL, "Couldn't create a thread to execute within the virtual address space of the calling process.", "ERROR", MB_OK | MB_ICONERROR);
    		return;// Halt the incoming lines.
    	}
    	
    	CloseHandle(process);
    }
    
    BOOL WINAPI __declspec(dllexport) LibMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
    {
    	if (fdwReason == DLL_PROCESS_ATTACH)
    	{
    		if (CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)mainP, NULL, 0, NULL) == NULL)
    		{
    			MessageBox(NULL, "Couldn't create a thread to execute within the virtual address space of the calling process.", "ERROR", MB_OK | MB_ICONERROR);
    			return FALSE;
    		}
    	}
    	
    	return TRUE;
    }
    I want the variable "activated " to be accessible in both the "main" function and the "is_activated" function. How I do that?
    Last edited by Jabberwock; 07-27-2012 at 09:55 AM. Reason: Typo errors

  2. #2
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Declare "activated" as a global scope.

  3. #3
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    Thanks it worked.

    Can you suggest me an alternative for CodeBlocks software? Or a solution on how to make the DDL work there?

  4. #4
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Use Microsoft Visual C++ Express.

  5. #5
    GhostMode1's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Behind You
    Posts
    284
    Reputation
    23
    Thanks
    610
    My Mood
    Yeehaw
    you can click declair activate


    [U]Don't You Forgot To THANK ME[/U]

    [IMG]https://i72.photobucke*****m/albums/i188/GhostMode11/TrustedMemberBadge_zpscb15d978.png[/IMG]


Similar Threads

  1. problem with account gamefifa
    By gamefifa in forum WarRock - International Hacks
    Replies: 2
    Last Post: 05-09-2007, 08:36 AM
  2. Problem with Warrock
    By BurakG in forum WarRock - International Hacks
    Replies: 10
    Last Post: 04-30-2007, 04:13 PM
  3. Problem with trainers mades for CE, help me pls
    By juanitobalde in forum General Game Hacking
    Replies: 0
    Last Post: 04-24-2007, 04:31 AM
  4. Problem With The New Pb Hw Ban Spoofer!
    By naomelembro14 in forum WarRock - International Hacks
    Replies: 5
    Last Post: 03-16-2007, 07:29 AM
  5. Problem(with login)
    By 22061988 in forum WarRock - International Hacks
    Replies: 3
    Last Post: 11-01-2006, 12:07 AM