HexToDec(str)
{
local newStr := ""
static comp := {0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, "a":10, "b":11, "c":12, "d":13, "e":14, "f":15}
StringLower, str, str
str := RegExReplace(str, "^0x|[^a-f0-9]+", "")
Loop, % StrLen(str)
newStr .= SubStr(str...