[Fix] [v.164] Integrity Check Algorithm

Results 1 to 14 of 14
  1. #1
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    [Fix] [v.164] Integrity Check Algorithm

    Two years ago @Darter posted this thread about a certain integrity check in the client which causes the client to crash within a minute if the server doesn't respond to it. He created a list with all the possible responses and @SuperLol made this algorithm which worked fine... until v.164.

    I tried many different offsets but unfortunately nothing worked. I created another list using @Darter's help and using data from the official servers and @SuperLol made this new algorithm, so all credits belong to him.

    You may refer to it as "clientAuth".

    Code:
    public static int GetIntegrityResponse(int request)
            {
                int response;
    
                int a = (request >> 5) << 5;
                response = ((8 - ((request - a) >> 2)) << 2) + (request & 0x3) - 4 + a;
    
                return response;
            }
    Enjoy your development!
    Last edited by Fraysa; 29-07-15 at 07:49 AM.


  2. #2
    Account Upgraded | Title Enabled! SuperLol is offline
    MemberRank
    Jun 2010 Join Date
    801Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Oh this was made assuming 1 returns 28, 2 returns 29, and so on. If it starts at 0, then I'll be off by 1.

  3. #3
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by SuperLol View Post
    Oh this was made assuming 1 returns 28, 2 returns 29, and so on. If it starts at 0, then I'll be off by 1.
    Yep, it starts at 0. I modified it, no worries.

  4. #4
    Member HawtMaple is offline
    MemberRank
    Sep 2013 Join Date
    88Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Based on the original, took less than a minute to fix, math.
    Code:
        int pRequest = slea.readInt();
        int pResponse = (pRequest >> 5 << 5) + ((((pRequest & 0x1F) >> 3 ^ 0x3) << 3) + (8 - (pRequest & 0x7)));
        pResponse |= pRequest >> 7 << 7;

  5. #5
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    This is actually BlackCipher Heartbeat Check

  6. #6
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Multo View Post
    This is actually BlackCipher Heartbeat Check
    Yep it is.

  7. #7
    Account Upgraded | Title Enabled! Darter is offline
    MemberRank
    Feb 2008 Join Date
    253Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    very nice quality release 10/10 glad i could help build a new table of values for you and help contribute to the dev scene of maple. good luck on dev everyone

    btw if you block your maplestory client from sending this to the official servers nothing will happen...its strictly for client to feel safe

  8. #8
    <3 Dynamik is offline
    MemberRank
    Feb 2011 Join Date
    TorontoLocation
    532Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Fraysa View Post
    Two years ago @Darter posted this thread about a certain integrity check in the client which causes the client to crash within a minute if the server doesn't respond to it. He created a list with all the possible responses and @SuperLol made this algorithm which worked fine... until v.164.

    I tried many different offsets but unfortunately nothing worked. I created another list using @Darter's help and using data from the official servers and @SuperLol made this new algorithm, so all credits belong to him.

    You may refer to it as "clientAuth".

    Code:
    public static int GetIntegrityResponse(int request)
            {
                int response;
    
                int a = (request >> 5) << 5;
                response = ((8 - ((request - a) >> 2)) << 2) + (request & 0x3) - 4 + a;
    
                return response;
            }
    Enjoy your development!
    Pardon my ignorance, but as far as I know, this line does absolutely nothing since you are shifting right five, and then shifting left five.

    Code:
                int a = (request >> 5) << 5;
    Why keep it? D:

  9. #9
    Account Upgraded | Title Enabled! Darter is offline
    MemberRank
    Feb 2008 Join Date
    253Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Dynamik View Post
    Pardon my ignorance, but as far as I know, this line does absolutely nothing since you are shifting right five, and then shifting left five.

    Code:
                int a = (request >> 5) << 5;
    Why keep it? D:
    it cuts off bits

  10. #10
    Proficient Member ALotOfPosts is offline
    MemberRank
    Sep 2014 Join Date
    181Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Dynamik View Post
    Pardon my ignorance, but as far as I know, this line does absolutely nothing since you are shifting right five, and then shifting left five.

    Code:
                int a = (request >> 5) << 5;
    Why keep it? D:
    >> 5 is the same as saying /32
    << 5 is the same as saying *32

    So 100/32*32 is 96, instead of 100 due to truncation.
    Let's have a binary representation of a number like 100
    64+32+4=1100100
    We shift it 5 bytes to the right
    11 is left.
    We shift it 5 bytes to the left
    1100000 is the current number
    1100000 = 64+32 = 96.

    Basically what was said above, but a more mathematical answer.

  11. #11
    Yuki Zygon is offline
    MemberRank
    Aug 2008 Join Date
    IllinoisLocation
    1,208Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by ALotOfPosts View Post
    >> 5 is the same as saying /32
    << 5 is the same as saying *32

    So 100/32*32 is 96, instead of 100 due to truncation.
    Let's have a binary representation of a number like 100
    64+32+4=1100100
    We shift it 5 bytes to the right
    11 is left.
    We shift it 5 bytes to the left
    1100000 is the current number
    1100000 = 64+32 = 96.

    Basically what was said above, but a more mathematical answer.
    I prefer this
    Code:
    int a = request & 0xffffffe0;

  12. #12
    Account Upgraded | Title Enabled! oxysoft is offline
    MemberRank
    Nov 2008 Join Date
    Canada, QCLocation
    1,400Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Zygon View Post
    I prefer this
    Code:
    int a = request & 0xffffffe0;
    fucking disgusting bit level hacking

    u have all my respects

  13. #13
    Apprentice Another One is offline
    MemberRank
    Dec 2014 Join Date
    8Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    You don't need any fancy bitwise operations..
    Code:
    return request ^ SendPacketOpcode.BC_AUTH.getValue();
    This works for every version, you will never have to change this.
    (Where BC_AUTH is the send header for the same packet, 0x1C in v164)

    It's also more likely to be what the official servers actually use, instead of them "randomly changing the algorithm", it likely automatically changes whenever the header does, which is exactly what has happened so far.
    Last edited by Another One; 04-08-15 at 07:16 PM.

  14. #14
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: [Fix] [v.164] Integrity Check Algorithm

    Quote Originally Posted by Another One View Post
    You don't need any fancy bitwise operations..
    Code:
    return request ^ SendPacketOpcode.BC_AUTH.getValue();
    This works for every version, you will never have to change this.
    (Where BC_AUTH is the send header for the same packet, 0x1C in v164)

    It's also more likely to be what the official servers actually use, instead of them "randomly changing the algorithm", it likely automatically changes whenever the header does, which is exactly what has happened so far.
    oh shit. this is fcuking genius



Advertisement