Page 3 of 3 FirstFirst 123
Results 31 to 38 of 38
  1. #31
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    ah DAMMM!

    cant get it to work!!!


    my code :

    Code:
    int main() {
    	DWORD pId;
    	while(1) {
        
    
    	HWND hWnd = FindWindowA(0, "mhtest");
    
    	if(!hWnd) {
    		cout << "Cannot find the window..." << endl;
    		system("cls");
    	} else {
    	
    	GetWindowThreadProcessId(hWnd, &pId);
    
    	if(pId != 0) {
    	DWORD mAddress;
    
    	MODULEENTRY32 mEntry32;
    
    	HANDLE hSnapMods = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pId);
    	if(Module32First(hSnapMods, &mEntry32) == TRUE)
    	{
    		do
    		{
    			if(strcmp((char *)mEntry32.szModule, "ME Test.exe") == 0)
    			{
    				mAddress = (DWORD)mEntry32.modBaseAddr;
    				cout << mAddress << endl;
    				system("cls");
    				break;
    			} else {
    
    				cout << "Can not find the fucking address.." << endl;
    				system("cls");
    			}
    		}
    		while(Module32Next(hSnapMods, &mEntry32) == TRUE);
    	}
    
    
    	}
    	}
    }
    
    	return 0;
    }

  2. #32
    proman98's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Achel
    Posts
    1,024
    Reputation
    47
    Thanks
    81
    My Mood
    Fine
    change your first script into that except putting it at page 3

  3. #33
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    A TCHAR is a char... at least with his build it is.

  4. #34
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Why are you looping every single process search, module search. etc?
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  5. #35
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Quote Originally Posted by Brinuz View Post
    Why are you looping every single process search, module search. etc?
    Vou dizer em portugues porque em ingles nao consigo explicar muito bem =/

    Eu usei o while porque antes eu estava a manter o valor do address continuamente..Agora coloquei isso para verificar continuamente se a janela continua aberta ou nao etc...

    Mas de qualquer forma, nao consigo mesmo pegar o address base, porque o adress que eu quero mudar é 0x19138 , mas precisa ser o adress do programa + 19138 por exemplo: ME Test.exe + 19138, Mas ja tentei e nao consegui pegar adress do ME Test, se eu conseguir isso, vou conseguir editar os adressos sem ter sempre q ir no cheat engine buscar pelo adress correto...

    Se pudesses escrever um simples codigo para isso agradecia, só mesmo para o aderesso do programa porque dps sei junta-los...
    Obrigado..

  6. #36
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    When all else fails code your own libraries.

  7. #37
    open|Fire's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    62
    Reputation
    18
    Thanks
    36
    Quote Originally Posted by -Away View Post
    ah DAMMM!

    cant get it to work!!!


    my code :

    Code:
    int main() {
    	DWORD pId;
        
    	HWND hWnd = FindWindowA(0, "mhtest");
    
    	if(!hWnd) {
    		cout << "Cannot find the window..." << endl;
    		system("cls");
    	} else {
    	
    	GetWindowThreadProcessId(hWnd, &pId);
    
    	if(pId != 0) {
    	DWORD mAddress;
    
    	MODULEENTRY32 mEntry32;
    
    	HANDLE hSnapMods = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pId);
    	if(Module32First(hSnapMods, &mEntry32) == TRUE)
    	{
    		do
    		{
    			if(stricmp(mEntry32.szModule, "ME Test.exe") == 0)
    			{
    				mAddress = (DWORD)mEntry32.modBaseAddr;
    				cout << mAddress << endl;
    				system("cls");
                                   system("pause");
    				break;
    			} else {
    
    				cout << "Can not find the fucking address.." << endl;
    				system("cls");
    			}
    		}
    		while(Module32Next(hSnapMods, &mEntry32) == TRUE);
    	}
    
    
    	}
    	}
    	return 0;
    }
    tente isto e se você estiver usando VC++ coloque em projeto->propriedades do projeto->general->Character Set-> Use Multi-Byte Character Set

    com isso você não precisa usar casts

  8. #38
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    [highlight=cpp]HMODULE hMainModule;
    DWORD cb;

    #ifdef _M_IX86
    EnumProcessModules(pA, hMainModule, 1, &cb);
    #else
    EnumProcessModulesEx(pA, hMainModule, 1, &cb, LIST_MODULES_ALL);
    #endif[/highlight]

    The handle is the base address. This works because the first result is always the main module.

    Edit:
    Actually, this is better for 32 bit on WOW64/64 bit interoperability.
    [highlight=cpp]int main()
    {
    HWND hWnd = FindWindow(0, _T("mhtest"));

    if (hWnd == NULL)
    {
    std::cout << "Cannot find window..." << std::endl;
    }
    else
    {
    DWORD pID, dwAddress;

    GetWindowThreadProcessId(hWnd, &pID);

    if (pID)
    {
    MODULEENTRY32 m32;
    HANDLE hSnapshot;

    hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);

    if (Module32First(hSnapshot, &m32)
    {
    dwAddress = reinterpret_cast<DWORD>(m32.modBaseAddr); // or m32.hModule, same thing.
    std::cout << std::hex << dwAddress;
    }

    CloseHandle(hSnapshot);
    }
    }

    return 0;
    }[/highlight]
    On a side note, use of system() is discouraged.
    Last edited by Fovea; 05-19-2011 at 09:01 PM.

  9. The Following 5 Users Say Thank You to Fovea For This Useful Post:

    Hell_Demon (05-20-2011),Lyoto Machida (05-20-2011),[MPGH]master131 (05-20-2011),Melodia (05-19-2011),Void (05-20-2011)

Page 3 of 3 FirstFirst 123