Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

need help: mapleshark incorrect packets

Newbie Spellweaver
Joined
Oct 16, 2012
Messages
17
Reaction score
2
login no problem->image1
1 - need help:  mapleshark incorrect packets - RaGEZONE Forums


selection characters ->image2
start game
2 - need help:  mapleshark incorrect packets - RaGEZONE Forums
this is cms 146
what am I to do
 

Attachments

You must be registered for see attachments list
Last edited:
(O_o(o_O(O_O)o_O)O_o)
Loyal Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
From a PM i got a while back:

I seem to receive this question a lot lol. Anyway, I never finished decrypting the opcode encryption on the outbound packets. However the inbound encryption is very simple:

As soon as you enter the game with a character, you will receive a packet that's 32k~ish in length. As soon as you've received this packet (which contains the outbound opcode encryption information) the inbound traffic's encryption changes. This 32k packet itself, and any inbound traffic after receiving it is encrypted as follows

(C# function for mapleshark, you can put this in MapleAES.cs)
PHP:
public void SimpleSubtractDecode(byte[] pData) 
        { 
         
            uint dwKey = mIV == null ? 0 : (uint)(mIV[0] | mIV[1] << 8 | mIV[2] << 16 | mIV[3] << 24); 
            uint nRes = dwKey; 
             
            for (uint i = 0; i < pData.Length; ++i) 
            { 
                pData[i] = (byte)(pData[i] - dwKey); 
                nRes = i + 1; 
            } 
        }
(Ignore the ugly name poop)

Instead of decrypting using AES, you use this function instead. After this function, just like with the AES decrypts, you generate a new IV.
 
Upvote 0
Newbie Spellweaver
Joined
Oct 16, 2012
Messages
17
Reaction score
2
From a PM i got a while back:

I seem to receive this question a lot lol. Anyway, I never finished decrypting the opcode encryption on the outbound packets. However the inbound encryption is very simple:

As soon as you enter the game with a character, you will receive a packet that's 32k~ish in length. As soon as you've received this packet (which contains the outbound opcode encryption information) the inbound traffic's encryption changes. This 32k packet itself, and any inbound traffic after receiving it is encrypted as follows

(C# function for mapleshark, you can put this in MapleAES.cs)
PHP:
public void SimpleSubtractDecode(byte[] pData) 
        { 
         
            uint dwKey = mIV == null ? 0 : (uint)(mIV[0] | mIV[1] << 8 | mIV[2] << 16 | mIV[3] << 24); 
            uint nRes = dwKey; 
             
            for (uint i = 0; i < pData.Length; ++i) 
            { 
                pData[i] = (byte)(pData[i] - dwKey); 
                nRes = i + 1; 
            } 
        }
(Ignore the ugly name poop)

Instead of decrypting using AES, you use this function instead. After this function, just like with the AES decrypts, you generate a new IV.

Thank you Reply
How do I use it?
mAES.SimpleSubtractDecode(pBuffer);?
return nRes?
 
Upvote 0
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Thank you Reply
How do I use it?
mAES.SimpleSubtractDecode(pBuffer);?
return nRes?

Make a boolean that indicates if the 32k packet was received. Once you receive it, set it to true. If it's set, use the method Novak posted instead of MapleAES's TransformAES.

The method should be called from MapleStream. Place it here:

Code:
[TABLE]
[TR]
[/TR]
[TR]
[TD]            if ((pTransformLocale & TransformMethod.AES) != 0) mAES.TransformAES(pBuffer);[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[/TABLE]
 
Upvote 0
Back
Top