Author Topic: Bitstream compression  (Read 18856 times)

pwjones

  • Not-a-newbie
  • *
  • Posts: 40
  • Karma: 1
    • View Profile
Bitstream compression
« on: July 29, 2014, 02:36:03 PM »
I have a packet, from LEGO Universe, that part of it is compressed.  From the packet I know the size of the uncompressed data, size of the compressed data, and where the compressed data starts.  I do not know if they used Bitstreams to compress the data or if they compressed the data then wrote it to a bitstream.  I wrote a simple program to extract the information and try to uncompress the data through the ReadCompressed function of the BitStream.  However, when I do that I get "Unhandled exception at 0x00be92c6 in BitStream Test.exe: 0xC0000005: Access violation reading location 0x00000014."

Do people think that means that they did not use the BitStream WriteCompressed/ReadCompressed function? 

The compressed data actually goes from the known start point to the end of the packet so I assume that if I create an
Code: [Select]
unsigned char* CompressedData;and use
Code: [Select]
BitStream.Read(CompressedData);that will read the remainder of the packet and then I could just use a decompress routine on it.

But it would be nice if I could do it with BitStream.ReadCompressed.

Thanks,

Patrick

pwjones

  • Not-a-newbie
  • *
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Bitstream compression
« Reply #1 on: July 29, 2014, 04:14:48 PM »
Also, this uses RakNet version 3.25. 

However, the more I think about it, the more I think they had to compress the data before writing it to a bitstream.  Otherwise, how would they know the size of the compressed data to write to the packet before they wrote the compressed data.  I guess they could have written it compressed to another bitstream then written the size of that bitstream and then the actual bitstream to the final bitstream.

Patrick