I'm playing flyforfun since years and, as a programmer, I find myself pitiful to keep playing this game instead of making one but anyway XD
I would like to create a chatterbot for FlyFF. No, don't worries, I hate penya's flooder too >.< Well, I want to create an application to log shouts and maybe interact with people later, I'll see.
So here it comes. On my way to create the coolest bot ever (xD).. I'm stuck!! >__<
I just CANNOT figure out how the checksums works!
Packets are like that:
5E (Hash One ^ Session Key) (Size [Little Endian]) (Hash Two ^ Session Key) (Data)
And here's the hash i get from the server:
5E 08 00 00 00 00 00 00 00 25 54 A9 83
I know the result is supposed to looks something like that (from sniffing):
5E 92 14 56 E9 64 00 00 00 45 91 C4 78 FC 00 00 00 ...
How do I calculate them? I mean.. yes I know there's a XOR thing around it and a bit or CRC32 but I'm very lost :(
Could someone help me to achieve my goal?
According to my knowledge in programming, it isn't the program itself but the protocol that annoys me. Seriously, I just need to know what to do step-by-step with the hash (I understand better with examples) and I'll be fine.
I'm googling/programming/debugging since hours, please someone X___X
For chatpackets you dont have to en/decrypt anything.
The funpart with flyff is that the packets are not encrypted at all!
You simply have to look out for the 0xd0 (shout) and 0x01 (chat) commands.
This is the structure for a shoutcommand. [(int)shouter_character's id][(pstr)shouter_char_name][(pstr)text]
Yes because that's what I thought: use PostMessage for login and sending chats and you can snif packets for 'receiving' chats. And since the chat message itself isn't encrypted (only the header if i understand correctly) you won't have trouble with that.
EDIT: I just found the chat-packet function ingame.
It's really easy once you have the address. You can just do:
Oh well, I'm sorry if it was a bit blurry, my ultimate goal is to create a A.I bot, since I worked in the past in few huge A.I. projects, i thought it can be interesting to make a FlyFF bot. It wont be redistributed, no sources or any help because I hate script kiddies and I spent over 50$ in the game so I don't want to see an assh0le ruining the whole flyff server' economy ^^'
So again, more vividly this time, I would like to begin with a chatterbot but it will migrate to a real bot later on. I want to connect directly to the FlyFF server. I want a real handy client, not a piece of ... mixed sniffer and hook/injection >< At least, the project can progress to a OpenSource FlyFF Client for linux O.O Oh what a good idea! =]
I still need to build my own packets and the CRC32/XOR are real pain.
Oh, so you want the chatbot to be completely seperate from the Neuz.exe client. I didn't understand that correctly.
Well I don't know how the XOR/CRC32 works in flyff's packet but I do know the exact function in the exe that generates it.
I still can't send PM's but once I can I'll send you some info on it.
I like the idea of your project, so if you want could I help you with it? I've been developing a private bot (similar to automation) and your project sounds like a really interesting programming challenge.
EDIT: I tried to find out how the checksums are generated. I don't know if this is any usefull to you, but the first checksum dword is the session hash (not completely sure but i think it's the session hash) xor'ed with something it calculates from the packet contents (still finding out how it's calculated) and then inverted (all bits inverted).
2nd EDIT: If some sort of value is not available it uses the lenght of the packet at the place of the first checksum dword. Might that be the case at the first packet flyff sends?
3rd edit: for the first checksum dword it only seems to be using the packet lengt for the calculation. For the 2nd checksum dword it actually uses the packet contents.
Oh well, I'm sorry if it was a bit blurry, my ultimate goal is to create a A.I bot, since I worked in the past in few huge A.I. projects, i thought it can be interesting to make a FlyFF bot. It wont be redistributed, no sources or any help because I hate script kiddies and I spent over 50$ in the game so I don't want to see an assh0le ruining the whole flyff server' economy ^^'
So again, more vividly this time, I would like to begin with a chatterbot but it will migrate to a real bot later on. I want to connect directly to the FlyFF server. I want a real handy client, not a piece of ... mixed sniffer and hook/injection >< At least, the project can progress to a OpenSource FlyFF Client for linux O.O Oh what a good idea! =]
I still need to build my own packets and the CRC32/XOR are real pain.
Ah alright.
Ive been working on a similiar program before.
Pm me your contact details and Ill introduce you to the guy that actually continued that project.