How to use GetNameByVID function in C++

01/03/2021 23:32 xChoi#1
Hi everyone,

I'm testing in Metin2 private server. I want to GetNameByVID function in C++.

My program giving this output : Όκ]

This is my assembly code:

char* GetNameByVID(int vId)
{
char* my_name;

__asm
{
mov ecx, PlayerPtr
push vId
add ecx,0x4
mov eax,[ecx]
call dword ptr [eax+0x8]
call GetNameByVIDCall
mov my_name, eax
}
return my_name;
}

Can anyone help me please :)
01/04/2021 13:25 ones-and-zer0es.mpeg#2
Quote:
Originally Posted by xChoi View Post
Hi everyone,

I'm testing in Metin2 private server. I want to GetNameByVID function in C++.

My program giving this output : Όκ]

This is my assembly code:

char* GetNameByVID(int vId)
{
char* my_name;

__asm
{
mov ecx, PlayerPtr
push vId
add ecx,0x4
mov eax,[ecx]
call dword ptr [eax+0x8]
call GetNameByVIDCall
mov my_name, eax
}
return my_name;
}

Can anyone help me please :)
1. get the CPythonCharacterManager instance
2. call the CInstanceBase* CPythonCharacterManager::GetInstancePtr (DWORD VirtualID) function with the CPythonCharacterManager instance
3. call const char* CInstanceBase::GetNameString() with the returned CInstanceBase instance


Code:
void* GetInstancePtr(void* CPythonCharacterManager, DWORD vid, DWORD addr) {
    __asm {
        mov ecx, [CPythonCharacterManager];
        push [vid];
        call[addr]
    }
}

char* GetNameString(void* CInstanceBase, DWORD addr) {
    __asm {
        mov ecx, [CInstanceBase];
        call[addr];
    }
}


DWORD vid = GetTargetVID(); //replace with how you're getting the vid
void* CPythonCharacterManagerInstance = GetInstance(0xdeadbeef);//replace with your function and the actual address
void* CInstanceBaseInstance = GetInstancePtr(CPythonCharacterManagerInstance, vid, 0xdeadbeef); //replace with the actual address
std::cout << GetNameString(CInstanceBaseInstance, 0xdeadbeef) << std::endl; //replace with the actual address
01/04/2021 20:04 xChoi#3
Quote:
Originally Posted by ones-and-zer0es.mpeg View Post
1. get the CPythonCharacterManager instance
2. call the CInstanceBase* CPythonCharacterManager::GetInstancePtr (DWORD VirtualID) function with the CPythonCharacterManager instance
3. call const char* CInstanceBase::GetNameString() with the returned CInstanceBase instance


Code:
void* GetInstancePtr(void* CPythonCharacterManager, DWORD vid, DWORD addr) {
    __asm {
        mov ecx, [CPythonCharacterManager];
        push [vid];
        call[addr]
    }
}

char* GetNameString(void* CInstanceBase, DWORD addr) {
    __asm {
        mov ecx, [CInstanceBase];
        call[addr];
    }
}


DWORD vid = GetTargetVID(); //replace with how you're getting the vid
void* CPythonCharacterManagerInstance = GetInstance(0xdeadbeef);//replace with your function and the actual address
void* CInstanceBaseInstance = GetInstancePtr(CPythonCharacterManagerInstance, vid, 0xdeadbeef); //replace with the actual address
std::cout << GetNameString(CInstanceBaseInstance, 0xdeadbeef) << std::endl; //replace with the actual address
thanks for your answer but I have some questions. Etc. I couldn't find the GetNameString function.
01/04/2021 23:42 cypher#4
#moved
01/06/2021 03:42 xChoi#5
help++
01/07/2021 12:03 sad666#6
How you handle getting entity ? What is your method
01/07/2021 17:53 xChoi#7
Quote:
Originally Posted by sad666 View Post
How you handle getting entity ? What is your method
I don't understand you
01/10/2021 03:20 xChoi#8
up++
01/12/2021 17:27 xChoi#9
can anyone help me?
02/16/2021 23:13 xChoi#10
++
02/18/2021 19:33 xChoi#11
Quote:
Originally Posted by Cyphernomic View Post
#moved
Please move to Metin2 Hacks, Bots, Cheats, Exploits & Macros category. Because nobody here sees the issue.
02/19/2021 15:14 martinx1#12
First of all, you have to make sure you are calling the right function, you are probably using the one which gets 2 python objects as arguments, if that's the case, you either need to recreate those python objects and then passing them as arguments or as mentioned above use the GetNameString, if you disassemble the python function you should get the GetNameString inside
04/28/2021 20:12 macnn50#13
@[Only registered and activated users can see links. Click Here To Register...], @[Only registered and activated users can see links. Click Here To Register...]
Cen u Help me ?
[Only registered and activated users can see links. Click Here To Register...]