• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Insolence

#1
Mega bump, I still haven't figured this out (just gave up on it) -- I was wondering if I could get a few more hints about this part:
(BITS[4]) BaseFlag
    if 0 then stop.
    If 1st bit then monster has extra batterys/stats up its ass?
    some combo with the 2nd, 3rd and 4th bit (somtimes 1st), can efect lengh(below)

(BITS[X]) unknown
    relates to animation effects and verys in lengh, depending on the NPC code
    normaly around 20 bits long?


Still working on it, will post what I figure out :)
#2
I still haven't figured out what else seeds the data, I don't think it's just the GameHash.

Any help is appreciated.
#3
Using just the GameHash as the seed for the random data doesn't seem to work--the RC4 key produced by that doesn't show up in D2's memory.
#4
Quote from: Ringo on April 03, 2008, 05:08 PMStuff like the warden SHA1 of the MPQ files (from patch_d2.mpq mostly)
I'm confused--what does that have to do with anything?  Could you be a bit more detailed?
#5
Battle.net Bot Development / Re: S->C 0x50
January 08, 2008, 11:03 PM
Quote from: Ringo on January 08, 2008, 09:27 PM
Quote from: Insolence on January 08, 2008, 12:12 AM
Ringo gave me some advice and said it had something to do with D2Loader, but I found my old CD and loaded up Game.exe and I get the same message unless I copy + paste the 0x50 packet the real server sends.
Hm its probly D2 in general then, rather than just loader (I rarely use d2 from cd, so asumed it was loader based)
Just use a static S>C 0x50 and add the FTP protocol so that D2 can download the version mpq file if needed.
Alright Ringo, thanks :)
#6
Battle.net Bot Development / Re: S->C 0x50
January 08, 2008, 01:56 AM
Quote from: Camel on January 08, 2008, 12:38 AM
Considering this is the first packet you're sending, you've probably got a problem with your packet buffer. Have you tried packet logging your server to verify that it's sending what you expect?
No, that's not the problem--maybe I was unclear.

When I manually paste the packet from one I get with D2Smells, I can keep restarting and reconnecting to that server as long as I don't close the Diablo II process.  When I start a new process, the previous 0x50 packet that I copied doesn't work.  It stops at "Checking Version".
#7
Battle.net Bot Development / S->C 0x50
January 08, 2008, 12:12 AM
When trying to create a fake Diablo II server, I have to connect to USWest and sniff the 0x50 packet that it sends, then send that to the client every time I start a new client.  Otherwise it gets stuck at "Checking Version."

Ringo gave me some advice and said it had something to do with D2Loader, but I found my old CD and loaded up Game.exe and I get the same message unless I copy + paste the 0x50 packet the real server sends.

How do I "generate" a valid 0x50 response for a D2 client?
#8
Quote from: Ringo on January 01, 2008, 01:54 PM
Quote from: Insolence on January 01, 2008, 06:47 AM
Have a client connect, and send that client a Warden Request and get a Warden Response back? -- where should I even get started with this?

Can I just make a new realm to connect to on the client list for localhost and just ignore all the login/character/client shit and just send them into a game?

You will need to go through a realm, as the warden encryption key, is the game hash (which the realm supplys)
So inorder for the client to handle a said warden request, the client must have the same gamehash as the said warden request

hope that helps
Hrm, well does that mean I have to have 1 client open for each game hash?

AntiRush gave me a good suggestion, just load up 1 client and change the hash in memory before sending each warden request.  that should do it :)
#9
Have a client connect, and send that client a Warden Request and get a Warden Response back? -- where should I even get started with this?

Can I just make a new realm to connect to on the client list for localhost and just ignore all the login/character/client shit and just send them into a game?
#10
Some tweaking and it magically works, thanks for the replies shadow :)
#11
Quote from: l2k-Shadow on December 27, 2007, 09:26 PM
what are you talking about? you don't need to parse that packet... don't even put it inside your debuffer lol.
I do need to parse it, because it's coming out like this (Right now):
(in base 10)
5, 122, 9, 46, 239, 2, 92

Not sure what's missing in that, or if that's multiple packets--but after 0xAF that's what I get.
#12
Quote from: l2k-Shadow on December 27, 2007, 08:20 PM
if you don't decompress the packets before entering game, the first bytes of the relevant packets should be 0xAF, 0x02, and 0x07 in that order.
Well, I don't want to skip any packets--this is what I get:
RC: 0x04 JoinGameRequest; RequestID: 2; Name: GMWACHWYBWBQ; Password: GMW
RC: 20   04 02 00 47 4d 57 41 43 48 57 59 42 57 42 51 00 47 4d 57 00
RS: 0x04 JoinGameResponse; RequestID: 2; GameToken: 984; GameServerIP: 63.240.202.37; GameHash: 608503059; Result: Success; Unknown: 0
RS: 19   04 02 00 d8 03 00 00 3f f0 ca 25 13 05 45 24 00 00 00 00
GS: 0xAF RequestLogonInfo; ProtocolVersion: 1
GS: 2    af 01
GC: 0x68 GameLogonRequest; Version: 11; Class: Sorceress; Name: TehMferzz; D2GShash: 608503059; D2GSToken: 984; Unknown12: 50 cc 5d ed b6 19 a5 91 00
GC: 37   68 13 05 45 24 d8 03 01 0b 00 00 00 50 cc 5d ed b6 19 a5 91 00 54 65 68 4d 66 65 72 7a 7a 00 6f 4b 00 00 00 00
GS: 0x01 GameLogonReceipt; Difficulty: Normal; Hardcore: False; Expansion: True; Ladder: True; Unknown2: 4
GS: 8    01 00 04 00 30 00 01 01
GS: 0x00 GameLoading;
GS: 1    00
GS: 0x02 GameLogonSuccess;
GS: 1    02


I get AF 01 just fine, but 0x01 just isn't going through--how would I even go about skipping it?  When I receive AF 01, just skip the next 8 bytes--if it's even 8?
#13
http://pastebin.com/m55fd37e4

With a little help from Shadow, I think I'm off to a good start, but the 0x01 packet seems to be throwing me off.

I receive {0xAF, 0x01} just fine, but when I get 0x01... it seems to be compressed?--I thought packets weren't compressed until I was actually in game?  So I commented out the 0x00, 0x01, and 0x02 special cases I had before entering the game, and it still doesn't produce the 0x01 packet.

Am I doing anything blatantly wrong in my decompressing?  If it looks like my logic is right, I'll pastebin the decompression class I'm using.

Thanks for reading :)
#14
I put the listen stuff in a new thread and that seemed to do it.

Sorry to waste your time :)
#15
http://pastebin.com/m64952e9

For some reason, SendBN/Listen are getting all jumbled up -- I think I need to use only 1 SocketAsyncEventArgs throughout my program, but how do I do that?  The examples on MSDN are little bit over my head.

I keep getting a "OperationAborted" exception thrown in the Listen method.  Also, my friend tells me I can't expect to always get full packets--how should I handle this?  I know what the length of each packet should be, but I'm not sure how I should "queue" the bytes up (thread) safely.

I think I'm being a bit too vague, but I'm unsure exactly what to ask for--please ask questions about my code! :)

Thanks for any replies.

PS
Apparently I should only ever receive the first 2 bytes, and then from that decide how much I'll need to receive to get a complete packet--how should I go about that?