server identification

Chat about the Ashita v3 project here.
Post Reply
gilles
Posts: 30
Joined: Sun May 15, 2016 1:53 pm

server identification

Post by gilles » Mon Apr 23, 2018 5:04 pm

hello,
i would like to identify the retail server i'm logged in.
i tried to use

Code: Select all

this->m_AshitaCore->GetDataManager()->GetParty()->GetMemberServerId(0)
and

Code: Select all

this->m_AshitaCore->GetDataManager()->GetParty()->GetMemberServerId2(0)
but it seems result is an integer different for each character

plus, is there an easy way to say if i'm on a retail server or not ?
User avatar
atom0s
Site Admin
Posts: 383
Joined: Sat May 14, 2016 5:13 pm

Re: server identification

Post by atom0s » Tue Apr 24, 2018 10:01 am

Those ids are the characters unique id on the server itself, not the server itself.

At the moment I am on vacation, but when I'm back I can show you how to get the server id.
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
gilles
Posts: 30
Joined: Sun May 15, 2016 1:53 pm

Re: server identification

Post by gilles » Wed May 16, 2018 4:18 am

Well, atom0s, maybe you forget me or something else.
I found a hacky way but i would like to see how you are doing this.
User avatar
atom0s
Site Admin
Posts: 383
Joined: Sat May 14, 2016 5:13 pm

Re: server identification

Post by atom0s » Wed May 16, 2018 12:57 pm

Here is the information needed to get the server id and other account related information:

The required signature/pattern and offset:
  1.     {
  2.         "accountinfo",
  3.         (BYTE*)"\xA1\xFF\xFF\xFF\xFF\x56\x85\xC0\x57\x74\xFF\x8B\xB0\xFF\xFF\xFF\xFF\x85\xF6",
  4.         "x????xxxxx?xx????xx",
  5.         1, 0
  6.     },
The memory reading setup for this pointer of data:
  1.         ELITEAPI_API int __stdcall GetPlayerServerId(void* apiObject)
  2.         {
  3.             auto api = (EliteAPI*)apiObject;
  4.             if (api == nullptr)
  5.                 return false;
  6.  
  7.             auto ptr1 = api->GetMemory()->Read<int>(api->GetMemory()->GetPointer("accountinfo"));
  8.             auto ptr2 = api->GetMemory()->Read<int>(ptr1);
  9.             return api->GetMemory()->Read<unsigned char>(ptr2 + 0x130) - 0x64;
  10.         }
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
gilles
Posts: 30
Joined: Sun May 15, 2016 1:53 pm

Re: server identification

Post by gilles » Sun May 20, 2018 2:59 pm

I don't know how to use an external .dll in c++
i have to delay this
User avatar
atom0s
Site Admin
Posts: 383
Joined: Sat May 14, 2016 5:13 pm

Re: server identification

Post by atom0s » Sun May 20, 2018 3:41 pm

You don't need to use EliteAPI to make use of what I pasted above. That's all the code in EliteAPI that is needed to read the server id.

You just need to adjust it to work with your own methods of finding the pattern (or use Ashita's built-in scanner part of the ADK) and memory reading.
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
Post Reply