mindstorm38 / wg-toolkit-rs

Toolkit crate providing various implementations for codecs distributed by Wargaming.net (BigWorld & Core engine, World of Tanks). Network protocol is W.I.P.
https://crates.io/crates/wg-toolkit
MIT License
14 stars 4 forks source link

How to solve cuckoo cycle? #8

Open yungd1plomat opened 3 weeks ago

yungd1plomat commented 3 weeks ago

Hi, thanks for the great work you've done, but I have a question. What is the easiness param in CuckooContext?How can i use prefix and max_nonce from CyckooCycle?

mindstorm38 commented 2 weeks ago

This code as been adapted from source, I have no knowledge in login challenges and I struggled to understand it when I implemented it. To be honest I don't know, if you find anything relevant on the web I would be interesting because I never found anything relevant when I re-implemented it.

I think the original source is the open source BigWorld we have here : https://github.com/v2v3v4/BigWorld-Engine-14.4.1 More exactly : https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/connection/cuckoo_cycle_login_challenge_factory.cpp

yungd1plomat commented 2 weeks ago

This code as been adapted from source, I have no knowledge in login challenges and I struggled to understand it when I implemented it. To be honest I don't know, if you find anything relevant on the web I would be interesting because I never found anything relevant when I re-implemented it.

I think the original source is the open source BigWorld we have here : https://github.com/v2v3v4/BigWorld-Engine-14.4.1 More exactly : https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/lib/connection/cuckoo_cycle_login_challenge_factory.cpp

Yeah, I've seen that realization. After reversing the application, it seems that even the constants are correct, however I don't know how this response is encrypted as the implementation outputs 168 bytes (42 uint32 elements), however the client response to the server contains a minimum of 440 bytes (not including header) which corresponds to 110 elements of uint32

mindstorm38 commented 2 weeks ago

So you're interested in understanding how the login challenge is exchanged between the client and the server? Because there is some inherent overhead due to the network protocol, and the packet does not contain only the raw response. https://github.com/mindstorm38/wg-toolkit-rs/blob/master/wg-toolkit/src/net/element/login.rs#L63-L71

Don't know if that's what you're searching

yungd1plomat commented 2 weeks ago

So you're interested in understanding how the login challenge is exchanged between the client and the server? Because there is some inherent overhead due to the network protocol, and the packet does not contain only the raw response. https://github.com/mindstorm38/wg-toolkit-rs/blob/master/wg-toolkit/src/net/element/login.rs#L63-L71

Don't know if that's what you're searching

I figured it out, after sending LoginRequest the server asks for cuckoo_cycle, however how the cuckoo_cycle response is encoded I don't know

yungd1plomat commented 2 weeks ago

After cuckoo cycle response it's contains extra 272 bytes of data, i don't know what is it

mindstorm38 commented 1 week ago

I think this is something I don't understand either... to be honest. At least I don't remember because I didn't touch this project for a year, I think I'll go back to it soon by the way.

yungd1plomat commented 1 week ago

I think this is something I don't understand either... to be honest. At least I don't remember because I didn't touch this project for a year, I think I'll go back to it soon by the way.

Yeah, I think so, too. This implementation of https://github.com/v2v3v4/BigWorld-Engine-14.4.1/tree/main doesn't contain any additional data, at least I couldn't find any, so apparently I'll have to reverse wot itself