What is that wizardry ? - Client Auth

Forum for alternative clients, mods & discussions on the same.

What is that wizardry ? - Client Auth

Postby kmarad » Sat Feb 15, 2020 7:48 am

Code: Select all
byte[] buf = new byte[msg.size() + 2];
buf[0] = (byte)((msg.size() & 0xff00) >> 8);
buf[1] = (byte)(msg.size() & 0x00ff);
msg.fin(buf, 2);


That's from AuthClient.java, in sendmsg().

I'd like to code a headless bot using python, that would connect to a villager bot account, and relay village chat to discord.
Though I just can't authenticate with the game server.
I can establish the ssl connection through sockets though, I just need to understand how to send the credentials. Can an archmage share some wisdom please ?
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Postby iamahh » Sat Feb 15, 2020 12:55 pm

Idk the answer but I'm curious, is there any error messages?
iamahh
 
Posts: 1810
Joined: Sat Dec 12, 2015 8:23 pm

Re: What is that wizardry ? - Client Auth

Postby kmarad » Sat Feb 15, 2020 1:13 pm

iamahh wrote:Idk the answer but I'm curious, is there any error messages?


Nope I send random stuff like : "login A:haven.AuthClient$NativeCred@xxxxx S:haven.LoginScreen@xxxxxx"
Then connection is reset by peer.
I don't really understand the protocol layer, I think I should send java bytes, but then I don't really know how.
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Postby iamahh » Sat Feb 15, 2020 1:54 pm

have you tried something like this code from the main method?
Code: Select all
AuthClient test = new AuthClient("127.0.0.1", 1871);
try {
    String acct = new NativeCred(args[0], args[1]).tryauth(test);
    if (acct == null) {
        System.err.println("failed");
        return;
    }
    System.out.println(acct);
    System.out.println(Utils.byte2hex(test.getcookie()));
} finally {
    test.close();
}
also try the Modding Discord, I remember seeing some protocol diagrams there, someone may help
iamahh
 
Posts: 1810
Joined: Sat Dec 12, 2015 8:23 pm

Re: What is that wizardry ? - Client Auth

Postby kmarad » Sat Feb 15, 2020 3:02 pm

iamahh wrote:also try the Modding Discord, I remember seeing some protocol diagrams there, someone may help


Yep I'm there, thank you ;)
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Postby kmarad » Sat Feb 15, 2020 3:59 pm

Wow, archmage found. Thank you for your help guys.
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm


Return to The Wizards' Tower

Who is online

Users browsing this forum: Moo_Moo and 6 guests