winutil.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:flare-fakenet-ng 作者: fireeye 项目源码 文件源码
def get_pid_port_tcp(self, port):

        for item in self.get_extended_tcp_table():

            lPort = socket.ntohs(item.dwLocalPort)
            lAddr = socket.inet_ntoa(struct.pack('L', item.dwLocalAddr))
            pid   = item.dwOwningPid

            if lPort == port:
                return pid
        else:
            return None

    #################################################################################
    # The GetExtendedUdpTable function retrieves a table that contains a list of UDP endpoints available to the application.
    #
    # DWORD GetExtendedUdpTable(
    #   _Out_   PVOID           pUdpTable,
    #   _Inout_ PDWORD          pdwSize,
    #   _In_    BOOL            bOrder,
    #   _In_    ULONG           ulAf,
    #   _In_    UDP_TABLE_CLASS TableClass,
    #   _In_    ULONG           Reserved
    # );
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号