看到还有人没梯子,xxx无法访问,那就通过伪造sni来实现访问git...hub,goo...le等等,关于规则会定时收集更新,同样适用于edge,需要注意重点:使用前关闭已打开浏览器,不要后台有进程存在#include 'JSON_Dictionary.au3'
Local $jsonData = BinaryToString(InetRead('https://gitee.com/subtlelonging/host/raw/master/Host.json'))
Local $inputValue = _JSON_Parse($jsonData)
Local $processedData = _Processing($inputValue)
Local $chromePath = 'C:\Program Files\Google\Chrome\Application\chrome.exe'
If FileExists($chromePath) Then
Run('"' & $chromePath & '" ' & $processedData)
Else
MsgBox(0x10, '错误', '未找到 Google Chrome,请检查安装路径。')
EndIf
Func _Processing($inputValue)
Local $cealHostRulesFragments = '', $cealHostResolverRulesFragments = '', $nullSniNum = 0
For $i = 0 To UBound($inputValue) - 1
Local $includeDomains = _JSON_Get($inputValue, '$[' & $i & '][0]')
Local $sni = _JSON_Get($inputValue, '$[' & $i & '][1]')
Local $ip = _JSON_Get($inputValue, '$[' & $i & '][2]')
If IsArray($includeDomains) Then
For $j = 0 To UBound($includeDomains) - 1
Local $domain = StringStripWS($includeDomains[$j], 3)
If StringLeft($domain, 1) <> '^' And StringLeft($domain, 1) <> '#' Then
If $sni = '' Then
$sni = 'CYFM' & $nullSniNum
$nullSniNum += 1
EndIf
$cealHostRulesFragments &= 'MAP ' & $domain & ' ' & $sni & ','
EndIf
Next
EndIf
If $ip <> '' Then
$cealHostResolverRulesFragments &= 'MAP ' & $sni & ' ' & $ip & ','
EndIf
Next
Return ' --host-rules="' & StringTrimRight($cealHostRulesFragments, 1) & '" --host-resolver-rules="' & StringTrimRight($cealHostResolverRulesFragments, 1) & '" --test-type --ignore-certificate-errors'
EndFunc
|