Exemplo n.º 1
0
    def render_text(self, outfd, data):
        common.set_plugin_members(self)

        self.table_header(outfd, [
            ("PID", "8"),
            ("Name", "16"),
            ("Start Address", "[addrpad]"),
            ("Mapping", "40"),
            ("Name", "40"),
            ("Status", ""),
        ])

        (kstart, kend, kmods) = common.get_kernel_addrs_start_end(self)

        for proc in data:
            for thread in proc.threads():
                start = thread.continuation
                if start == 0:
                    continue

                (good, mapping) = common.is_in_kernel_or_module(
                    start, kstart, kend, kmods)
                if not good:
                    mapping = "UNKNOWN"
                    for map in proc.get_proc_maps():
                        if map.links.start <= start <= map.links.end:
                            mapping = map.get_path()
                            if mapping == "":
                                mapping = map.get_special_path()
                            good = 1
                            start = map.links.start

                status = "UNKNOWN"
                if good:
                    status = "OK"

                name = ""
                if thread.uthread:
                    name_buf = self.addr_space.read(
                        thread.uthread.dereference_as("uthread").pth_name, 256)
                    if name_buf:
                        idx = name_buf.find("\x00")
                        if idx != -1:
                            name_buf = name_buf[:idx]

                        name = name_buf

                self.table_row(outfd, proc.p_pid, proc.p_comm, start, mapping,
                               name, status)
Exemplo n.º 2
0
    def render_text(self, outfd, data):
        common.set_plugin_members(self)

        self.table_header(outfd, [("PID","8"),
                                  ("Name", "16"),
                                  ("Start Address", "[addrpad]"),
                                  ("Mapping", "40"),
                                  ("Name", "40"),
                                  ("Status", ""),
                                 ])
 
        (kstart, kend, kmods) = common.get_kernel_addrs_start_end(self)
        
        for proc in data:
            for thread in proc.threads():
                start = thread.continuation

                if start == 0:
                    continue

                (good, mapping) = common.is_in_kernel_or_module(start, kstart, kend, kmods)

                if not good:
                    mapping = "UNKNOWN"
                    for map in proc.get_proc_maps():
                        if map.links.start <= start <= map.links.end:
                            mapping = map.get_path()
                            if mapping == "":
                                mapping = map.get_special_path()
                       
                            good  = 1 
                            start = map.links.start
 
                if good:
                    status = "OK"
                else:
                    status = "UNKNOWN"

                name = ""
                if thread.uthread:
                    name_buf = self.addr_space.read(thread.uthread.dereference_as("uthread").pth_name, 256)
                    if name_buf:
                        idx = name_buf.find("\x00")
                        if idx != -1:
                            name_buf = name_buf[:idx]
                        
                        name = name_buf

                self.table_row(outfd, proc.p_pid, proc.p_comm, start, mapping, name, status)
Exemplo n.º 3
0
    def generator(self, data):
        (kstart, kend, kmods) = common.get_kernel_addrs_start_end(self)

        for proc in data:
            for thread in proc.threads():
                start = thread.continuation

                if start == 0:
                    continue

                (good, mapping) = common.is_in_kernel_or_module(
                    start, kstart, kend, kmods)

                if not good:
                    mapping = "UNKNOWN"
                    for map in proc.get_proc_maps():
                        if map.links.start <= start <= map.links.end:
                            mapping = map.get_path()
                            if mapping == "":
                                mapping = map.get_special_path()

                            good = 1
                            start = map.links.start

                if good:
                    status = "OK"
                else:
                    status = "UNKNOWN"

                name = ""
                if thread.uthread:
                    name_buf = self.addr_space.read(
                        thread.uthread.dereference_as("uthread").pth_name, 256)
                    if name_buf:
                        idx = name_buf.find("\x00")
                        if idx != -1:
                            name_buf = name_buf[:idx]

                        name = name_buf

                yield (0, [
                    int(proc.p_pid),
                    str(proc.p_comm),
                    Address(start),
                    str(mapping),
                    str(name),
                    str(status),
                ])
Exemplo n.º 4
0
    def generator(self, data):
        (kstart, kend, kmods) = common.get_kernel_addrs_start_end(self)
        
        for proc in data:
            for thread in proc.threads():
                start = thread.continuation

                if start == 0:
                    continue

                (good, mapping) = common.is_in_kernel_or_module(start, kstart, kend, kmods)

                if not good:
                    mapping = "UNKNOWN"
                    for map in proc.get_proc_maps():
                        if map.links.start <= start <= map.links.end:
                            mapping = map.get_path()
                            if mapping == "":
                                mapping = map.get_special_path()
                       
                            good  = 1 
                            start = map.links.start
 
                if good:
                    status = "OK"
                else:
                    status = "UNKNOWN"

                name = ""
                if thread.uthread:
                    name_buf = self.addr_space.read(thread.uthread.dereference_as("uthread").pth_name, 256)
                    if name_buf:
                        idx = name_buf.find("\x00")
                        if idx != -1:
                            name_buf = name_buf[:idx]
                        
                        name = name_buf

                yield(0, [
                    int(proc.p_pid),
                    str(proc.p_comm),
                    Address(start),
                    str(mapping),
                    str(name),
                    str(status),
                    ])