<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13904&amp;type=atom" />
	<updated>2020-12-04T16:57:43Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13904</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143901#p143901" />
			<content type="html"><![CDATA[<p>У вас сложности на ровном месте.<br /></p><div class="codebox"><pre><code>mail := &quot;mailmailmailmail@gmail.com&quot;
pass := &quot;passpasspasspasspasspass&quot;


HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;POST&quot;, &quot;https://archive.org/account/login&quot;, true)
HTTP.SetRequestHeader(&quot;User-Agent&quot;, &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36&quot;)
HTTP.SetRequestHeader(&quot;Pragma&quot;, &quot;no-cache&quot;)
HTTP.SetRequestHeader(&quot;Cache-Control&quot;, &quot;no-cache, no-store&quot;)
HTTP.SetRequestHeader(&quot;If-Modified-Since&quot;, &quot;Sat, 1 Jan 2000 00:00:00 GMT&quot;)
HTTP.SetRequestHeader(&quot;content-type&quot;, &quot;application/x-www-form-urlencoded&quot;)
HTTP.SetRequestHeader(&quot;accept&quot;, &quot;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9&quot;)
HTTP.SetRequestHeader(&quot;origin&quot;, &quot;https://archive.org&quot;)
HTTP.SetRequestHeader(&quot;referer&quot;, &quot;https://archive.org/account/login&quot;)
HTTP.SetRequestHeader(&quot;sec-fetch-dest&quot;, &quot;document&quot;)
HTTP.SetRequestHeader(&quot;sec-fetch-mode&quot;, &quot;navigate&quot;)
HTTP.SetRequestHeader(&quot;sec-fetch-site&quot;, &quot;same-origin&quot;)
HTTP.SetRequestHeader(&quot;sec-fetch-user&quot;, &quot;?1&quot;)
HTTP.SetRequestHeader(&quot;upgrade-insecure-requests&quot;, &quot;1&quot;)
HTTP.SetRequestHeader(&quot;cookie&quot;, &quot;test-cookie=1&quot;)
HTTP.Send(&quot;login=true&amp;username=&quot; URIEncode(email) &quot;&amp;password=&quot; URIEncode(password) &quot;&amp;referer=https%3A%2F%2Farchive.org%2F&amp;submit-to-login=Log+in&quot;)
HTTP.WaitForResponse()
msgbox % clipboard := HTTP.ResponseText



URIEncode(str, encoding := &quot;UTF-8&quot;)
{
   VarSetCapacity(var, StrPut(str, encoding))
   StrPut(str, &amp;var, encoding)
   While code := NumGet(Var, A_Index - 1, &quot;UChar&quot;)
   {
      bool := (code &gt; 0x7F || code &lt; 0x30 || code = 0x3D)
      UrlStr .= bool ? &quot;%&quot; . Format(&quot;{:02X}&quot;, code) : Chr(code)
   }
   Return UrlStr
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-12-04T16:57:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143901#p143901</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143900#p143900" />
			<content type="html"><![CDATA[<p><strong>wladkokopops</strong><br />Надо бы на archive.org. Вот вроде воспроизвел все, но не работает:<br /></p><div class="codebox"><pre><code>mail := &quot;mailmailmailmail@gmail.com&quot;
pass := &quot;passpasspasspasspasspass&quot;

   GoSub, Boundary
   GoSub, login

Boundary:


Boundary := RandomBoundary()
data =
(
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;username&quot;

%mail%
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;password&quot;

%pass%
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;remember&quot;

true
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;referer&quot;

https://archive.org/details/%page_code%
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;login&quot;

true
-----------------------------%Boundary%
Content-Disposition: form-data; name=&quot;submit_by_js&quot;

true
-----------------------------%Boundary%--

)
return

login:
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;POST&quot;, &quot;https://archive.org/account/login&quot;, true)
HTTP.SetRequestHeader(&quot;User-Agent&quot;, User_Agent)
HTTP.SetRequestHeader(&quot;Cookie&quot;, &quot;test-cookie=1&quot;)
HTTP.SetRequestHeader(&quot;Accept&quot;, &quot;*/*&quot;)
HTTP.SetRequestHeader(&quot;Connection&quot;, &quot;Keep-Alive&quot;)
HTTP.SetRequestHeader(&quot;DNT&quot;, &quot;1&quot;)
HTTP.SetRequestHeader(&quot;Host&quot;, &quot;archive.org&quot;)
HTTP.SetRequestHeader(&quot;Accept-Language&quot;, &quot;ru-RU&quot;)
HTTP.SetRequestHeader(&quot;Referer&quot;, &quot;https://archive.org/account/login&quot;)
HTTP.SetRequestHeader(&quot;Accept-Encoding&quot;, &quot;gzip, deflate&quot;)
HTTP.SetRequestHeader(&quot;Pragma&quot;, &quot;no-cache&quot;)
HTTP.SetRequestHeader(&quot;Cache-Control&quot;, &quot;no-cache&quot;)
HTTP.SetRequestHeader(&quot;If-Modified-Since&quot;, &quot;Sat, 1 Jan 2000 00:00:00 GMT&quot;)
HTTP.SetRequestHeader(&quot;Content-Type&quot;, &quot;multipart/form-data; boundary=---------------------------&quot; Boundary)
HTTP.Send(data)
HTTP.WaitForResponse()
Return

RandomBoundary()
{
   str := &quot;0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z&quot;
   Sort, str, D| Random
   str := StrReplace(str, &quot;|&quot;)
   Return SubStr(str, 1, 14)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-12-04T16:00:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143900#p143900</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143898#p143898" />
			<content type="html"><![CDATA[<p>Прочитал все 42 сбщ, и не понял, мы куда сейчас авторизуемся?<br />Могу помочь с примерами.</p>]]></content>
			<author>
				<name><![CDATA[wladkokopops]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34240</uri>
			</author>
			<updated>2020-12-04T13:56:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143898#p143898</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143894#p143894" />
			<content type="html"><![CDATA[<p>Без понятия.<br />Надо смотреть по ситуации.<br />Я IE куки использовал (копировал в winhttprequest) только для обхода обновленной защиты клаудфларе.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-12-04T09:20:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143894#p143894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143891#p143891" />
			<content type="html"><![CDATA[<p>Проверка нужна именно на картинке. Это я пытаюсь скачать картинку с архив.орг через куки в IE.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-12-04T08:49:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143891#p143891</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143882#p143882" />
			<content type="html"><![CDATA[<p>А что мешает самому это проверить?<br />Залогиньтесь на каком-нибудь сайте в IE, после чего откройте его через скрипт и посмотрите залогинены или нет.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-12-04T05:31:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143882#p143882</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143878#p143878" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А Msxml2.XMLHTTP вообще использует куки с IE.</p></blockquote></div><p>Как использовать &quot;Msxml2.XMLHTTP&quot; при скачивании изображений? Вот такой фрагмент кода должен подхватывать куки из IE? —<br /></p><div class="codebox"><pre><code>
   HTTP := ComObjCreate(&quot;Msxml2.XMLHTTP.6.0&quot;)
   HTTP.Open(&quot;GET&quot;, URL, 0)
   HTTP.SetRequestHeader(&quot;User-Agent&quot;, User_Agent)
   HTTP.SetRequestHeader(&quot;Pragma&quot;, &quot;no-cache&quot;)
   HTTP.SetRequestHeader(&quot;If-Modified-Since&quot;, &quot;Sat, 1 Jan 2000 00:00:00 GMT&quot;)
   HTTP.Send()
   ;HTTP.WaitForResponse()
   Body := HTTP.ResponseBody
   pData := NumGet(ComObjValue(Body), A_PtrSize = 8? 16:12, &quot;ptr&quot;)
   File := FileOpen(A_ScriptDir &quot;\&quot; a_now &quot;.jpg&quot;, &quot;w&quot;)
   File.RawWrite(pData + 0, Body.MaxIndex() + 1)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-12-03T21:14:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143878#p143878</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138063#p138063" />
			<content type="html"><![CDATA[<p>Не получалось, потому что я <a href="https://vivaldi.dspl.ru/bx0001746/page/21/image/24/base64">ссылку</a> как обычно через браузер открывал, видел ошибку и думал, что через скрипт будет то же самое).</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-02-26T16:09:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138063#p138063</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138062#p138062" />
			<content type="html"><![CDATA[<p>Кстати, там есть сложность узнать точный размер картинки, потому что если вписывать любой — будут искажения в сравнении с размером того изо, которое можно открыть во вкладке браузера. Для этой книги по <a href="https://vivaldi.dspl.ru/bx0001746/page/sizes">ссылке</a> даны размеры, и если вписать значение &quot;Width&quot; до точки — то оно начинает примерно соответствовать реальному.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-02-26T15:50:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138062#p138062</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138061#p138061" />
			<content type="html"><![CDATA[<p>Ага, точно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-26T15:01:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138061#p138061</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138060#p138060" />
			<content type="html"><![CDATA[<p>Заменить&nbsp; 24 в https://vivaldi.dspl.ru/bx0001746/page/21/image/<strong>24</strong>/base64<br />на 96+- и будет нормальное. Джаваскрипт уменьшает.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-02-26T14:58:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138060#p138060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138059#p138059" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>WinHTTP := ComObjCreate(&quot;Msxml2.XMLHTTP.6.0&quot;)

url := &quot;https://vivaldi.dspl.ru/bx0001746/page/21/image/24/base64&quot;
WinHTTP.Open(&quot;GET&quot;, url, 0)
WinHTTP.SetRequestHeader(&quot;X-Requested-With&quot;, &quot;XMLHttpRequest&quot;)
WinHTTP.Send()
base64 := WinHTTP.ResponseText

length := CryptStringToBinary(base64, data)

pToken := GdipStartup()
pBitmap := GetBitmapFromData(&amp;data, length, hBitmap)
VarSetCapacity(data, 0)
GdipGetImageDimensions(pBitmap, Width, Height)
DllCall(&quot;gdiplus\GdipDisposeImage&quot;, Ptr, pBitmap)
GdipShutdown(pToken)

Gui, -DPIScale +LastFound
Gui, Margin, 0, 0
Gui, Add, Pic, w%Width% h%Height%, HBITMAP:%hBitmap%
Gui, Show

DllCall(&quot;DeleteObject&quot;, Ptr, hBitmap)
Return

GuiClose:
   ExitApp

CryptStringToBinary(string, ByRef outData, formatName := &quot;CRYPT_STRING_BASE64&quot;)
{
   static formats := { CRYPT_STRING_BASE64: 0x1
                     , CRYPT_STRING_HEX:    0x4
                     , CRYPT_STRING_HEXRAW: 0xC }
   fmt := formats[formatName]
   DllCall( &quot;Crypt32\CryptStringToBinary&quot;, &quot;Ptr&quot;, &amp;string, &quot;UInt&quot;, StrLen(string), &quot;UInt&quot;, fmt
                                         , &quot;UInt&quot;, 0, &quot;UIntP&quot;, bytes, &quot;UIntP&quot;, 0, &quot;UIntP&quot;, 0 )
   VarSetCapacity(outData, bytes) 
   DllCall( &quot;Crypt32\CryptStringToBinary&quot;, &quot;Ptr&quot;, &amp;string, &quot;UInt&quot;, StrLen(string), &quot;UInt&quot;, fmt
                                         , &quot;Str&quot;, outData, &quot;UIntP&quot;, bytes, &quot;UIntP&quot;, 0, &quot;UIntP&quot;, 0 )
   Return bytes
}

GetBitmapFromData(pData, nSize, ByRef hBitmap)
{
   pIStream := DllCall(&quot;Shlwapi\SHCreateMemStream&quot;, &quot;Ptr&quot;, pData, &quot;UInt&quot;, nSize, &quot;Ptr&quot;)

   DllCall(&quot;gdiplus\GdipCreateBitmapFromStream&quot;, &quot;Ptr&quot;, pIStream, &quot;PtrP&quot;, pBitmap)
   ObjRelease(pIStream)

   DllCall(&quot;gdiplus\GdipCreateHBITMAPFromBitmap&quot;, &quot;Ptr&quot;, pBitmap, &quot;PtrP&quot;, hBitmap, &quot;UInt&quot;, 0xFFFFFFFF)
   Return pBitmap
}

GdipGetImageDimensions(pBitmap, ByRef Width, ByRef Height)
{
   DllCall(&quot;gdiplus\GdipGetImageWidth&quot;, &quot;Ptr&quot;, pBitmap, &quot;UIntP&quot;, Width)
   DllCall(&quot;gdiplus\GdipGetImageHeight&quot;, &quot;Ptr&quot;, pBitmap, &quot;UIntP&quot;, Height)
}

GdipStartup()
{
   if !DllCall(&quot;GetModuleHandle&quot;, &quot;Str&quot;, &quot;gdiplus&quot;, &quot;Ptr&quot;)
      DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;gdiplus&quot;)
   VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1)
   DllCall(&quot;gdiplus\GdiplusStartup&quot;, &quot;PtrP&quot;, pToken, &quot;Ptr&quot;, &amp;si, &quot;Ptr&quot;, 0)
   return pToken
}

GdipShutdown(pToken)
{
   DllCall(&quot;gdiplus\GdiplusShutdown&quot;, &quot;Ptr&quot;, pToken)
   if hModule := DllCall(&quot;GetModuleHandle&quot;, &quot;Str&quot;, &quot;gdiplus&quot;, &quot;Ptr&quot;)
      DllCall(&quot;FreeLibrary&quot;, &quot;Ptr&quot;, hModule)
   return 0
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-26T14:57:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138059#p138059</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138058#p138058" />
			<content type="html"><![CDATA[<p>Это превьюшка.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-26T14:53:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138058#p138058</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138057#p138057" />
			<content type="html"><![CDATA[<p>А разве это ссылка на главную картинку?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-26T14:49:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138057#p138057</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Логин на сайтах (в ЖЖ, Инстаграме и тд)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138056#p138056" />
			<content type="html"><![CDATA[<p>Можно и не отбрасывать, а генерировать и отправлять.<br />Это epoch time.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-02-26T14:20:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138056#p138056</id>
		</entry>
</feed>
