|
Post by Roger Cabo on Jun 1, 2022 16:08:43 GMT 1
Hi everyone, unfortunately the function URLDownloadToFileA Lib "urlmon.dll" does not work on a fresh Windows 10 installation without changing a key in the registry. The advantage of URLDownloadToFileA is the ability to download the default SLL cache if the url does not contain a proper filename and extension like ".html"
But in some cases you don't want to download a specified file like above.
The registry: // Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\DisableCachingOfSSLPages = 0
Windows 10 has disabled downloading the cache content by default to prevent downloading any content like *.php or *.asp has produced output by the webserver.
With DisableCachingOfSSLPages = 1 it works fine again. Now its possible to get the content from the cache file again automatically.
If you now use URLDownloadToFileA with a url "https://unity3d.com/get-unity/download/archive" you get content is indirect created by the url or script behind, as well.
Example: Attachments:geturl.g32 (1.65 KB)
|
|
|
Post by (X) on Dec 1, 2023 14:03:53 GMT 1
This adds another layer of sophistication to managing communications with the internet.
I tried geturl.g32 and found no difference with trying to get a response from: "https//sonnenuntergang-zeit.de/"
But, I did find a similar site that did respond: "https://www.sunrise-and-sunset.com/de"
Why one is "tight lipped" and the other is not is beyond me at this time. I can only guess they have their "shields up" or something.
Anyway, thanks for the suggestion. Another tool for my "bag of tricks"!
|
|
|
Post by dragonjim on Dec 1, 2023 14:52:11 GMT 1
A good find.
Just a note of caution: Microsoft disables this form of downloading for security reasons. So keep this in mind when using this fix, especially if you are going to embed it into a program used by the less technically and security savvy.
It is a shame you need to restart Windows once you have reset the registry key; otherwise you could just switch it back on afterwards.
|
|
|
Post by (X) on Dec 1, 2023 14:57:20 GMT 1
I asked BING: BING's answer:
|
|
|
Post by Roger Cabo on Dec 1, 2023 17:06:03 GMT 1
CHAT GPT4.0: Q; Why does setting the registry key DisableCachingOfSSLPages to 0 in Windows not pose a significant risk for storing sensitive information transmitted over SSL/TLS connections in the browser cache?
GPT4.0:
Registry key DisableCachingOfSSLPages: When set to 0, Windows allows the caching of SSL pages. However, this mainly refers to the content of the page itself (such as HTML, CSS, JavaScript) and not the sensitive data transmitted over these pages. The actual sensitive information that is transmitted over SSL/TLS connections is not stored in the browser cache.
|
|
|
Post by Roger Cabo on Dec 1, 2023 18:10:15 GMT 1
After several test I was able to access Bing with a search term and get the complete result without login to Bing.
The program calls Bing by your standard web browser.. in my case its brave or Firefox.
And open the standard browser with the result
Works!
// URLDownloadToFileA V1.01
$Library "gfawinx" $Library "UpdateRT" UpdateRuntime ' Patches GfaWin23.Ocx
Declare Function URLDownloadToFileA Lib "urlmon.dll" Alias _ "URLDownloadToFileA" (ByVal pCaller As Long, _ ByVal szURL As String, _ ByVal szFileName As String, _ ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long
Dim strURL$ = "https://www.bing.com/search?q=" Dim postStrURL$ = "&qs=n&form=QBRE"
// Search Term " Dim SarchTerm$ = "gfabasic32" // Result URL " Dim ResultURL$ = strURL$ + SarchTerm$ + postStrURL$
Dim localFile$ = App.Path + "\test.html" Dim lngRetVal As Long Dim lngRetVal = URLDownloadToFileA(0, ResultURL$, localFile, 0, 0)
// ... Check the error if caching is disabled // ... Regedit settings to get it work // ... Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings // ... Key "DisableCachingOfSSLPages" = "0"
If lngRetVal = -2146697208 Dim key$ = "\\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" Dim hkey$ = OpenRegKey(key$) Dim hKeyName$ = "DisableCachingOfSSLPages" Dim i% Dim hKeyValueInt%, rtype% For i% = 1 To GetRegValCount(hkey) If( Lower$( GetRegValName(hkey, i)) = Lower$(hKeyName)) hKeyValueInt% = GetRegVal(hkey, i, Int) // ... Is caching disabled? If (hKeyValueInt% = 0) // Yes SaveSetting hkey$, "", hKeyName, "1" MsgBox "Please restart Windows." EndIf EndIf Next i CloseRegKey(key$) EndIf
If lngRetVal = 0 Dim f$ Open localFile for Input As # 1 f = Input$(LOF(# 1), # 1) Close # 1 EndIf
Debug lngRetVal
OpenHTMLFile(localFile)
Sub OpenHTMLFile(filePath As String) ~ShellExec(filePath, "") End Sub
|
|
|
Post by (X) on Dec 1, 2023 18:24:19 GMT 1
Can you get an answer from Bing Chat? (in Precise Mode for example?)
|
|
|
Post by Roger Cabo on Dec 1, 2023 19:41:10 GMT 1
It seems the chat frame is not accessible.. not possible..
|
|
|
Post by (X) on Dec 1, 2023 19:43:09 GMT 1
I assume they want $$$ for that functionality... Which is understandable.
|
|
|
Post by Roger Cabo on Dec 2, 2023 23:35:03 GMT 1
Yes.. also prevent extra traffic and machine resources because 100.000.000 programmers like us try to access their server at the same time.
|
|