<?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=9909&amp;type=atom" />
	<updated>2018-08-01T14:31:43Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9909</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127636#p127636" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/misc.php?action=pun_attachment&amp;item=1491&amp;preview">http://forum.script-coding.com/misc.php … mp;preview</a></p>]]></content>
			<author>
				<name><![CDATA[slavik26092001]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39423</uri>
			</author>
			<updated>2018-08-01T14:31:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127636#p127636</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86122#p86122" />
			<content type="html"><![CDATA[<p>Какие именно? Ptr и Int — это не переменные, а типы следующих за ними через запятую значений (параметров вызываемой функции). О них говорится в описании DllCall.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2014-08-25T13:43:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86122#p86122</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86121#p86121" />
			<content type="html"><![CDATA[<p>Понять переменные в смысле отследить откуда они появились в скрипте и что они делают. С buf теперь понятно откуда он.</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-08-25T12:35:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86121#p86121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86113#p86113" />
			<content type="html"><![CDATA[<p>Т.е. как откуда взято buf? Вот он создаётся:<br /></p><div class="codebox"><pre><code>
VarSetCapacity(buf, numBytes, 0)
</code></pre></div><p>Что касается &quot;понять переменные&quot;, то я не совсем понимаю, что это значит.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2014-08-25T08:55:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86113#p86113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86110#p86110" />
			<content type="html"><![CDATA[<p>Функционал я понял как он работает. Я не могу понять много переменных, находящихся в круглых скобках. Например, Ptr или Int, откуда взято Buf и т.д.</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-08-25T08:20:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86110#p86110</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86103#p86103" />
			<content type="html"><![CDATA[<p>Имена использованных функций говорят сами за себя, по-моему. Открывается процесс, читается из его памяти число или строка, закрывается процесс. Уточните, что именно вам не понятно.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2014-08-25T03:35:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86103#p86103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86097#p86097" />
			<content type="html"><![CDATA[<p>Решил все таки открыть для себя, что такое DllCall и как ей пользоваться. Начать решил с чтения памяти в процессе, поэтому попробовал разобраться в некоторых темах с кодом по чтению памяти:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=8735">http://forum.script-coding.com/viewtopic.php?id=8735</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=9705">http://forum.script-coding.com/viewtopic.php?id=9705</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=7735">http://forum.script-coding.com/viewtopic.php?id=7735</a><br />Надо сказать, что больше половины кодов в этих ссылках мне не понятны. Нашел оптимальную для начала изучения тему:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=8241">http://forum.script-coding.com/viewtopic.php?id=8241</a><br />На основе кода, написанным <strong>creature.ws</strong> решил понять как читать память нужного мне процесса, заранее зная нужное значение.<br /></p><div class="codebox"><pre><code>processName := &quot;имя процесса&quot;
readAddress := 0x2ECD0254

Numpad0::
    if ProcessReadMemory(readAddress, processName) &lt; 10
        Click 123 234
    return


ProcessReadMemory(address, processIDorName, type := &quot;Int&quot;, numBytes := 4) {
    VarSetCapacity(buf, numBytes, 0)

    Process Exist, %processIDorName%
    if !processID := ErrorLevel
        throw Exception(&quot;Invalid process name or process ID:`n`n&quot;&quot;&quot; . processIDorName . &quot;&quot;&quot;&quot;)

    if !processHandle := DllCall(&quot;OpenProcess&quot;, &quot;Int&quot;, 24, &quot;UInt&quot;, 0, &quot;UInt&quot;, processID, &quot;Ptr&quot;)
        throw Exception(&quot;Failed to open process.`n`nError code:`t&quot; . A_LastError)

    result := DllCall(&quot;ReadProcessMemory&quot;, &quot;Ptr&quot;, processHandle, &quot;Ptr&quot;, address, &quot;Ptr&quot;, &amp;buf, &quot;Ptr&quot;, numBytes, &quot;PtrP&quot;, numBytesRead, &quot;UInt&quot;)

    if !DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, processHandle, &quot;UInt&quot;) &amp;&amp; !result
        throw Exception(&quot;Failed to close process handle.`n`nError code:`t&quot; . A_LastError)

    if !result
        throw Exception(&quot;Failed to read process memory.`n`nError code:`t&quot; . A_LastError)

    if !numBytesRead
        throw Exception(&quot;Read 0 bytes from the`n`nprocess:`t&quot; . processIDorName . &quot;`naddress:`t&quot; . address)

    return (type = &quot;Str&quot;)
        ? StrGet(&amp;buf, numBytes)
        : NumGet(buf, type)
}</code></pre></div><p>Однако тут тоже не все шибко понятно, не смотря на то, что я прочитал статью Функции. Поэтому прошу кого-нибудь из опытных переписать данный код с комментариями на каждое действие, чтобы понять как, что, когда этот код делает.</p><p>Добавлено:<br />Наткнулся на удивительную вещь - <a href="https://github.com/Kalamity/SC2-MacroTrainer/blob/master/Lib/classMemory.ahk">https://github.com/Kalamity/SC2-MacroTr … Memory.ahk</a><br />Обновляется и по сей день. Вроде бы там есть тоже самое, что мне нужно, но пока не могу понять как это применить.</p>]]></content>
			<author>
				<name><![CDATA[Странникх]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30605</uri>
			</author>
			<updated>2014-08-24T22:05:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86097#p86097</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86012#p86012" />
			<content type="html"><![CDATA[<p>Если он от раза к разу не меняется, тогда поищите темы про чтение памяти другого процесса. Код для этого тут постили неоднократно.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2014-08-21T09:07:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86012#p86012</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86008#p86008" />
			<content type="html"><![CDATA[<p>Я нашел нужный указатель. Что теперь дальше? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[LeGoo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32469</uri>
			</author>
			<updated>2014-08-21T07:11:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86008#p86008</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=85998#p85998" />
			<content type="html"><![CDATA[<p>Попробуйте найти указатель на адрес с помощью Artmoney, и поищите на этом форуме тему (ключевое слово: указатель).</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2014-08-21T02:35:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=85998#p85998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Поиск в памяти процесса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=85994#p85994" />
			<content type="html"><![CDATA[<p>В общем есть процесс <strong>proc.exe</strong>, он использует <strong>programm.dll</strong>, мне нужно найти адрес значения &quot;<strong>Остальное: </strong>&quot;, который при каждом перезапуске программы меняется. Не могу сообразить, как найти сразу в AHK адрес текста в памяти и поместить его в переменную, ручками уже устал.</p><p>Начинать поиск нужно с <strong>0x019F2018</strong> по <strong>0x01A00000</strong>.<br />За ранее спасибо! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[LeGoo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32469</uri>
			</author>
			<updated>2014-08-20T18:02:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=85994#p85994</id>
		</entry>
</feed>
