Skip to content

Instantly share code, notes, and snippets.

@matthewarkin
Last active February 8, 2019 23:08
Show Gist options
  • Save matthewarkin/ff8aa8b183568e2c050269aea832a7ea to your computer and use it in GitHub Desktop.
Save matthewarkin/ff8aa8b183568e2c050269aea832a7ea to your computer and use it in GitHub Desktop.
<body>
<a href="javascript:function base64toHEX(base64){var raw=atob(base64);var HEX='';for(i=0;i<raw.length;i++){var _hex=raw.charCodeAt(i).toString(16)var current=raw.charCodeAt(i)HEX+=raw.charCodeAt(i)<32||raw.charCodeAt(i)>126?"\\x"+(_hex.length==2?_hex:'0'+_hex).toUpperCase():raw[i]}var tagsToReplace={'<':'&lt;','>':'&gt;'};function replaceTag(tag){return tagsToReplace[tag]||tag}return HEX.replace(/[<>]/g,replaceTag)}regex=/decode64\(\"(.*?)\"\)/g output=[]while(matches=regex.exec(document.body.innerHTML)){document.getElementById('search-query-messages-table').innerHTML=document.getElementById('search-query-messages-table').innerHTML.replace(matches[0],base64toHEX(matches[1]))}">Decode PRLE"</a>
</body>
@matthewarkin
Copy link
Author

matthewarkin commented Feb 8, 2019

![Decode PRLE](javascript:function base64toHEX(base64){var raw=atob(base64);var HEX='';for(i=0;i<raw.length;i++){var _hex=raw.charCodeAt(i).toString(16)var current=raw.charCodeAt(i)HEX+=raw.charCodeAt(i)<32||raw.charCodeAt(i)>126?"\x"+(_hex.length==2?_hex:'0'+_hex).toUpperCase():raw[i]}var tagsToReplace={'<':'<','>':'>'};function replaceTag(tag){return tagsToReplace[tag]||tag}return HEX.replace(/[<>]/g,replaceTag)}regex=/decode64\("(.*?)"\)/g output=[]while(matches=regex.exec(document.body.innerHTML)){document.getElementById('search-query-messages-table').innerHTML=document.getElementById('search-query-messages-table').innerHTML.replace(matches[0],base64toHEX(matches[1]))})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment