Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
C++ Read creature name from ID - Page 2
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: C++ Read creature name from ID

  1. #11
    yea, it's good i tested it in this script and its finding this window

  2. #12
    omg 4:00 am... anyway i made:
    Code:
    int readByte(int address, int byte)
    {
        int value;
        if(ReadProcessMemory(processHandle, (LPVOID)address, &value, byte, NULL))
            return value;
        return 0;
    }
    and

    Code:
        HANDLE processHandle;
        DWORD procId;
        HWND hwnd;
    
        hwnd = FindWindow("ARKAMECZEK ", NULL);
        GetWindowThreadProcessId(hwnd, &procId);
        processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procId);
        if(hwnd)
        {
           //start
            int playerCID = SELFID;
    		int myCreatureIndex = 0;
    			for (int i = 1; i < MaxCreatures; i++)
    			{
    			int currentCID = readByte(BattlelistBegin + BattlelistStep * i, 4);
    			if (currentCID == readByte(playerCID,4))
    					{
    						myCreatureIndex = i;
    						break;
    					}
    			}
    
            CloseHandle(processHandle);
        }
    and it working, but now i think how to make this what you said:
    // Do whatever here, e.g:
    string playerName = ReadString(battleListStart + battleListStep * i + 0x4);
    maybe cuz im zombie now anyway, if you have any idea to do this msg. Thanks

    //for test i made:
    Code:
    test = readByte(BattlelistBegin + BattlelistStep * myCreatureIndex, 4);
    and its ok, i have right ID's of creatures, but how can i get name from that addresses?
    Last edited by Arkamek; 09-17-2014 at 02:22 AM.

  3. #13
    Senior Member
    Join Date
    Jan 2008
    Location
    Cambridge, England
    Posts
    725
    Quote Originally Posted by Arkamek View Post
    omg 4:00 am... anyway i made:
    Code:
    int readByte(int address, int byte)
    {
        int value;
        if(ReadProcessMemory(processHandle, (LPVOID)address, &value, byte, NULL))
            return value;
        return 0;
    }
    and

    Code:
        HANDLE processHandle;
        DWORD procId;
        HWND hwnd;
    
        hwnd = FindWindow("ARKAMECZEK ", NULL);
        GetWindowThreadProcessId(hwnd, &procId);
        processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procId);
        if(hwnd)
        {
           //start
            int playerCID = SELFID;
    		int myCreatureIndex = 0;
    			for (int i = 1; i < MaxCreatures; i++)
    			{
    			int currentCID = readByte(BattlelistBegin + BattlelistStep * i, 4);
    			if (currentCID == readByte(playerCID,4))
    					{
    						myCreatureIndex = i;
    						break;
    					}
    			}
    
            CloseHandle(processHandle);
        }
    and it working, but now i think how to make this what you said:

    maybe cuz im zombie now anyway, if you have any idea to do this msg. Thanks

    //for test i made:
    Code:
    test = readByte(BattlelistBegin + BattlelistStep * myCreatureIndex, 4);
    and its ok, i have right ID's of creatures, but how can i get name from that addresses?
    Ahhh, I just read your last post and noticed you were passing the window handle not the process handle, sense made.

    Regarding ReadString, you'll basically want to return a pointer to a char array, containing the address of the bytes you read.

    Are you doing this from an injected DLL? Or are you doing it from a standalone console application or something? If it's injected, you really don't need to do all this ReadProcessMemory crap.

  4. #14
    yea Injected DLL, then how can i do it without readprocessmemory?

  5. #15
    read
    Code:
    DWORD currentCID = *(DWORD *)(BattlelistBegin + BattlelistStep * i);
    write
    Code:
    int new_id = 99999;
    memcpy((LPVOID)(BattlelistBegin + BattlelistStep * i, new_id, 4);

  6. #16
    Thanks bro
    Code:
    void test()
    {
        int playerCID = SELFID;
        int myCreatureIndex = 0;
            for (int i = 1; i < MaxCreatures; i++)
    {
        DWORD currentCID = *(DWORD *)(BattlelistBegin + BattlelistStep * i);
        if (currentCID == *(DWORD *)(playerCID))
        {
            //My character ID
            myCreatureIndex = i;
            break;
        }
    }
           domin = *(DWORD *)(BattlelistBegin + BattlelistStep * myCreatureIndex);
    }

  7. #17
    i trying make:
    Code:
           char domin[32];
           domin[32] = *(char*)((char*)((BattlelistBegin + BattlelistStep * myCreatureIndex) + 0x04));
    but don't work
    result is 0/empty

  8. #18
    Quote Originally Posted by Arkamek View Post
    i trying make:
    but don't work
    result is 0/empty
    Code:
    char* name = (char*)((BattlelistBegin + BattlelistStep * myCreatureIndex) + 0x04));

  9. #19
    Thanks Man!

    Working code:

    Code:
    string tekst;
    Code:
    void dominik()
    {
        int playerCID = SELFID;
        int myCreatureIndex = 0;
            for (int i = 0; i < MaxCreatures; i++)
    {
        DWORD currentCID = *(DWORD *)(BattlelistBegin + BattlelistStep * i);
        if (currentCID == *(DWORD *)(playerCID))
        {
            //My character ID
            myCreatureIndex = i;
            break;
        }
    }
           char* name = (char*)((BattlelistBegin + BattlelistStep * myCreatureIndex) + 0x04);
           tekst = name;
    }
    and result = "Arkam"

    Thanks again
    I have the last question now, how can i read level of character, because i can't find address from it.
    Last edited by Arkamek; 09-17-2014 at 01:50 PM.

  10. #20
    the correct code
    Code:
    string SelfName()
    {
    	int playerCID = SELFID;
    	for (int i = 0; i < MaxCreatures; i++)
    	{
    		DWORD currentCID = *(DWORD *)(BattlelistBegin + BattlelistStep * i);
    		if (currentCID == *(DWORD *)(playerCID))
    		{
    			return (char*)((BattlelistBegin + BattlelistStep * i) + 0x04);
    		}
    	}
    	return NULL;
    }
    about read level of character
    Code:
    http://youtu.be/NcZXDcrCZFA?t=24m13s
    Last edited by wgrzelak; 09-17-2014 at 02:26 PM.

Posting Permissions

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