Skip to content

Instantly share code, notes, and snippets.

@jabarihunt
Forked from jpatters/HeidiDecode.js
Last active September 19, 2019 02:46
Show Gist options
  • Save jabarihunt/d8f3184e5dbc584225f94d4ad37adb32 to your computer and use it in GitHub Desktop.
Save jabarihunt/d8f3184e5dbc584225f94d4ad37adb32 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.
<!doctype html>
<html>
<head>
<!-- http://www.chasewoodford.com/blog/how-to-recover-a-stored-password-from-heidisql/ -->
<script>
function heidiDecode(hex) {
hex = hex.substr(0, hex.length - 1);
var str = '';
var shift = parseInt(hex.substr(-1));
for (var i = 0; i < hex.length; i += 2) {str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);}
return str;
}
document.write(heidiDecode('YOURSECRETHEX'));
</script>
</head>
<body>
</body>
</html>
@jabarihunt
Copy link
Author

When I have time I'll create a quick form so that the password can be passed in and parsed. It will be part of a larger set of dev tools I use regularly.

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