RELEASE63-201405071257-197450526 handshake

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    RELEASE63-201405071257-197450526 handshake

    Hello RZ!

    After trying for hours and hours, you guys are my last hope!

    I'm updating Butterfly r105 to RELEASE63-201405071257-197450526 (PlusEmu R 2.1's version). The handshake goes well untill AFTER the secret key is generated. I can't explain it any differently than the emulator just stops doing anything and after a minute or so, the user will get disconnected.

    I have checked literally everything: the generated key IS valid, the message gets send, the packets (incoming and outgoing) are all correct. I just don't know what I have done wrong.

    The code I use is partly copied from PlusEmu. I know
    var globalCrypto = new HabboCrypto();
    is probably not the best way, any tips on that would also be greatly appreciated.

    PHP Code:
    string CipherPublickey Request.ReadString();
    var 
    globalCrypto = new HabboCrypto();
    if (!
    globalCrypto.InitializeRC4ToSession(CipherPublickey))
    {
        
    Session.SendNotif("There was an error logging you in, please try again!");
        return;
    }
    ServerMessage message PacketHandelingManager.GetRecycledItem(OutputCode.SecretKeyComposer);
    message.AddString(globalCrypto.PublicKey.ToString());
    Session.SendMessage(message); 
    Even telling me which packet would be handled after the secret key generating would help me out a bit, but I hope somebody knows what I did wrong or what I forgot.


  2. #2
    Member K Camp is offline
    MemberRank
    Jun 2014 Join Date
    Spring BreakLocation
    58Posts

    Re: RELEASE63-201405071257-197450526 handshake

    what is the main problem and did you connect it together, so it connects to have it right handled?

  3. #3
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by K Camp View Post
    what is the main problem and did you connect it together, so it connects to have it right handled?
    Everything should be connected yeah and the main problem is that the emulator doesn't go any further than generating the secret key and sending it, while all the handlers for the whole handshake are already coded and should be working.

  4. #4
    Unspoiled Perfection AKllX is offline
    MemberRank
    Aug 2007 Join Date
    @ akllxprojectLocation
    366Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Mostly like you didn't handle the crypto correctly. I installed the plus crypto into this B105 and it works through it's not fully updated. Might help you.
    https://mega.co.nz/#!MY9UlQhL!B5d5Rm...OdLLvXb8BJbFZY

    Use the same banner as Plus.

  5. #5
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by AKllX View Post
    Mostly like you didn't handle the crypto correctly. I installed the plus crypto into this B105 and it works through it's not fully updated. Might help you.
    https://mega.co.nz/#!MY9UlQhL!B5d5Rm...OdLLvXb8BJbFZY

    Use the same banner as Plus.
    That's amazing! I'm going to take a look at it tomorrow!

  6. #6
    :joy: Jonteh is offline
    MemberRank
    Apr 2007 Join Date
    New York, USALocation
    3,375Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Where you call

    PHP Code:
    var globalCrypto = new HabboCrypto(); 
    could you not do

    PHP Code:
    HabboCrypto crypto = new HabboCrypto(); 
    instead of doing it as a var? You said your way might not be the best, so maybe that will be better.

    This thread stuck out to me cause I'm also working on the new UI, except once I handle id 4000 it skips to GetUserInfo, I was wondering if this was because I don't have RC4 in my emulator? Sorry for not really going on your topic, but yeah.

  7. #7
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by Jonteh View Post
    Where you call

    PHP Code:
    var globalCrypto = new HabboCrypto(); 
    could you not do

    PHP Code:
    HabboCrypto crypto = new HabboCrypto(); 
    instead of doing it as a var? You said your way might not be the best, so maybe that will be better.

    This thread stuck out to me cause I'm also working on the new UI, except once I handle id 4000 it skips to GetUserInfo, I was wondering if this was because I don't have RC4 in my emulator? Sorry for not really going on your topic, but yeah.
    Thanks for the advice on calling the HabboCrypto. (: And your problem should be because you don't have RC4 in your emulator then, aren't there any unhandled packets?

    - - - Updated - - -

    Quote Originally Posted by AKllX View Post
    Mostly like you didn't handle the crypto correctly. I installed the plus crypto into this B105 and it works through it's not fully updated. Might help you.
    https://mega.co.nz/#!MY9UlQhL!B5d5Rm...OdLLvXb8BJbFZY

    Use the same banner as Plus.
    This emu definitely helped me out! Now the handshake gets stuck after the client vars get handled. The packet for setting the machineid just doesn't get send. There's not much I can do wrong with the client vars packet I think, since it's not getting handled in Plus at all... Would there still be something wrong with the secret key then?

  8. #8
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    I still got no luck in fixing it. After the clientvars packet(340), nothing gets received anymore. I've been busy with it all day, it's probably something small I'm doing wrong, but I can't get my finger on it.
    There's nothing wrong with my SWFs by the way, I tried Plus on the same SWFs and everything's going fine there.

  9. #9
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Could you show us your global crypto class or the InitializeRC4ToSession method?

    Also, do the prime and generator keys match the keys in the banner/encryption file called by the client?

    Quote Originally Posted by Jonteh View Post
    This thread stuck out to me cause I'm also working on the new UI, except once I handle id 4000 it skips to GetUserInfo, I was wondering if this was because I don't have RC4 in my emulator? Sorry for not really going on your topic, but yeah.
    Naw, RC4 shouldn't be the cause of that. What revision are you working from? But just for a heads up, it should be in a similar order to;

    GetClientVersionEvent (4000 always)
    InitCryptoEvent -> Send the InitCryptoComposer
    GenerateSecretKeyEvent -> Send the SecretKeyComposer
    ClientVariablesEvent
    UniqueIDEvent -> Send the SetUniqueIdComposer
    SSO Ticket Event -> Manage auth, but within here you must send the AuthenticationOKComposer to actually successfully authenticate the user.

    Just a thought, if it skips to GetUserInfo, then perhaps GetUserInfo is using the InitCryptoEvent packet.
    Last edited by Sledmore; 15-07-14 at 06:32 AM.

  10. #10
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    After sending the secretkey, does your emulator get another response from the client?

  11. #11
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by Sledmore View Post
    Could you show us your global crypto class or the InitializeRC4ToSession method?

    Also, do the prime and generator keys match the keys in the banner/encryption file called by the client?



    Naw, RC4 shouldn't be the cause of that. What revision are you working from? But just for a heads up, it should be in a similar order to;

    GetClientVersionEvent (4000 always)
    InitCryptoEvent -> Send the InitCryptoComposer
    GenerateSecretKeyEvent -> Send the SecretKeyComposer
    ClientVariablesEvent
    UniqueIDEvent -> Send the SetUniqueIdComposer
    SSO Ticket Event -> Manage auth, but within here you must send the AuthenticationOKComposer to actually successfully authenticate the user.

    Just a thought, if it skips to GetUserInfo, then perhaps GetUserInfo is using the InitCryptoEvent packet.
    This is the HabboEncryption class:
    PHP Code:
    using Butterfly.HabboHotel.GameClients;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;


    namespace 
    HabboEncryption
    {
        public class 
    HabboEncryption DiffieHellman
        
    {
            private static 
    BigInteger n = new BigInteger("86851DD364D5C5CECE3C883171CC6DDC5760779B992482BD1E20DD296888DF91B33B936A7B93F06D29E8870F703A216257DEC7C81DE0058FEA4CC5116F75E6EFC4E9113513E45357DC3FD43D4EFAB5963EF178B78BD61E81A14C603B24C8BCCE0A12230B320045498EDC29282FF0603BC7B7DAE8FC1B05B52B2F301A9DC783B7"16);
            private static 
    BigInteger e = new BigInteger(3);
            private static 
    BigInteger d = new BigInteger("59AE13E243392E89DED305764BDD9E92E4EAFA67BB6DAC7E1415E8C645B0950BCCD26246FD0D4AF37145AF5FA026C0EC3A94853013EAAE5FF1888360F4F9449EE023762EC195DFF3F30CA0B08B8C947E3859877B5D7DCED5C8715C58B53740B84E11FBC71349A27C31745FCEFEEEA57CFF291099205E230E0C7C27E8E1C0512B"16);


            private 
    RSA RSA;


            public 
    HabboEncryption()
                : 
    base(new BigInteger("114670925920269957593299136150366957983142588366300079186349531"10), new BigInteger("1589935137502239924254699078669119674538324391752663931735947"10))
            {
                
    this.RSA = new RSA(ned00000);
            }


            public 
    Boolean InitializeRC4ToSession(GameClient Sessionstring ctext)
            {
                try
                {
                    
    string publickey this.RSA.Decrypt(ctext);


                    
    base.GenerateSharedKey(publickey.Replace(((char)0).ToString(), ""));


                    
    RC4.Init(base.SharedKey.getBytes(), ref Session.RC4Client);
                    
    Session.CryptoInitialized true;


                    return 
    true;
                }
                catch
                {
                    return 
    false;
                }
            }
        }

    I've just checked the prime and generator keys and they match the ones in rs4.php

    - - - Updated - - -

    Quote Originally Posted by The General View Post
    After sending the secretkey, does your emulator get another response from the client?
    Yes, the clientvars get send and after that nothing happens anymore.

  12. #12
    Custom Title Enabled James is online now
    LegendRank
    Jan 2007 Join Date
    DenverLocation
    2,288Posts

    Re: RELEASE63-201405071257-197450526 handshake

    What about the n and e keys inside of your habbo.swf?

    Did you open your habbo.swf via AS3Sorcerer and check those

  13. #13
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by James View Post
    What about the n and e keys inside of your habbo.swf?

    Did you open your habbo.swf via AS3Sorcerer and check those
    I didn't do that. I assumed they would be OK, since I took them right from PlusEmu, which uses the same SWF revision. But to be sure, I'm going to check them!

  14. #14
    Apprentice Daniel1811 is offline
    MemberRank
    Jul 2012 Join Date
    Maracaibo, VeneLocation
    11Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Hello,

    I have the same problem

    I have to replace my:


    for this?

  15. #15
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: RELEASE63-201405071257-197450526 handshake

    Quote Originally Posted by James View Post
    What about the n and e keys inside of your habbo.swf?

    Did you open your habbo.swf via AS3Sorcerer and check those
    I've checked them now and they're correct..

    - - - Updated - - -

    Quote Originally Posted by Daniel1811 View Post
    Hello,

    I have the same problem

    I have to replace my:


    for this?
    You should definitely do that as far as I'm concerned.



Page 1 of 2 12 LastLast

Advertisement