Packet Sniffing Howto eliminate SharpZip menu

User Tag List

Results 1 to 5 of 5
  1. #1
    joe7314's Avatar Member
    Reputation
    3
    Join Date
    Dec 2008
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Packet Sniffing Howto eliminate SharpZip

    Hi,
    I noticed a lot of people are using sharpzip for decompressing compressed packets. Here is some simple code that will eliminate the requirement for having to include sharpzip.

    Code:
    //assuming data is the entire opcode stream withoug the four byte header
    //data[0] should equal F6
    //data[1] should equal 01 (502)
    uint uncompressedLength = data[2]*256+data[3]
    //data[4]data[5]data[6]data[7] I dunno but would like to know :)
    byte[] input = System.Buffer.BlockCopy((data[8],0, data.length-8)
    System.IO.Compression.DeflateStream istream = new System.IO.Compression.DeflateStream(new MemoryStream(input), Compression.CompressionMode.Decompress);
    byte[] output = new byte[uncompressedLength];
    size = istream.Read(output, offset, uncompressedLength);
    I know this isn't a huge contribution, but hopefully it doesn't make anyone mad if I broke any rules or anything please just let me know politely.

    If anyone has or could share the code for classes InstancedObject and InstancedWorldObject I would appreciate it greatly. Of course I'd welcome any technical information on the packet structures too.

    Best Wishes,
    -Joe

    Packet Sniffing Howto eliminate SharpZip
  2. #2
    XTZGZoReX's Avatar Active Member
    Reputation
    32
    Join Date
    Apr 2008
    Posts
    173
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think people are avoiding System.IO.Compression.DeflateStream because of some bug, which naturally, I can't remember what was... Anyhow, you're right - some people don't even know that class exists.

  3. #3
    Ugge's Avatar Member
    Reputation
    6
    Join Date
    Aug 2008
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by XTZGZoReX View Post
    I think people are avoiding System.IO.Compression.DeflateStream because of some bug, which naturally, I can't remember what was... Anyhow, you're right - some people don't even know that class exists.
    Its not a bug. The wow packets that hold compressed data use a zlib stream (RFC 1950) and DeflateStream only implements RFC 1951. Its not supposed to work. However, if you remove the first 2 bytes (the header) of the zlib stream you will in our case get a regular deflate stream (RFC 1951).

    In the case of an update packet youd read:
    4 bytes: inflated size
    2 bytes: zlib header (throw away)
    the rest is the deflated stream.
    Last edited by Ugge; 01-16-2010 at 12:46 PM.

  4. #4
    joe7314's Avatar Member
    Reputation
    3
    Join Date
    Dec 2008
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That explains the extra bytes I was mystified about Thanks!

  5. #5
    XTZGZoReX's Avatar Active Member
    Reputation
    32
    Join Date
    Apr 2008
    Posts
    173
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its not a bug. The wow packets that hold compressed data use a zlib stream (RFC 1950) and DeflateStream only implements RFC 1951. Its not supposed to work. However, if you remove the first 2 bytes (the header) of the zlib stream you will in our case get a regular deflate stream (RFC 1951).
    Yeah, that was exactly the thing. I never bothered reading up on it, so didn't know about the RFC compliance - thanks for the clarification.

Similar Threads

  1. D3 packet sniffing
    By R3peat in forum Diablo 3 Memory Editing
    Replies: 4
    Last Post: 12-09-2015, 02:34 AM
  2. Detecting legendary drops via packet sniffing
    By uinuja in forum Diablo 3 Bots Questions & Requests
    Replies: 2
    Last Post: 09-29-2012, 11:20 AM
  3. swtor packet sniffing NEED
    By the1domo in forum SWTOR Emulator Servers
    Replies: 1
    Last Post: 04-20-2012, 01:31 AM
  4. HowTo: Automated Login (With Pictures!)
    By m_fatica in forum World of Warcraft Guides
    Replies: 13
    Last Post: 02-13-2007, 06:45 PM
  5. WoW packets.. where are they?
    By Stretch in forum World of Warcraft General
    Replies: 0
    Last Post: 01-28-2007, 01:54 PM
All times are GMT -5. The time now is 10:20 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search