1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Coding Problem

Discussion in 'C' started by bharatwalia, Jul 26, 2008.

  1. bharatwalia

    bharatwalia New Member

    Joined:
    Jul 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi to all
    how can i decode a text in c/c++

    exmaple:
    // Coded text is "127.0.0.1"
    char g_szServerName[] = {(char)121,(char)80,(char)114,(char)101,(char)54,(char)122,(char)67,(char)87,(char)122,(char)112,(char)80,(char)83,(char)85,(char)84,(char)47,(char)90,(char)87,(char)103,(char)102,(char)90,(char)111,(char)65,(char)61,(char)61,0};

    i will be verry thankfull if any body could tell me this
    thanks a lot.

    bharat
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    I've no idea what you mean. What input would such a program have? What output? How far have you got in writing such a program and where are you stuck? Is the program not behaving as you expect, if so how (what is it doing that you don't expect, or vice versa)?
     
  3. bharatwalia

    bharatwalia New Member

    Joined:
    Jul 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi thanks for ur reply..i mean as u can see written over ther coded text 127.0.0.1 it the ip address of localhost which is coded in (char) form


    i.e

    127.0.0.1 = {(char)121,(char)80,(char)114,(char)101,(char)54,( char)122,(char)67,(char)87,(char)122,(char)112,(ch ar)80,(char)83,(char)85,(char)84,(char)47,(char)90 ,(char)87,(char)103,(char)102,(char)90,(char)111,( char)65,(char)61,(char)61,0};


    which is further stored into a array char g_szServerName[]
    further in a layman language 127.0.0.1 is coded in above form and then stored in array
    char g_szServerName[]

    i hope know must have got a clear picture.
    thanks
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Nope, it's still rather opaque, I still haven't got a clue what you're talking about, probably because there's a whole load of context you haven't mentioned.

    121,80,114,101... in ASCII is yPre... and looks nothing like "127.0.0.1". What exactly does "127.0.0.1 = {(char)121..." mean? How is the left side "equal" to the right side?

    Can you give any more example data? For example what would "0.0.0.0" and "255.255.255.255" be "equal" to? Expressing the same question slightly differently, if the coded text were 0.0.0.0 instead of 127.0.0.1, or 255.255.255.255, what would g_szServerName contain?

    Why is the string called g_szServerName when it doesn't resemble anything any sane sysadmin would call a computer? (Yep, I'm aware of the irony of "sane sysadmin".)

    Is some kind of cryptography relevant to this discussion?
     
  5. sofprog66

    sofprog66 New Member

    Joined:
    Jul 8, 2008
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    This is what I got after some quick decoding of the char's. " yPre6zCWzpPSUT/ZWgfZoA=="
     
  6. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Yep, that looks like some kind of ciphertext to me. Hence my question about cryptography and my comment about missing context; if the OP is on a course and they've recently been discussing, say, MD5, then the original question MIGHT mean something like "how do I reverse MD5 to get the text that MD5'd to yPre...?" However that's just a guess and what we really need is for the OP to give us some more clues.
     
  7. sofprog66

    sofprog66 New Member

    Joined:
    Jul 8, 2008
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    Hopefully he is being taught this in a course and not using this to get access to a server which isin't his.
     

Share This Page