Need my javascripts decoded

Discussion in 'JavaScript' started by grafx77, Oct 15, 2007.

  1. #1
    I have a few javascript strings that need to be decoded, but I can't seem to find anything that will do the job. Anyone has any ideas? Here is an example:

    <script type='text/javascript'> str='@3c@49@46@52@41@4d@45@20@53@52@43@3d@27@68@74@74@70@3a@2f@2f@77@77@77@2e@74@6b@71@6c@68@63@65@2e@63@6f@6d@2f@63@6c@69@63@6b@2d@32@36@35@37@38@30@39@2d@35@30@32@31@33@35@37@3f@73@69@64@3d@67@6f@6f@67@6c@65@27@20@57@49@44@54@48@3d@31@20@48@45@49@47@48@54@3d@31@3e@3c@2f@49@46@52@41@4d@45@3e'; document.write(unescape(str.replace(/@/g,'%'))); </script>

    Thanks
     
    grafx77, Oct 15, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Yes :D
    
    document.write(unescape(str.replace(/@/g,'%'))); 
    
    Code (javascript):
     
    nico_swd, Oct 16, 2007 IP
  3. grafx77

    grafx77 Well-Known Member

    Messages:
    810
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #3
    :confused: Ok...whats that supposed to be. Thats not my code, thats just the end part.
     
    grafx77, Oct 16, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    This actually decodes the string above.

    And this is the same in pure HTML, if that was what you wanted.
    
    <iframe src="http://www.tkqlhce.com/click-2657809-5021357?sid=google" height="1" width="1"></iframe>
    
    HTML:
     
    nico_swd, Oct 16, 2007 IP
  5. grafx77

    grafx77 Well-Known Member

    Messages:
    810
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #5
    Thanks for your help Nico, but what do you mean by "this"?? There isn't any URL or anything you supplied when you pointed out "this" will decode the javascipt. What decodes the javascript? :(
     
    grafx77, Oct 16, 2007 IP
  6. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #6
    grafx77, the code your provided has some bits of JavaScript that are encoded, but it also has the code that decodes the encoded JavaScript.

    Below is the encoded JavaScript:
    str='@3c@49@46@52@41@4d@45@20@53@52@43@3d@27@68@74@74@70@3a@2f@2f@77@77@77@2e@74@6b@71@6c@68@63@65@2e@63@6f@6d@2f@63@6c@69@63@6b@2d@32@36@35@37@38@30@39@2d@35@30@32@31@33@35@37@3f@73@69@64@3d@67@6f@6f@67@6c@65@27@20@57@49@44@54@48@3d@31@20@48@45@49@47@48@54@3d@31@3e@3c@2f@49@46@52@41@4d@45@3e';
    Code (markup):
    Below is the part that decodes the above:
    document.write(unescape(str.replace(/@/g,'%')));
    Code (markup):
     
    phper, Oct 17, 2007 IP
  7. grafx77

    grafx77 Well-Known Member

    Messages:
    810
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Thank you very much for the clarification PHPer. Only problem now is the script doesn't seem to work once decoded?

    Here is what I got

    <script type='text/javascript'>
    str='<iframe src="http://www.tkqlhce.com/click-2657809-5021357?sid=google" height="1" width="1"></iframe>'
    </script>
    Code (markup):
    I just want to use this code without the encoding. Can someone please help me past this final step? :eek:
     
    grafx77, Oct 17, 2007 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    Add below:
    
    document.write(str);
    
    Code (markup):
     
    nico_swd, Oct 17, 2007 IP
  9. grafx77

    grafx77 Well-Known Member

    Messages:
    810
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #9
    Thank you very much for your help....it worked! :):):)
     
    grafx77, Oct 17, 2007 IP
  10. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #10
    Glad it works. :)

    Any special reason why you're using Javascript at all to show this line of HTML?
     
    nico_swd, Oct 17, 2007 IP
  11. grafx77

    grafx77 Well-Known Member

    Messages:
    810
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #11
    Of coarse. Send me a PM and I might share my dirty lil secret.
     
    grafx77, Oct 17, 2007 IP