What is that wizardry ? - Client Auth

Forum for alternative clients, mods & discussions on the same.
kmarad
Posts: 150
Joined: Mon Jan 06, 2020 7:46 pm

What is that wizardry ? - Client Auth

Post by kmarad »

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 ?
iamahh
Posts: 1806
Joined: Sat Dec 12, 2015 8:23 pm

Re: What is that wizardry ? - Client Auth

Post by iamahh »

Idk the answer but I'm curious, is there any error messages?
kmarad
Posts: 150
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Post by kmarad »

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.
iamahh
Posts: 1806
Joined: Sat Dec 12, 2015 8:23 pm

Re: What is that wizardry ? - Client Auth

Post by iamahh »

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
kmarad
Posts: 150
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Post by kmarad »

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: 150
Joined: Mon Jan 06, 2020 7:46 pm

Re: What is that wizardry ? - Client Auth

Post by kmarad »

Wow, archmage found. Thank you for your help guys.

Return to “The Wizards' Tower”