• Welcome to Valhalla Legends Archive.
 

Need some help

Started by Imperceptus, March 25, 2005, 10:44 PM

Previous topic - Next topic

Imperceptus


            Init startPacket = new Init();
            _out.write(startPacket.getLength() & 0xff);
            _out.write(startPacket.getLength() >> 8 &0xff);
            _out.write(startPacket.getContent());
            _out.flush();


_out is declared like this

private OutputStream _out;

Could someone give me a psuedo explanation of what is going on here line for line if possible?
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

iago


// Create an Init object called startPacket
            Init startPacket = new Init();
// write the right byte of the length (this looks like it would incorrectly add 4 bytes, though)
            _out.write(startPacket.getLength() & 0xff);
// write the second byte from the right (again, looks like it would add 4 bytes)
            _out.write(startPacket.getLength() >> 8 &0xff);
// write the content
            _out.write(startPacket.getContent());
// Sendt he data
            _out.flush();


This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Imperceptus

#2
It is supose to be the login packet 0x08 I believe for a login server ive been working on. The ssource im reading appears to use static init packet and static key for blowfish, but official servers send non static init packet:
1) first byte is always 0 (offset 0)
2) next 4 bytes are random (offset 1-4)
3) and the last 4 bytes are static (offset 5-8 )

Im just abit not able to understand half of java.
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

Lenny

Quote from: iago on March 25, 2005, 11:38 PM

// Create an Init object called startPacket
            Init startPacket = new Init();
// write the right byte of the length (this looks like it would incorrectly add 4 bytes, though)
            _out.write(startPacket.getLength() & 0xff);
// write the second byte from the right (again, looks like it would add 4 bytes)
            _out.write(startPacket.getLength() >> 8 &0xff);
// write the content
            _out.write(startPacket.getContent());
// Sendt he data
            _out.flush();




Well according to the API, write(int b) will write the first eight low-order bits, so the implementation would only add a byte...

Not the best way to do it though...
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.