controller.py 文件源码

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

项目:fibratus 作者: rabbitstack 项目源码 文件源码
def __init__(self, buffer_size=1024):
        """Builds the tracing session properties.

        Parameters
        ---------

        buffer_size: int
            the amount of memory allocated for each trace buffer
        """

        # allocate buffer for the trace
        self.max_string_len = 1024
        self.buff_size = sizeof(EVENT_TRACE_PROPERTIES) + 2 * sizeof(c_wchar) * self.max_string_len

        self._buff = (c_char * self.buff_size)()
        self._props = cast(pointer(self._buff), POINTER(EVENT_TRACE_PROPERTIES))

        # set trace properties
        self._props.contents.wnode.buffer_size = self.buff_size
        self._props.contents.wnode.guid = KERNEL_TRACE_CONTROL_GUID
        self._props.contents.wnode.flags = WNODE_FLAG_TRACED_GUID
        self._props.contents.logger_name_offset = sizeof(EVENT_TRACE_PROPERTIES)
        self._props.contents.log_file_name_offset = 0
        self._props.contents.log_file_mode = PROCESS_TRACE_MODE_REAL_TIME
        self._props.contents.buffer_size = buffer_size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号