Go Back   GamerzPlanet - For All Your Online Gaming Needs!! > gPotato Games > FlyFF Discussion

FlyFF Discussion Discuss anything about FlyFF in this section. FlyFF Hacks


Packet Problem

FlyFF Discussion


Reply
 
Thread Tools Display Modes
Old 11-07-2009, 12:17 PM   #1
e3x0r
Lurker
 
Last Online: 11-16-2009 12:41 PM
Join Date: Nov 2009
Posts: 3
Rep Power: 0
Rep Points: 10
e3x0r is on a distinguished road
Feedback: (0)
Points: 561.87
Bank: 0.00
Total Points: 561.87
Packet Problem

Yes I know there have been posted some threads about this soon and they all helped me alot so far but im still to retarded to figure out the Length Hash which is written in every packet the client sends to the server.

I already know that you have to xor the CRC32 checksum of the size (which is written after the length hash) with the Session Key to get the Length Hash but the Length Hash i create is never the same as the one of the client.

Heres an Example:
Code:

Session ID Packet: 5E0800000000000000486EA319
Chat Packet: 5EFD5E7B9F0F00000034442A30FFFFFFFF0000FF00030000006D7568


Session ID: 19 A3 6E 48

Size: 00 00 00 0F
Length Hash: 9F 7B 5E FD

I never get this Length Hash. I really dont know what im doing wrong. Maybe someone could help me out and explain how everything works =)

btw: is the Session ID the same as the Session Key
?

Last edited by e3x0r; 11-07-2009 at 02:09 PM.
e3x0r is offline   Reply With Quote
Old 11-09-2009, 04:29 AM   #2
kumaT
Registered User
 
Last Online: 11-10-2009 09:28 AM
Join Date: Jun 2008
Posts: 56
Rep Power: 2
Rep Points: 10
kumaT is on a distinguished road
Feedback: (0)
Points: 31,469.06
Bank: 0.00
Total Points: 31,469.06
Re: Packet Problem

There are multiple things to check:
-Do you use the correct endianess? (Its little-endian for Flyff) Try to switch the endianess for your calculation.
-Does your CRC32 algo invert the result? Just Xor the result with 0xFFFFFFFF (== -1).
-Do you have the correct CRC32 algorithm? Unfortunatly there are differen't versions. If im not wrong it was CRC-32-IEEE_802.3 reversed (0xEDB88320)

For everybody else, if you don't know what this all is about read [Only registered and activated users can see links. ] post.
kumaT is offline   Reply With Quote
Old 11-09-2009, 02:07 PM   #3
e3x0r
Lurker
 
Last Online: 11-16-2009 12:41 PM
Join Date: Nov 2009
Posts: 3
Rep Power: 0
Rep Points: 10
e3x0r is on a distinguished road
Feedback: (0)
Points: 561.87
Bank: 0.00
Total Points: 561.87
Re: Packet Problem

Quote:
Originally Posted by kumaT View Post
There are multiple things to check:
-Do you use the correct endianess? (Its little-endian for Flyff) Try to switch the endianess for your calculation.
-Does your CRC32 algo invert the result? Just Xor the result with 0xFFFFFFFF (== -1).
-Do you have the correct CRC32 algorithm? Unfortunatly there are differen't versions. If im not wrong it was CRC-32-IEEE_802.3 reversed (0xEDB88320)

For everybody else, if you don't know what this all is about read [Only registered and activated users can see links. ] post.
I use the correct endianess and crc32 function .. but i still dont get the same hash .. even when i xor the crc32 hash with 0xFFFFFFFF.
Could you maybe explain what you do on the example above?
e3x0r is offline   Reply With Quote
Old 11-09-2009, 02:41 PM   #4
nForce
2.718281828459045
 
nForce's Avatar
 
Last Online: 11-17-2009 07:12 AM
Join Date: May 2006
Location: Canada
Posts: 594
Rep Power: 5
Rep Points: 147
nForce will become famous soon enoughnForce will become famous soon enough
Feedback: (0)
Points: 3,364.26
Bank: 354,385.05
Total Points: 357,749.31
Re: Packet Problem

Here is a demonstration of how to calculate the correct packet

Code:
from struct import pack, unpack
from binascii import crc32

def Main():
    key = unpack ( '<L', '\x48\x6e\xa3\x19' ) [ 0 ]
    data = '\xff\xff\xff\xff\x00\x00\xff\x00\x03\x00\x00\x00\x6d\x75\x68'
    result = pack ( '<BLLL',
           0x5e,                                            # Protocol byte
           ~crc32 ( pack ( '<L', len ( data ) ) ) ^ key,    # Checksum of length
           len ( data ),                                    # Length
           ~crc32 ( data ) ^ key                            # Checksum of data
    ) + data
    for x in result: print '%02x' % ord ( x ), 
    print

if ( __name__ == '__main__' ):
    Main ()
And the output is:
Code:
5e fd 5e 7b 9f 0f 00 00 00 34 44 2a 30 ff ff ff ff 00 00 ff 00 03 00 00 00 6d 75 68
__________________

nForce is offline   Reply With Quote
Old 11-10-2009, 06:17 AM   #5
e3x0r
Lurker
 
Last Online: 11-16-2009 12:41 PM
Join Date: Nov 2009
Posts: 3
Rep Power: 0
Rep Points: 10
e3x0r is on a distinguished road
Feedback: (0)
Points: 561.87
Bank: 0.00
Total Points: 561.87
Re: Packet Problem

Thank you nForce (and also kumaT) it works now :D :D
I never used Python so far but it seems to be a useful language.

Last edited by e3x0r; 11-10-2009 at 12:10 PM.
e3x0r is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

All times are GMT -7. The time now is 12:52 AM.

 

Copyright ©2009, GamerzPlanet.Net
Visits: