<?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>http://forum.script-coding.com/viewtopic.php?id=11739</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11739&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: список модулей процесса».]]></description>
		<lastBuildDate>Sun, 26 Jun 2016 13:37:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105567#p105567</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Нужно, чтобы все три компонента — скрипт, процесс и DLL — были 32-битными. У вас так?</p></blockquote></div><p>если у вас работает значит что-то у меня. Видимо что-то с длл. Во общем огромное спасибо)</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Sun, 26 Jun 2016 13:37:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105567#p105567</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105536#p105536</link>
			<description><![CDATA[<p>Нужно, чтобы все три компонента — скрипт, процесс и DLL — были 32-битными. У вас так?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 25 Jun 2016 03:00:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105536#p105536</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105529#p105529</link>
			<description><![CDATA[<p>Спасибо большое!<br />Почему-то функция не работает. <br />Положил скрипт и модуль в одну папку<br />Писал так<br /></p><div class="codebox"><pre><code>PsInjectDll(&quot;test.exe&quot;, &quot;test.dll&quot;)</code></pre></div><p>и так<br /></p><div class="codebox"><pre><code>PsInjectDll(test.exe, &quot;test.dll&quot;)</code></pre></div><p>и не инжектит.<br />Так же перемещал на диск D и прописывал полный путь вот так:<br /></p><div class="codebox"><pre><code>PsInjectDll(&quot;test.exe&quot;, &quot;D:\test.dll&quot;)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Fri, 24 Jun 2016 20:31:07 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105529#p105529</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105512#p105512</link>
			<description><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>Могли бы вы пожалуйста глянуть и сказать возможно ли оттуда вытащить или сделать на подобии что бы так же показывало все модули?</p></blockquote></div><p>Возможно, дело в этом:<br /></p><div class="quotebox"><blockquote><p>Process Hacker uses a kernel-mode driver, KProcessHacker, to assist with certain functionality.</p></blockquote></div><p>На АНК драйвера писать точно не вариант. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 24 Jun 2016 03:16:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105512#p105512</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105485#p105485</link>
			<description><![CDATA[<p>Логично, что продвинутый видит, на то он и продвинутый.</p><p>Попробовал перевести. На 32 битах работает, а на 64 целевой процесс вылетает с исключением. Видимо, это связано с тем, что адреса загрузки системных библиотек на 64 битах рандомизируются. Соответственно, адрес функции LoadLibrary, полученный в адресном пространстве скрипта, в целевом процессе указывает на какой-то случайный код, выполнение которого удалённым потоком и вызывает исключение.<br /></p><div class="codebox"><pre><code>
PsInjectDll(Process, DllName)   ; Process — PID или Name.exe.
{
    static AccessRights = 0x43A     ; PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION
    ; | PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION
    Process, Exist, %Process%
    If !(PID := ErrorLevel) {
        MsgBox, Процесс не найден: %Process%
        Return 0
    }
    If !FileExist(DllName) {
        MsgBox, DLL не найдена: %DllName%
        Return 0
    }
    hKernel32 := DllCall(&quot;GetModuleHandleW&quot;, &quot;wstr&quot;, &quot;Kernel32.dll&quot;, &quot;ptr&quot;)
    pLoadLibrary := DllCall(&quot;GetProcAddress&quot;, &quot;ptr&quot;, hKernel32, &quot;astr&quot;, &quot;LoadLibraryW&quot;, &quot;ptr&quot;)
    If !(hProcess := DllCall(&quot;OpenProcess&quot;, &quot;uint&quot;, AccessRights, &quot;int&quot;, 0, &quot;uint&quot;, PID, &quot;ptr&quot;)) {
        MsgBox, Ошибка OpenProcess: %A_LastError%
        Return 0
    }
    RetVal := 0
    cbDllName := (StrLen(DllName) + 1) * 2
    If !(pDllName := DllCall(&quot;VirtualAllocEx&quot;, &quot;ptr&quot;, hProcess
                                             , &quot;ptr&quot;, 0
                                             , &quot;ptr&quot;, cbDllName
                                             , &quot;uint&quot;, 0x3000   ; MEM_RESERVE | MEM_COMMIT
                                             , &quot;uint&quot;, 4        ; PAGE_READWRITE
                                             , &quot;ptr&quot;)) {
        MsgBox, Ошибка VirtualAllocEx: %A_LastError%
        Goto, Close
    }
    If !DllCall(&quot;WriteProcessMemory&quot;, &quot;ptr&quot;, hProcess
                                    , &quot;ptr&quot;, pDllName
                                    , &quot;wstr&quot;, DllName
                                    , &quot;ptr&quot;, cbDllName
                                    , &quot;ptr *&quot;, cbWritten) {
        MsgBox, Ошибка WriteProcessMemory: %A_LastError%
        Goto, Free
    }
    If !(hThread := DllCall(&quot;CreateRemoteThread&quot;, &quot;ptr&quot;, hProcess
                                                , &quot;ptr&quot;, 0
                                                , &quot;ptr&quot;, 0
                                                , &quot;ptr&quot;, pLoadLibrary
                                                , &quot;ptr&quot;, pDllName
                                                , &quot;uint&quot;, 0
                                                , &quot;ptr&quot;, 0
                                                , &quot;ptr&quot;)) {
        MsgBox, Ошибка CreateRemoteThread: %A_LastError%
        Goto, Free
    }
    DllCall(&quot;CloseHandle&quot;, &quot;ptr&quot;, hThread)
    RetVal := 1
    Goto, Close
Free:
    DllCall(&quot;VirtualFreeEx&quot;, &quot;ptr&quot;, hProcess, &quot;ptr&quot;, pDllName, &quot;ptr&quot;, 0, &quot;uint&quot;, 0x8000)
    ; 0x8000 = MEM_RELEASE
Close:
    DllCall(&quot;CloseHandle&quot;, &quot;ptr&quot;, hProcess)
    Return RetVal
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Thu, 23 Jun 2016 17:06:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105485#p105485</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105481#p105481</link>
			<description><![CDATA[<p>Если не сложно переведите функцию пожалуйста.<br />Просто странно что продвинутый диспетчер задач все видит.<br />Кстати есть программа процесс хакер она тоже может видеть модули и прочее. Она открыта.<br />Вот ее исходный код:<br /><a href="https://github.com/processhacker2/processhacker2">https://github.com/processhacker2/processhacker2</a><br />Могли бы вы пожалуйста глянуть и сказать возможно ли оттуда вытащить или сделать на подобии что бы так же показывало все модули?</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Thu, 23 Jun 2016 12:47:56 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105481#p105481</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105480#p105480</link>
			<description><![CDATA[<p>Перевести код на АНК? Можно, конечно. Да, если упорно не видится только одна DLL, то причина в ней должна быть. По логике. Может, есть способ как-то замаскировать присутствие DLL в процессе, и она при загрузке это делает. А может, в чём другом дело.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Thu, 23 Jun 2016 11:42:03 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105480#p105480</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105462#p105462</link>
			<description><![CDATA[<p>Помню у меня был рабочий инжектор на autoit. Вот нашел его. В конце функция инжекта:<br /></p><div class="codebox"><pre><code>#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n

#RequireAdmin
#include &lt;GUIConstants.au3&gt;

GUICreate(&quot;Beispiel&quot;, 275, 100)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel(&quot;Prozess:&quot;, 10, 10, 50, 17)
$I_ProcessName = GUICtrlCreateInput(&quot;&quot;, 65, 10, 200, 21)
GUICtrlCreateLabel(&quot;DLL:&quot;, 10, 40, 50, 17)
$I_DllPath = GUICtrlCreateInput(&quot;&quot;, 65, 40, 150, 21)
$B_SearchDll = GUICtrlCreateButton(&quot;...&quot;, 225, 40, 40, 25)
$R_Auto = GUICtrlCreateRadio(&quot;Automatisch&quot;, 10, 75, 75, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$R_Man = GUICtrlCreateRadio(&quot;Manuell&quot;, 130, 75, 55, 17)
$B_Inject = GUICtrlCreateButton(&quot;Injizieren&quot;, 190, 70, 75, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()

$Injected = False

Do
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $B_SearchDll
            GUICtrlSetData($I_DllPath, FileOpenDialog(&quot;Dll&quot;, @HomeDrive, &quot;Dynamic Link Library (*.dll)&quot;, 3))
        Case $R_Auto
            GUICtrlSetState($B_Inject, $GUI_DISABLE)
        Case $R_Man
            GUICtrlSetState($B_Inject, $GUI_ENABLE)
        Case $B_Inject
            _InjectDll(ProcessExists(GUICtrlRead($I_ProcessName)), GUICtrlRead($I_DllPath))
            _Message(@error)
    EndSwitch

    If BitAND(GUICtrlRead($R_Auto), $GUI_CHECKED) And Not $Injected Then
        $ProcessId = ProcessExists(GUICtrlRead($I_ProcessName))
        If $ProcessId &gt; 0 Then
            _InjectDll($ProcessId, GUICtrlRead($I_DllPath))
            _Message(@error)
            $Injected = True
            ;Exit
        EndIf
    EndIf

    Sleep(10)
Until $Msg == $GUI_EVENT_CLOSE



Func _Message($ErrorCode)
    If $ErrorCode &lt;&gt; 0 Then
        MsgBox(48, &quot;Fehler&quot;, &quot;Es ist ein Fehler aufgetreten!&quot; &amp; @CRLF &amp; &quot;Fehlercode: &quot; &amp; @error)
    Else
        MsgBox(64, &quot;Info&quot;, &quot;Injektion erfolgreich!&quot;)
    EndIf
EndFunc


;=================================================================================================
; Function:            _InjectDll($ProcessId, $DllPath)
; Description:        Injects a .dll into a running program.
; Return Value(s):    On Success - Returns true
;                    On Failure - Returns false
;                    @Error - 0 = No error.
;                             1 = Invalid ProcessId.
;                             2 = File does not exist.
;                             3 = File is not a .dll (invalid file).
;                             4 = Failed to open &#039;Advapi32.dll&#039;.
;                             5 = Failed to get the full path.
;                             6 = Failed to open the process.
;                             7 = Failed to call &#039;GetModuleHandle&#039;.
;                             8 = Failed to call &#039;GetProcAddress&#039;.
;                             9 = Failed to call &#039;VirtualAllocEx&#039;.
;                             10 = Failed to write the memory.
;                             11 = Failed to create the &#039;RemoteThread&#039;.
; Author(s):        KillerDeluxe
;=================================================================================================

Func _InjectDll($ProcessId, $DllPath)
    If $ProcessId == 0 Then Return SetError(1, &quot;&quot;, False)
    If Not(FileExists($DllPath)) Then Return SetError(2, &quot;&quot;, False)
    If Not(StringRight($DllPath, 4) == &quot;.dll&quot;) Then Return SetError(3, &quot;&quot;, False)

    $Kernel32 = DllOpen(&quot;kernel32.dll&quot;)
    If @error Then Return SetError(4, &quot;&quot;, False)

    $DLL_Path = DllStructCreate(&quot;char[255]&quot;)
    DllCall($Kernel32, &quot;DWORD&quot;, &quot;GetFullPathNameA&quot;, &quot;str&quot;, $DllPath, &quot;DWORD&quot;, 255, &quot;ptr&quot;, DllStructGetPtr($DLL_Path), &quot;int&quot;, 0)
    If @error Then Return SetError(5, &quot;&quot;, False)

    $hProcess = DllCall($Kernel32, &quot;DWORD&quot;, &quot;OpenProcess&quot;, &quot;DWORD&quot;, 0x1F0FFF, &quot;int&quot;, 0, &quot;DWORD&quot;, $ProcessId)
    If @error Then Return SetError(6, &quot;&quot;, False)

    $hModule = DllCall($Kernel32, &quot;DWORD&quot;, &quot;GetModuleHandleA&quot;, &quot;str&quot;, &quot;kernel32.dll&quot;)
    If @error Then Return SetError(7, &quot;&quot;, False)

    $lpStartAddress = DllCall($Kernel32, &quot;DWORD&quot;, &quot;GetProcAddress&quot;, &quot;DWORD&quot;, $hModule[0], &quot;str&quot;, &quot;LoadLibraryA&quot;)
    If @error Then Return SetError(8, &quot;&quot;, False)

    $lpParameter = DllCall($Kernel32, &quot;DWORD&quot;, &quot;VirtualAllocEx&quot;, &quot;int&quot;, $hProcess[0], &quot;int&quot;, 0, &quot;ULONG_PTR&quot;, DllStructGetSize($DLL_Path), &quot;DWORD&quot;, 0x3000, &quot;int&quot;, 4)
    If @error Then Return SetError(9, &quot;&quot;, False)

    DllCall(&quot;kernel32.dll&quot;, &quot;BOOL&quot;, &quot;WriteProcessMemory&quot;, &quot;int&quot;, $hProcess[0], &quot;DWORD&quot;, $lpParameter[0], &quot;str&quot;, DllStructGetData($DLL_Path, 1), &quot;ULONG_PTR&quot;, DllStructGetSize($DLL_Path), &quot;int&quot;, 0)
    If @error Then Return SetError(10, &quot;&quot;, False)

    $hThread = DllCall($Kernel32, &quot;int&quot;, &quot;CreateRemoteThread&quot;, &quot;DWORD&quot;, $hProcess[0], &quot;int&quot;, 0, &quot;int&quot;, 0, &quot;DWORD&quot;, $lpStartAddress[0], &quot;DWORD&quot;, $lpParameter[0], &quot;int&quot;, 0, &quot;int&quot;, 0)
    If @error Then Return SetError(11, &quot;&quot;, False)

    DllCall($Kernel32, &quot;BOOL&quot;, &quot;CloseHandle&quot;, &quot;DWORD&quot;, $hProcess[0])
    DllClose($Kernel32)

    Return SetError(0, &quot;&quot;, True)
EndFunc</code></pre></div><p>Проверил и тот же самый результат. Видит два модуля из трех. По моему в этом случаю тут зависит от самого модуля.<br />Кстати возможно ли создать подобное для AHK?</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Wed, 22 Jun 2016 16:40:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105462#p105462</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105455#p105455</link>
			<description><![CDATA[<p>Поскольку использованный вами метод инжектирования мне неизвестен, то и воспроизвести его у себя я не могу, а без этого никаких идей у меня нет.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Wed, 22 Jun 2016 13:16:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105455#p105455</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105454#p105454</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>А как смотрели? Если список модулей большой и вы его смотрите в MsgBox, то конец списка может ею отрезаться. Попробуйте его помещать в буфер обмена и потом вставлять в текстовый редактор.</p></blockquote></div><p>я сразу в текстовый редактор помещал.</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Wed, 22 Jun 2016 12:12:15 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105454#p105454</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105443#p105443</link>
			<description><![CDATA[<p>А как смотрели? Если список модулей большой и вы его смотрите в MsgBox, то конец списка может ею отрезаться. Попробуйте его помещать в буфер обмена и потом вставлять в текстовый редактор.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Wed, 22 Jun 2016 02:59:14 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105443#p105443</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105440#p105440</link>
			<description><![CDATA[<p>Взял 3 разных длл(например назовем их &quot;а&quot;, &quot;б&quot; и &quot;в&quot;). Инжектил 3-мя инжекторами. Два инжектора взяты из интернета, третий использовал в 4иt инжiн. И каждый раз видело только два модуля(например &quot;а&quot; и &quot;б&quot;), а 3тий модуль не видело(модуль &quot;в&quot;).<br />Продвинутый диспетчер задач &quot;Process explorer&quot; все модули видел.</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 21 Jun 2016 23:31:16 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105440#p105440</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105424#p105424</link>
			<description><![CDATA[<p>Не знаю, это надо смотреть. А как вы её инжектите?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Tue, 21 Jun 2016 15:44:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105424#p105424</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105423#p105423</link>
			<description><![CDATA[<p>Скажите пожалуйста почему если я инжектю длл скрипт не&nbsp; видит этот модуль в процессе? Притом если я использую продвинутый диспетчер задач то он видит этот модуль.</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 21 Jun 2016 15:37:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105423#p105423</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: список модулей процесса]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=105387#p105387</link>
			<description><![CDATA[<p>Спасибо огромное за два метода!</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Sun, 19 Jun 2016 19:51:26 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=105387#p105387</guid>
		</item>
	</channel>
</rss>
