Skip to content

Instantly share code, notes, and snippets.

@Wolfium
Forked from jpatters/HeidiDecode.js
Last active April 9, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wolfium/75a2e6614ef11f92eb1627a1bdea5881 to your computer and use it in GitHub Desktop.
Save Wolfium/75a2e6614ef11f92eb1627a1bdea5881 to your computer and use it in GitHub Desktop.
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
console.log(heidiDecode('71786675786E782D484075393'));
var isBrowser=new Function("try {return this===window;}catch(e){ return false;}");
if (isBrowser()) {
document.write(heidiDecode('71786675786E782D484075393'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment