<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Авторизация Вконтакте]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6568</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6568&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Авторизация Вконтакте».]]></description>
		<lastBuildDate>Sun, 18 Dec 2011 10:32:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Авторизация Вконтакте]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54739#p54739</link>
			<description><![CDATA[<p>я вообще запутался <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Dixxx)]]></author>
			<pubDate>Sun, 18 Dec 2011 10:32:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54739#p54739</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Авторизация Вконтакте]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54738#p54738</link>
			<description><![CDATA[<p>Что-то мне не нравится стиль вашего изложения <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />В приведенном коде 2 функции:<br /></p><div class="quotebox"><blockquote><p>httpQuery(byref Result, lpszUrl, POSTDATA=&quot;&quot;, HEADERS=&quot;&quot;)<br />http_win(byref Result, lpszUrl, POSTDATA=&quot;&quot;, HEADERS=&quot;&quot;,fix_HttpQuery=&quot;&quot;)</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Sun, 18 Dec 2011 09:47:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54738#p54738</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Авторизация Вконтакте]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54737#p54737</link>
			<description><![CDATA[<p>С этим разобрался, но вот с самописной connect не получается, вроде как она есть в этой библиотеке, но всё равно выдаёт ошибку:|<br /></p><div class="codebox"><pre><code>; &lt;COMPILER: v1.0.48.5&gt;

httpQuery(byref Result, lpszUrl, POSTDATA=&quot;&quot;, HEADERS=&quot;&quot;)
{






   global httpQueryOps, httpAgent, httpProxy, httpProxyByPass, httpQueryReferer, httpQueryAcceptType
       , httpQueryDwFlags

   defaultOps =
   (LTrim Join|
      httpAgent=AutoHotkeyScript|httpProxy=0|httpProxyByPass=0|INTERNET_FLAG_SECURE=0x00800000 
      SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x00000100|SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x00001000 
      SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x00002000|SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE=0x00000200 
      INTERNET_OPEN_TYPE_PROXY=3|INTERNET_OPEN_TYPE_DIRECT=1|INTERNET_SERVICE_HTTP=3 
   ) 
   Loop,Parse,defaultOps,|
   {
      RegExMatch(A_LoopField,&quot;(?P&lt;Option&gt;[^=]+)=(?P&lt;Default&gt;.*)&quot;,http)
      if StrLen(%httpOption%)=0
         %httpOption% := httpDefault
   }


   hModule := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;WinINet.Dll&quot;)



   offset_name_length:= &quot;4-lpszScheme-255|16-lpszHostName-1024|28-lpszUserName-1024|&quot;
                  . &quot;36-lpszPassword-1024|44-lpszUrlPath-1024|52-lpszExtrainfo-1024&quot;
   VarSetCapacity(URL_COMPONENTS,60,0)

   NumPut(60,URL_COMPONENTS,0), NumPut(255,URL_COMPONENTS,12), NumPut(0xffff,URL_COMPONENTS,24)

   Loop,Parse,offset_name_length,|
   {
      RegExMatch(A_LoopField,&quot;(?P&lt;Offset&gt;\d+)-(?P&lt;Name&gt;[a-zA-Z]+)-(?P&lt;Size&gt;\d+)&quot;,iCU_)
      VarSetCapacity(%iCU_Name%,iCU_Size,0)
      NumPut(&amp;%iCU_Name%,URL_COMPONENTS,iCU_Offset)
      NumPut(iCU_Size,URL_COMPONENTS,iCU_Offset+4)
   }



   DllCall(&quot;WinINet\InternetCrackUrlA&quot;,&quot;Str&quot;,lpszUrl,&quot;uInt&quot;,StrLen(lpszUrl),&quot;uInt&quot;,0,&quot;uInt&quot;,&amp;URL_COMPONENTS)


   Loop,Parse,offset_name_length,|
   {
      RegExMatch(A_LoopField,&quot;-(?P&lt;Name&gt;[a-zA-Z]+)-&quot;,iCU_)
      VarSetCapacity(%iCU_Name%,-1)
   }
   nPort:=NumGet(URL_COMPONENTS,24,&quot;uInt&quot;)


   dwFlags := httpQueryDwFlags



   if (lpszScheme = &quot;https&quot;)
      dwFlags |= (INTERNET_FLAG_SECURE|SECURITY_FLAG_IGNORE_CERT_CN_INVALID
               |SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)


   if (lpszScheme=&quot;unknown&quot;) {
      Result := &quot;ERR: No Valid URL supplied.&quot;
      Return StrLen(Result)
   }



   hInternet := DllCall(&quot;WinINet\InternetOpenA&quot;
                  ,&quot;Str&quot;,httpAgent,&quot;UInt&quot;
                  ,(httpProxy != 0 ?  INTERNET_OPEN_TYPE_PROXY : INTERNET_OPEN_TYPE_DIRECT )
                  ,&quot;Str&quot;,httpProxy,&quot;Str&quot;,httpProxyBypass,&quot;Uint&quot;,0)



   hConnect := DllCall(&quot;WinINet\InternetConnectA&quot;
                  ,&quot;uInt&quot;,hInternet,&quot;Str&quot;,lpszHostname, &quot;Int&quot;,nPort
                  ,&quot;Str&quot;,lpszUserName, &quot;Str&quot;,lpszPassword,&quot;uInt&quot;,INTERNET_SERVICE_HTTP
                  ,&quot;uInt&quot;,0,&quot;uInt*&quot;,0)


   if (Strlen(POSTDATA)&gt;0) {
      HTTPVerb:=&quot;POST&quot;
      if StrLen(Headers)=0
         Headers:=&quot;Content-Type: application/x-www-form-urlencoded&quot;
   } else
      HTTPVerb:=&quot;GET&quot;



   hRequest := DllCall(&quot;WinINet\HttpOpenRequestA&quot;
                  ,&quot;uInt&quot;,hConnect,&quot;Str&quot;,HTTPVerb,&quot;Str&quot;,lpszUrlPath . lpszExtrainfo
                  ,&quot;Str&quot;,ProVer := &quot;HTTP/1.1&quot;, &quot;Str&quot;,httpQueryReferer,&quot;Str&quot;,httpQueryAcceptTypes
                  ,&quot;uInt&quot;,dwFlags,&quot;uInt&quot;,Context:=0 )



   sRequest := DllCall(&quot;WinINet\HttpSendRequestA&quot;
                  , &quot;uInt&quot;,hRequest,&quot;Str&quot;,Headers, &quot;uInt&quot;,Strlen(Headers)
                  , &quot;Str&quot;,POSTData,&quot;uInt&quot;,Strlen(POSTData))

   VarSetCapacity(header, 2048, 0)
   VarSetCapacity(header_len, 4, 0)



   Loop, 5
     if ((headerRequest:=DllCall(&quot;WinINet\HttpQueryInfoA&quot;,&quot;uint&quot;,hRequest
      ,&quot;uint&quot;,21,&quot;uint&quot;,&amp;header,&quot;uint&quot;,&amp;header_len,&quot;uint&quot;,0))=1)
      break

   If (headerRequest=1) {
      VarSetCapacity(res,headerLength:=NumGet(header_len),32)
      DllCall(&quot;RtlMoveMemory&quot;,&quot;uInt&quot;,&amp;res,&quot;uInt&quot;,&amp;header,&quot;uInt&quot;,headerLength)
      Loop,% headerLength
         if (*(&amp;res-1+a_index)=0)
            NumPut(Asc(&quot;`n&quot;),res,a_index-1,&quot;uChar&quot;)
      VarSetCapacity(res,-1)
   } else
      res := &quot;timeout&quot;


   Loop,Parse,res,`n,`r
   {
      RetValue := A_LoopField
      break
   }


   If (RetValue=&quot;timeout&quot;) {
      html := &quot;Error: timeout&quot;
      return -1
   }

   RetValue := RegExReplace(RetValue,&quot;HTTP/1\.[01]\s+&quot;)


   HttpRetCodes := &quot;100=Continue|101=Switching Protocols|102=Processing (WebDAV) (RFC 2518)|&quot;
              . &quot;200=OK|201=Created|202=Accepted|203=Non-Authoritative Information|204=No&quot;
              . &quot; Content|205=Reset Content|206=Partial Content|207=Multi-Status (WebDAV)&quot;
              . &quot;|300=Multiple Choices|301=Moved Permanently|302=Found|303=See Other|304=&quot;
              . &quot;Not Modified|305=Use Proxy|306=Switch Proxy|307=Temporary Redirect|400=B&quot;
              . &quot;ad Request|401=Unauthorized|402=Payment Required|403=Forbidden|404=Not F&quot;
              . &quot;ound|405=Method Not Allowed|406=Not Acceptable|407=Proxy Authentication &quot;
              . &quot;Required|408=Request Timeout|409=Conflict|410=Gone|411=Length Required|4&quot;
              . &quot;12=Precondition Failed|413=Request Entity Too Large|414=Request-URI Too &quot;
              . &quot;Long|415=Unsupported Media Type|416=Requested Range Not Satisfiable|417=&quot;
              . &quot;Expectation Failed|418=I&#039;m a teapot (RFC 2324)|422=Unprocessable Entity &quot;
              . &quot;(WebDAV) (RFC 4918)|423=Locked (WebDAV) (RFC 4918)|424=Failed Dependency&quot;
              . &quot; (WebDAV) (RFC 4918)|425=Unordered Collection (RFC 3648)|426=Upgrade Req&quot;
              . &quot;uired (RFC 2817)|449=Retry With|500=Internal Server Error|501=Not Implem&quot;
              . &quot;ented|502=Bad Gateway|503=Service Unavailable|504=Gateway Timeout|505=HT&quot;
              . &quot;TP Version Not Supported|506=Variant Also Negotiates (RFC 2295)|507=Insu&quot;
              . &quot;fficient Storage (WebDAV) (RFC 4918)|509=Bandwidth Limit Exceeded|510=No&quot;
              . &quot;t Extended (RFC 2774)&quot;


   RetValue := SubStr(RetValue,1,3)


   Loop,Parse,HttpRetCodes,|
   {
      HttpReturnCode := SubStr(A_LoopField,1,3)
      HttpReturnMsg  := SubStr(A_LoopField,5)
      if (RetValue=HttpReturnCode) {
         RetMsg := HttpReturnMsg
         break
      }
   }


   if strlen(HTTPQueryOps)&gt;0 {

      if (instr(HTTPQueryOps,&quot;showHeader&quot;))
         MsgBox % res

      if (instr(HTTPQueryOps,&quot;storeHeader&quot;))
         global HttpQueryHeader := res

      if (instr(HTTPQueryOps,&quot;updateSize&quot;)) {
         Loop,Parse,res,`n
            If RegExMatch(A_LoopField,&quot;Content-Length:\s+?(?P&lt;Size&gt;\d+)&quot;,full) {
               global HttpQueryFullSize := fullSize
               break
            }
         if (fullSize+0=0)
            HttpQueryFullSize := &quot;size unavailable&quot;
      }
   }


   if !(InStr(&quot;100 200 201 202 302&quot;,RetValue)) {
      Result := RetValue &quot; &quot; RetMsg
      return StrLen(Result)
   }

   VarSetCapacity(BytesRead,4,0)
   fsize := 0
   Loop
   {
      bc := A_Index
      VarSetCapacity(buffer%bc%,1024,0)
      ReadFile := DllCall(&quot;wininet\InternetReadFile&quot;
                  ,&quot;uInt&quot;,hRequest,&quot;uInt&quot;,&amp;buffer%bc%,&quot;uInt&quot;,1024,&quot;uInt&quot;,&amp;BytesRead)
      ReadBytes := NumGet(BytesRead)
      If ((ReadFile!=0)&amp;&amp;(!ReadBytes))
         break
      Else {
         fsize += ReadBytes
         sizeArray .= ReadBytes &quot;|&quot;
      }
      if (instr(HTTPQueryOps,&quot;updateSize&quot;))
         Global HttpQueryCurrentSize := fsize
   }
   sizeArray := SubStr(sizeArray,1,-1)

   VarSetCapacity(result,fSize+1,0)
   Dest := &amp;result
   Loop,Parse,SizeArray,|
      DllCall(&quot;RtlMoveMemory&quot;,&quot;uInt&quot;,Dest,&quot;uInt&quot;,&amp;buffer%A_Index%,&quot;uInt&quot;,A_LoopField)
      , Dest += A_LoopField

   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hRequest)
   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hInternet)
   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hConnect)
   DllCall(&quot;FreeLibrary&quot;, &quot;UInt&quot;, hModule)
   return fSize
}
http_win(byref Result, lpszUrl, POSTDATA=&quot;&quot;, HEADERS=&quot;&quot;,fix_HttpQuery=&quot;&quot;)
{






   global httpQueryOps, httpAgent, httpProxy, httpProxyByPass, httpQueryReferer, httpQueryAcceptType
       , httpQueryDwFlags



   quote=&quot;
   trash_quote=&#039;

   scr_url:=lpszUrl
   scr_post:=POSTDATA
   scr_head:=HEADERS
   scr_fix:=fix_HttpQuery
   defaultOps:=&quot;httpProxy=0|httpProxyByPass=1|INTERNET_FLAG_SECURE=0x00800000|SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x00000100|SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x00001000|SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x00002000|SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE=0x00000200|INTERNET_OPEN_TYPE_PROXY=3|INTERNET_OPEN_TYPE_DIRECT=1|INTERNET_SERVICE_HTTP=3&quot;
   Loop,Parse,defaultOps,|
   {
      RegExMatch(A_LoopField,&quot;(?P&lt;Option&gt;[^=]+)=(?P&lt;Default&gt;.*)&quot;,http)
      if StrLen(%httpOption%)=0
         %httpOption% := httpDefault
   }


   hModule := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;WinINet.Dll&quot;)



   offset_name_length:= &quot;4-lpszScheme-255|16-lpszHostName-1024|28-lpszUserName-1024|&quot;
                  . &quot;36-lpszPassword-1024|44-lpszUrlPath-1024|52-lpszExtrainfo-1024&quot;
   VarSetCapacity(URL_COMPONENTS,60,0)

   NumPut(60,URL_COMPONENTS,0), NumPut(255,URL_COMPONENTS,12), NumPut(0xffff,URL_COMPONENTS,24)

   Loop,Parse,offset_name_length,|
   {
      RegExMatch(A_LoopField,&quot;(?P&lt;Offset&gt;\d+)-(?P&lt;Name&gt;[a-zA-Z]+)-(?P&lt;Size&gt;\d+)&quot;,iCU_)
      VarSetCapacity(%iCU_Name%,iCU_Size,0)
      NumPut(&amp;%iCU_Name%,URL_COMPONENTS,iCU_Offset)
      NumPut(iCU_Size,URL_COMPONENTS,iCU_Offset+4)
   }



   DllCall(&quot;WinINet\InternetCrackUrlA&quot;,&quot;Str&quot;,lpszUrl,&quot;uInt&quot;,StrLen(lpszUrl),&quot;uInt&quot;,0,&quot;uInt&quot;,&amp;URL_COMPONENTS)


   Loop,Parse,offset_name_length,|
   {
      RegExMatch(A_LoopField,&quot;-(?P&lt;Name&gt;[a-zA-Z]+)-&quot;,iCU_)
      VarSetCapacity(%iCU_Name%,-1)
   }
   nPort:=NumGet(URL_COMPONENTS,24,&quot;uInt&quot;)


   dwFlags := httpQueryDwFlags



   if (lpszScheme = &quot;https&quot;)
      dwFlags |= (INTERNET_FLAG_SECURE|SECURITY_FLAG_IGNORE_CERT_CN_INVALID
               |SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)


   if (lpszScheme=&quot;unknown&quot;) {
      Result := &quot;ERR: No Valid URL supplied.&quot;
      Return StrLen(Result)
   }



   hInternet := DllCall(&quot;WinINet\InternetOpenA&quot;
                  ,&quot;Str&quot;,httpAgent,&quot;UInt&quot;
                  ,(httpProxy != 0 ?  INTERNET_OPEN_TYPE_PROXY : INTERNET_OPEN_TYPE_DIRECT )
                  ,&quot;Str&quot;,httpProxy,&quot;Str&quot;,httpProxyBypass,&quot;Uint&quot;,0)



   hConnect := DllCall(&quot;WinINet\InternetConnectA&quot;
                  ,&quot;uInt&quot;,hInternet,&quot;Str&quot;,lpszHostname, &quot;Int&quot;,nPort
                  ,&quot;Str&quot;,lpszUserName, &quot;Str&quot;,lpszPassword,&quot;uInt&quot;,INTERNET_SERVICE_HTTP
                  ,&quot;uInt&quot;,0,&quot;uInt*&quot;,0)


   if (Strlen(POSTDATA)&gt;0) {
      HTTPVerb:=&quot;POST&quot;
      if StrLen(Headers)=0
         Headers:=&quot;Content-Type: application/x-www-form-urlencoded&quot;
   } else
      HTTPVerb:=&quot;GET&quot;



   hRequest := DllCall(&quot;WinINet\HttpOpenRequestA&quot;
                  ,&quot;uInt&quot;,hConnect,&quot;Str&quot;,HTTPVerb,&quot;Str&quot;,lpszUrlPath . lpszExtrainfo
                  ,&quot;Str&quot;,ProVer := &quot;HTTP/1.1&quot;, &quot;Str&quot;,httpQueryReferer,&quot;Str&quot;,httpQueryAcceptTypes
                  ,&quot;uInt&quot;,dwFlags,&quot;uInt&quot;,Context:=0 )



   sRequest := DllCall(&quot;WinINet\HttpSendRequestA&quot;
                  , &quot;uInt&quot;,hRequest,&quot;Str&quot;,Headers, &quot;uInt&quot;,Strlen(Headers)
                  , &quot;Str&quot;,POSTData,&quot;uInt&quot;,Strlen(POSTData))

   VarSetCapacity(header, 2048, 0)
   VarSetCapacity(header_len, 4, 0)



   Loop, 5
     if ((headerRequest:=DllCall(&quot;WinINet\HttpQueryInfoA&quot;,&quot;uint&quot;,hRequest
      ,&quot;uint&quot;,21,&quot;uint&quot;,&amp;header,&quot;uint&quot;,&amp;header_len,&quot;uint&quot;,0))=1)
      break

   If (headerRequest=1) {
      VarSetCapacity(res,headerLength:=NumGet(header_len),32)
      DllCall(&quot;RtlMoveMemory&quot;,&quot;uInt&quot;,&amp;res,&quot;uInt&quot;,&amp;header,&quot;uInt&quot;,headerLength)
      Loop,% headerLength
         if (*(&amp;res-1+a_index)=0)
            NumPut(Asc(&quot;`n&quot;),res,a_index-1,&quot;uChar&quot;)
      VarSetCapacity(res,-1)
   } else
      res := &quot;timeout&quot;


   Loop,Parse,res,`n,`r
   {
      RetValue := A_LoopField
      break
   }


   If (RetValue=&quot;timeout&quot;) {
      html := &quot;Error: timeout&quot;
      return -1
   }

   RetValue := RegExReplace(RetValue,&quot;HTTP/1\.[01]\s+&quot;)


   HttpRetCodes := &quot;100=Continue|101=Switching Protocols|102=Processing (WebDAV) (RFC 2518)|&quot;
              . &quot;200=OK|201=Created|202=Accepted|203=Non-Authoritative Information|204=No&quot;
              . &quot; Content|205=Reset Content|206=Partial Content|207=Multi-Status (WebDAV)&quot;
              . &quot;|300=Multiple Choices|301=Moved Permanently|302=Found|303=See Other|304=&quot;
              . &quot;Not Modified|305=Use Proxy|306=Switch Proxy|307=Temporary Redirect|400=B&quot;
              . &quot;ad Request|401=Unauthorized|402=Payment Required|403=Forbidden|404=Not F&quot;
              . &quot;ound|405=Method Not Allowed|406=Not Acceptable|407=Proxy Authentication &quot;
              . &quot;Required|408=Request Timeout|409=Conflict|410=Gone|411=Length Required|4&quot;
              . &quot;12=Precondition Failed|413=Request Entity Too Large|414=Request-URI Too &quot;
              . &quot;Long|415=Unsupported Media Type|416=Requested Range Not Satisfiable|417=&quot;
              . &quot;Expectation Failed|418=I&#039;m a teapot (RFC 2324)|422=Unprocessable Entity &quot;
              . &quot;(WebDAV) (RFC 4918)|423=Locked (WebDAV) (RFC 4918)|424=Failed Dependency&quot;
              . &quot; (WebDAV) (RFC 4918)|425=Unordered Collection (RFC 3648)|426=Upgrade Req&quot;
              . &quot;uired (RFC 2817)|449=Retry With|500=Internal Server Error|501=Not Implem&quot;
              . &quot;ented|502=Bad Gateway|503=Service Unavailable|504=Gateway Timeout|505=HT&quot;
              . &quot;TP Version Not Supported|506=Variant Also Negotiates (RFC 2295)|507=Insu&quot;
              . &quot;fficient Storage (WebDAV) (RFC 4918)|509=Bandwidth Limit Exceeded|510=No&quot;
              . &quot;t Extended (RFC 2774)&quot;


   RetValue := SubStr(RetValue,1,3)


   Loop,Parse,HttpRetCodes,|
   {
      HttpReturnCode := SubStr(A_LoopField,1,3)
      HttpReturnMsg  := SubStr(A_LoopField,5)
      if (RetValue=HttpReturnCode) {
         RetMsg := HttpReturnMsg
         break
      }
   }


   if strlen(HTTPQueryOps)&gt;0 {

      if (instr(HTTPQueryOps,&quot;showHeader&quot;))
         MsgBox % res

      if (instr(HTTPQueryOps,&quot;storeHeader&quot;))
         global HttpQueryHeader := res

      if (instr(HTTPQueryOps,&quot;updateSize&quot;)) {
         Loop,Parse,res,`n
            If RegExMatch(A_LoopField,&quot;Content-Length:\s+?(?P&lt;Size&gt;\d+)&quot;,full) {
               global HttpQueryFullSize := fullSize
               break
            }
         if (fullSize+0=0)
            HttpQueryFullSize := &quot;size unavailable&quot;
      }
   }


   if !(InStr(&quot;100 200 201 202 302 400 500&quot;,RetValue)) {
      Result := RetValue &quot; &quot; RetMsg
      return StrLen(Result)
   }

   VarSetCapacity(BytesRead,4,0)
   fsize := 0
   Loop
   {
      bc := A_Index
      VarSetCapacity(buffer%bc%,1024,0)
      ReadFile := DllCall(&quot;wininet\InternetReadFile&quot;
                  ,&quot;uInt&quot;,hRequest,&quot;uInt&quot;,&amp;buffer%bc%,&quot;uInt&quot;,1024,&quot;uInt&quot;,&amp;BytesRead)
      ReadBytes := NumGet(BytesRead)
      If ((ReadFile!=0)&amp;&amp;(!ReadBytes))
         break
      Else {
         fsize += ReadBytes
         sizeArray .= ReadBytes &quot;|&quot;
      }
      if (instr(HTTPQueryOps,&quot;updateSize&quot;))
         Global HttpQueryCurrentSize := fsize
   }
   sizeArray := SubStr(sizeArray,1,-1)

   VarSetCapacity(result,fSize+1,0)





   Dest := &amp;result
   Loop,Parse,SizeArray,|
      DllCall(&quot;RtlMoveMemory&quot;,&quot;uInt&quot;,Dest,&quot;uInt&quot;,&amp;buffer%A_Index%,&quot;uInt&quot;,A_LoopField)
      , Dest += A_LoopField

      if(fix_HttpQuery=&quot;&quot;)
      {
         varSetCapacity(result,-1)
         result:= RegexReplace(result, quote, trash_quote)
         StringReplace,result,result,`r,,All
      }





   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hRequest)
   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hInternet)
   DllCall(&quot;WinINet\InternetCloseHandle&quot;, &quot;uInt&quot;, hConnect)
   DllCall(&quot;FreeLibrary&quot;, &quot;UInt&quot;, hModule)




   return qwe:=fSize . &quot;|--|--|&quot; res




}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Dixxx)]]></author>
			<pubDate>Sun, 18 Dec 2011 09:15:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54737#p54737</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Авторизация Вконтакте]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54728#p54728</link>
			<description><![CDATA[<p>Где-то рядом с местом нахождения сего скрипта должна лежать функция EncodeURL() <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Sat, 17 Dec 2011 21:25:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54728#p54728</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Авторизация Вконтакте]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=54726#p54726</link>
			<description><![CDATA[<p>Всем привет. Нашёл на просторах интернета пример авторизации ВК, лично у меня не работает, не могу разобраться что именно исправить. Помогите пожалуйста.<br /></p><div class="codebox"><pre><code>Gui, Color, Default
Gui, Add, Edit, x82 y70 w145 h17 vmail,Введите e&#039;mail
Gui, Add, Edit, x82 y97 w145 h17 vpass password,Введите пароль
Gui, Add, Button,genter x150 y122 w82 h22 +default,Вход
Gui, Show,x0 y0 w250 h150,Vkontakte
Return
GuiClose:
ExitApp
return
enter:
Gui,Submit,NoHide
passw := pass
If (!if)
{
passw:=&quot;&quot;
}
mail := EncodeURL(mail)
pass := EncodeURL(pass)
otvet := connect(&quot;http://vkontakte.ru/login.php&quot;,&quot;Content-Type: application/x-www-form-urlencoded`nX-Requested-With: XMLHttpRequest`nContent-Transfer-Encoding: binary`nCookie:remixsid=nonenone&quot;,&quot;op=a_login_attempt&quot;)
reg=captcha_sid&quot;:&quot;(.*?)&quot;
loop{
If RegExMatch(otvet,reg,sid_catpcha){
URLDownloadToFile,http://vkontakte.ru/captcha.php?s=1&amp;sid=%sid_catpcha1%,captcha.jpg
captcha := &quot;&quot;
captcha()
loop{
If captcha{
break
}
}
otvet := connect(&quot;http://vkontakte.ru/login.php&quot;,&quot;Content-Type: application/x-www-form-urlencoded`nX-Requested-With: XMLHttpRequest`nContent-Transfer-Encoding: binary`nCookie:remixsid=nonenone&quot;,&quot;op=a_login_attempt&amp;captcha_sid=&quot; sid_catpcha1 &quot;&amp;captcha_key=&quot; EncodeURL(captcha))
}else{
break
}
}
httpQueryDwFlags := (INTERNET_FLAG_NO_COOKIES:= 0x00080000|INTERNET_FLAG_DONT_CACHE:=0x04000000|INTERNET_FLAG_NO_CACHE_WRITE:=0x04000000|INTERNET_FLAG_RELOAD:=0x80000000)
reconn_post:=&quot;act=login&amp;q=1&amp;al_frame=1&amp;expire=&amp;captcha_sid=&amp;captcha_key=&amp;from_host=vkontakte.ru&amp;email=&quot; mail &quot;&amp;pass=&quot; pass
reconn_data:=http_win(fake_reconn_data:=&quot;&quot;,&quot;http://login.vk.com/?act=login&quot;,reconn_post)
RegExMatch(reconn_data, &quot;remixsid=(.*?);&quot;,sid)
httpQueryDwFlags := (INTERNET_FLAG_NO_COOKIES:= 0x00080000|INTERNET_FLAG_DONT_CACHE:=0x04000000|INTERNET_FLAG_NO_CACHE_WRITE:=0x04000000|INTERNET_FLAG_RELOAD:=0x80000000|INTERNET_FLAG_NO_AUTO_REDIRECT:= 0x00200000)
if sid1=deleted
{
msgbox 0,%name%,Неверный пароль..
return
}else{
Gui,Destroy
cookie :=&quot;Content-Type: application/x-www-form-urlencoded`nX-Requested-With: XMLHttpRequest`nContent-Transfer-Encoding: binary`nCookie:remixchk=5; remixsid=&quot; sid1
sleep 2000
otvet:= connect(&quot;http://vkontakte.ru/feed.php&quot;,cookie,&quot;&quot;)
RegExMatch(otvet, &quot;id=(.*?),&quot;, myid)
If (myid1==&quot;&quot;){
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Dixxx)]]></author>
			<pubDate>Sat, 17 Dec 2011 21:16:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=54726#p54726</guid>
		</item>
	</channel>
</rss>
