DLL命令表
.版本 2.DLL命令 GetCurrentProcessId, 整數(shù)型, "kernel32.dll", "GetCurrentProcessId".DLL命令 GetCurrentProcess, 整數(shù)型, "kernel32.dll", "GetCurrentProcess".DLL命令 RtlMoveMemory_SYSTEM_HANDLE_INFORMATION, , "kernel32.dll", "RtlMoveMemory" .參數(shù) Destination, SYSTEM_HANDLE_INFORMATION .參數(shù) Source, 整數(shù)型 .參數(shù) Length, 整數(shù)型.DLL命令 DuplicateHandle, 邏輯型, "kernel32.dll", "DuplicateHandle" .參數(shù) hSourceProcessHandle, 整數(shù)型 .參數(shù) hSourceHandle, 整數(shù)型 .參數(shù) hTargetProcessHandle, 整數(shù)型 .參數(shù) lpTargetHandle, 整數(shù)型, 傳址 .參數(shù) dwDesiredAccess, 整數(shù)型 .參數(shù) bInheritHandle, 邏輯型 .參數(shù) dwOptions, 整數(shù)型.DLL命令 OpenProcess, 整數(shù)型, "kernel32.dll", "OpenProcess" .參數(shù) dwDesiredAccess, 整數(shù)型 .參數(shù) bInheritHandle, 邏輯型 .參數(shù) dwProcessId, 整數(shù)型.DLL命令 CloseHandle, 邏輯型, "kernel32.dll", "CloseHandle" .參數(shù) hObject, 整數(shù)型.DLL命令 ZwQuerySystemInformation, 整數(shù)型, "ntdll.dll", "ZwQuerySystemInformation" .參數(shù) SystemInformationClass, 整數(shù)型 .參數(shù) SystemInformation, 字節(jié)集 .參數(shù) SystemInformationLength, 整數(shù)型 .參數(shù) ReturnLength, 整數(shù)型, 傳址.DLL命令 ZwQueryObject, 整數(shù)型, "ntdll.dll", "ZwQueryObject" .參數(shù) ObjectHandle, 整數(shù)型 .參數(shù) ObjectInformationClass, 整數(shù)型 .參數(shù) ObjectInformation, 字節(jié)集 .參數(shù) ObjectInformationLength, 整數(shù)型 .參數(shù) ReturnLength, 整數(shù)型, 傳址.DLL命令 ZwQueryObject_SYSTEM_HANDLE_STATE, 整數(shù)型, "ntdll.dll", "ZwQueryObject" .參數(shù) ObjectHandle, 整數(shù)型 .參數(shù) ObjectInformationClass, 整數(shù)型 .參數(shù) ObjectInformation, SYSTEM_HANDLE_STATE .參數(shù) ObjectInformationLength, 整數(shù)型 .參數(shù) ReturnLength, 整數(shù)型, 傳址.DLL命令 RtlUnicodeStringToAnsiString, 整數(shù)型, "ntdll.dll", "RtlUnicodeStringToAnsiString" .參數(shù) DestinationString, STRING .參數(shù) SourceString, 字節(jié)集 .參數(shù) AllocateDestinationString, 邏輯型.DLL命令 RtlFreeAnsiString, 整數(shù)型, "ntdll.dll", "RtlFreeAnsiString" .參數(shù) AnsiString, STRING
常量數(shù)據(jù)表
.版本 2.常量 sizeof_SYSTEM_HANDLE_INFORMATION, "16".常量 sizeof_SYSTEM_HANDLE_STATE, "56".常量 SystemHandleInformation, "16", , 0x10.常量 ObjectBasicInformation, "0".常量 ObjectNameInformation, "1".常量 ObjectTypeInformation, "2".常量 STATUS_INFO_LENGTH_MISMATCH, "-1073741820", , 0xC0000004L.常量 STATUS_INVALID_HANDLE, "-1073741816", , 0xC0000008L.常量 DUPLICATE_SAME_ACCESS, "2", , 0x00000002.常量 PROCESS_ALL_ACCESS, "2097151"
自定義數(shù)據(jù)類型表
.版本 2.數(shù)據(jù)類型 SYSTEM_HANDLE_INFORMATION .成員 ProcessId, 整數(shù)型 .成員 ObjectTypeNumber, 字節(jié)型 .成員 Flags, 字節(jié)型 .成員 Handle, 短整數(shù)型 .成員 Object, 整數(shù)型 .成員 GrantedAccess, 整數(shù)型.數(shù)據(jù)類型 STRING .成員 Length, 短整數(shù)型 .成員 MaximumLength, 短整數(shù)型 .成員 Buffer, 整數(shù)型.數(shù)據(jù)類型 SYSTEM_HANDLE_STATE .成員 r1, 整數(shù)型 .成員 GrantedAccess, 整數(shù)型 .成員 HandleCount, 整數(shù)型 .成員 ReferenceCount, 整數(shù)型 .成員 r5, 整數(shù)型 .成員 r6, 整數(shù)型 .成員 r7, 整數(shù)型 .成員 r8, 整數(shù)型 .成員 r9, 整數(shù)型 .成員 r10, 整數(shù)型 .成員 r11, 整數(shù)型 .成員 r12, 整數(shù)型 .成員 r13, 整數(shù)型 .成員 r14, 整數(shù)型
List
.版本 2.程序集 List.程序集變量 _data, 字節(jié)集.程序集變量 _size, 整數(shù)型.子程序 List, , 公開(kāi), 構(gòu)造函數(shù).參數(shù) data, 字節(jié)集.參數(shù) size, 整數(shù)型_data = data_size = size.子程序 Count, 整數(shù)型, 公開(kāi).局部變量 count, 整數(shù)型置入代碼 ({ 139, 69, 8, 139, 0, 139, 64, 4, 131, 192, 8, 139, 0, 201, 194, 4, 0 })返回 (0).子程序 GetItem, 整數(shù)型, 公開(kāi).參數(shù) index, 整數(shù)型, , 從0開(kāi)始置入代碼 ({ 139, 77, 8, 139, 9, 139, 65, 4, 139, 89, 8, 139, 85, 12, 131, 192, 12, 15, 175, 218, 1, 216, 201, 194, 8, 0 })返回 (0)
載入
.版本 2.程序集 程序集1.子程序 _啟動(dòng)子程序, 整數(shù)型載入 (窗口1, , 假)返回 (0)
枚舉進(jìn)程所有句柄信息的代碼
.版本 2.支持庫(kù) iext.程序集 窗口程序集_窗口1.程序集變量 cpid, 整數(shù)型.子程序 _窗口1_創(chuàng)建完畢cpid = GetCurrentProcessId ()進(jìn)程ID編輯框.內(nèi)容 = 到文本 (cpid).子程序 _查詢按鈕_被單擊.局部變量 pid, 整數(shù)型.局部變量 list, List.局部變量 i, 整數(shù)型.局部變量 info, SYSTEM_HANDLE_INFORMATION.局部變量 handle, 整數(shù)型.局部變量 hProcess, 整數(shù)型.局部變量 index, 整數(shù)型超級(jí)列表框.全部刪除 ()pid = 到整數(shù) (進(jìn)程ID編輯框.內(nèi)容)list = 獲取系統(tǒng)所有句柄信息 ().如果真 (pid ≠ cpid) hProcess = OpenProcess (#PROCESS_ALL_ACCESS, 假, pid).如果真結(jié)束.變量循環(huán)首 (0, list.Count () - 1, 1, i) RtlMoveMemory_SYSTEM_HANDLE_INFORMATION (info, list.GetItem (i), #sizeof_SYSTEM_HANDLE_INFORMATION) .如果真 (info.ProcessId = pid) .如果 (pid = cpid) handle = info.Handle .否則 DuplicateHandle (hProcess, info.Handle, GetCurrentProcess (), handle, #DUPLICATE_SAME_ACCESS, 假, #DUPLICATE_SAME_ACCESS) .如果結(jié)束 index = 超級(jí)列表框.插入表項(xiàng) (, 獲取句柄類型 (handle), , , , ) 超級(jí)列表框.置標(biāo)題 (index, 1, 獲取句柄名 (handle)) 超級(jí)列表框.置標(biāo)題 (index, 2, 到文本 (info.Handle)) 超級(jí)列表框.置標(biāo)題 (index, 3, 到文本 (info.Object)) 超級(jí)列表框.置標(biāo)題 (index, 4, 到文本 (info.ObjectTypeNumber)) 超級(jí)列表框.置標(biāo)題 (index, 5, 到文本 (獲取句柄引用數(shù) (handle))) .如果真 (pid ≠ cpid) CloseHandle (handle) .如果真結(jié)束 .如果真結(jié)束.變量循環(huán)尾 ().如果真 (hProcess ≠ 0) CloseHandle (hProcess).如果真結(jié)束.子程序 獲取系統(tǒng)所有句柄信息, List.局部變量 len, 整數(shù)型.局部變量 buffer, 字節(jié)集.局部變量 status, 整數(shù)型.局部變量 list, Listlen = 16534 ' 0x4096.循環(huán)判斷首 () buffer = 取空白字節(jié)集 (len) status = ZwQuerySystemInformation (#SystemHandleInformation, buffer, len, 0) .如果真 (status = #STATUS_INFO_LENGTH_MISMATCH) len = len + 16534 ' 0x4096 .如果真結(jié)束.循環(huán)判斷尾 (status = #STATUS_INFO_LENGTH_MISMATCH)list.List (buffer, #sizeof_SYSTEM_HANDLE_INFORMATION)返回 (list).子程序 獲取句柄名, 文本型.參數(shù) handle, 整數(shù)型.局部變量 size, 整數(shù)型.局部變量 unicode, 字節(jié)集.局部變量 ansi, STRING.局部變量 str, 文本型.如果 (ZwQueryObject (handle, #ObjectTypeInformation, unicode, 0, size) ≠ #STATUS_INVALID_HANDLE) unicode = 取空白字節(jié)集 (size) ZwQueryObject (handle, #ObjectNameInformation, unicode, size, 0) RtlUnicodeStringToAnsiString (ansi, unicode, 真) str = 指針到文本 (ansi.Buffer) RtlFreeAnsiString (ansi).否則 str = “無(wú)法獲取”.如果結(jié)束返回 (str).子程序 獲取句柄類型, 文本型.參數(shù) handle, 整數(shù)型.局部變量 size, 整數(shù)型.局部變量 unicode, 字節(jié)集.局部變量 ansi, STRING.局部變量 str, 文本型.如果 (ZwQueryObject (handle, #ObjectTypeInformation, unicode, 0, size) ≠ #STATUS_INVALID_HANDLE) unicode = 取空白字節(jié)集 (size) ZwQueryObject (handle, #ObjectTypeInformation, unicode, size, 0) RtlUnicodeStringToAnsiString (ansi, unicode, 真) str = 指針到文本 (ansi.Buffer) RtlFreeAnsiString (ansi).否則 str = “無(wú)法獲取”.如果結(jié)束返回 (str).子程序 獲取句柄引用數(shù), 整數(shù)型.參數(shù) handle, 整數(shù)型.局部變量 state, SYSTEM_HANDLE_STATEZwQueryObject_SYSTEM_HANDLE_STATE (handle, #ObjectBasicInformation, state, #sizeof_SYSTEM_HANDLE_STATE, 0)返回 (state.ReferenceCount - 1)
運(yùn)行結(jié)果:
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)VeVb武林網(wǎng)的支持。
新聞熱點(diǎn)
疑難解答
圖片精選