回复 2# afan
在公司看到了,到家的工夫,afan已经写好了。
#NoTrayIcon
#RequireAdmin
#PRE_UseX64=n
$sCode = '7h%md2F14513pt325a2615nt25nF1628%63hD358%-7EutF..1377955%_41eb512-lp%ac355%5E_3kac18E4%%l%2lo5%6215lFef68299553Fim%28F54.ayb86394EEAoc%2F53_5mu%8fed28%-'
MsgBox(0, '', $sCode & @LF & '解码后:' & @LF & _Get_location($sCode))
Func _Get_location($str)
Local $a1 = Int(StringLeft($str, 0 + 1))
Local $a2 = StringMid($str, 1 + 1);
Local $a3 = Floor(StringLen($a2) / $a1);
Local $a4 = Mod(StringLen($a2), $a1)
Local $a5[$a1];
Local $a6 = 0;
Local $a7 = '';
For $a6 = 0 To $a4 - 1
$a5[$a6] = StringMid($a2, (($a3 + 1) * $a6) + 1, ($a3 + 1));
Next
For $a6 = $a4 To $a1 - 1
$a5[$a6] = StringMid($a2, ($a3 * ($a6 - $a4) + ($a3 + 1) * $a4) + 1, $a3);
Next
Local $a5_0_length = StringLen($a5[0])
Local $a5_length = UBound($a5)
For $i = 0 To $a5_0_length - 1
For $j = 0 To $a5_length - 1
If StringMid($a5[$j], $i + 1, 1) <> '' Then $a7 &= StringMid($a5[$j], $i + 1, 1)
Next
Next
$a7 = StringReplace(_URLEncodeToString($a7), '^', '0');
Return $a7;
EndFunc ;==>_Get_location
Func _URLEncodeToString($URL_str, $Encode = 1)
;afan 提示:转换经ANSI(GB2312)URL编码后的字符串为原始字符串
;$URL_str - URL编码字符串
;$Encode - URL编码格式 ;1 (默认) = ANSI ;2 = UTF16 小 ;3 = UTF16 大 ;4 = UTF8
;返回值:成功 - 返回编码字符串的原始字符串; 失败 - 返回原字符串并设置 @Error = 1
Local $Rstr, $aSR, $str_Tmp, $i
$Rstr = StringReplace($URL_str, '+', ' ')
$aSR = StringRegExp($Rstr, '(?:%\w{2})+', 3)
If @error Then Return SetError(1, 0, $Rstr)
For $i = 0 To UBound($aSR) - 1
$str_Tmp = BinaryToString('0x' & StringReplace($aSR[$i], '%', ''), $Encode)
$Rstr = StringReplace($Rstr, $aSR[$i], $str_Tmp, 1)
Next
Return $Rstr
EndFunc ;==>_URLEncodeToString
|