index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,029 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/requests/cookies.py | 120,121 | 103,124 | getheaders | MockResponse | 121,124 | 121,124 | class MockResponse:
"""Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.
...what? Basically, expose the parsed HTTP headers from the server response
the way `cookielib` expects to see them.
"""
def __init__(self, headers):
"""Make a MockResponse for `cookielib` to read.
... | class MockResponse:
"""Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.
...what? Basically, expose the parsed HTTP headers from the server response
the way `cookielib` expects to see them.
"""
def __init__(self, headers):
"""Make a MockResponse for `cookielib` to read.
... | self._headers.getheaders(name)
| self._headers.getheaders(name)
| 1 | 160 | 16 | 176 | """
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import calendar
import copy
import time
from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, cookieli... | """
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import calendar
import copy
import time
from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, cookieli... |
36,031 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/requests/hooks.py | 15,16 | 1,34 | default_hooks | 16,22 | 16,22 | """
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
FILL_FUNC_BODYdef dispatch_hook(key, hooks, hook_data, **kwargs):
"""Dispatches a hook d... | """
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
FILL_FUNC_BODYdef dispatch_hook(key, hooks, hook_data, **kwargs):
"""Dispatches a hook d... | return {event: [] for event in HOOKS}
# TODO: response is the only one
| return {event: [] for event in HOOKS}
# TODO: response is the only one
| 14 | 213 | 34 | 247 | """
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
FILL_FUNC_BODYdef dispatch_hook(key, hooks, hook_data, **kwargs):
"""Dispatches a hook d... | """
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
FILL_FUNC_BODYdef dispatch_hook(key, hooks, hook_data, **kwargs):
"""Dispatches a hook d... | |
36,032 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/requests/status_codes.py | 109,110 | 1,129 | _init | 110,128 | 110,128 | r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
... | r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
... | for code, titles in _codes.items():
for title in titles:
setattr(codes, title, code)
if not title.startswith(("\\", "/")):
setattr(codes, title.upper(), code)
def doc(code):
names = ", ".join(f"``{n}``" for n in _codes[code])
return "* %d: %s" % (... | for code, titles in _codes.items():
for title in titles:
setattr(codes, title, code)
if not title.startswith(("\\", "/")):
setattr(codes, title.upper(), code)
def doc(code):
names = ", ".join(f"``{n}``" for n in _codes[code])
return "* %d: %s" % (... | 58 | 1,428 | 189 | 1,617 | r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
... | r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
... | |
36,033 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/requests/structures.py | 63,64 | 13,83 | lower_items | CaseInsensitiveDict | 65,67 | 64,67 | class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``MutableMapping`` as well as dict's ``copy``. Also
provides ``lower_items``.
All keys are expected to be strings. The structure remembers the
case of the last key to... | class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``MutableMapping`` as well as dict's ``copy``. Also
provides ``lower_items``.
All keys are expected to be strings. The structure remembers the
case of the last key to... | return ((lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items())
| """Like iteritems(), but with all lowercase keys."""
return ((lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items())
| 8 | 649 | 30 | 679 | """
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutable... | """
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutable... |
36,034 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/requests/structures.py | 98,99 | 83,100 | get | LookupDict | 99,100 | 99,100 | class LookupDict(dict):
"""Dictionary lookup object."""
def __init__(self, name=None):
self.name = name
super().__init__()
def __repr__(self):
return f"<lookup '{self.name}'>"
def __getitem__(self, key):
# We allow fall-through here, so values default to None
... | class LookupDict(dict):
"""Dictionary lookup object."""
def __init__(self, name=None):
self.name = name
super().__init__()
def __repr__(self):
return f"<lookup '{self.name}'>"
def __getitem__(self, key):
# We allow fall-through here, so values default to None
... | return self.__dict__.get(key, default)
| return self.__dict__.get(key, default)
| 3 | 136 | 15 | 151 | """
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutable... | """
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutable... |
36,035 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/_monitor.py | 53,54 | 15,96 | run | TMonitor | 54,94 | 54,94 | class TMonitor(Thread):
"""
Monitoring thread for tqdm bars.
Monitors if tqdm bars are taking too much time to display
and readjusts miniters automatically if necessary.
Parameters
----------
tqdm_cls : class
tqdm class to use (can be core tqdm or a submodule).
sleep_interval ... | class TMonitor(Thread):
"""
Monitoring thread for tqdm bars.
Monitors if tqdm bars are taking too much time to display
and readjusts miniters automatically if necessary.
Parameters
----------
tqdm_cls : class
tqdm class to use (can be core tqdm or a submodule).
sleep_interval ... | cur_t = self._time()
while True:
# After processing and before sleeping, notify that we woke
# Need to be done just before sleeping
self.woken = cur_t
# Sleep some time...
self.was_killed.wait(self.sleep_interval)
# Quit if killed
... | cur_t = self._time()
while True:
# After processing and before sleeping, notify that we woke
# Need to be done just before sleeping
self.woken = cur_t
# Sleep some time...
self.was_killed.wait(self.sleep_interval)
# Quit if killed
... | 170 | 425 | 476 | 901 | import atexit
from threading import Event, Thread, current_thread
from time import time
from warnings import warn
__all__ = ["TMonitor", "TqdmSynchronisationWarning"]
class TqdmSynchronisationWarning(RuntimeWarning):
"""tqdm multi-thread/-process errors which may cause incorrect nesting
but otherwise no adve... | import atexit
from threading import Event, Thread, current_thread
from time import time
from warnings import warn
__all__ = ["TMonitor", "TqdmSynchronisationWarning"]
class TqdmSynchronisationWarning(RuntimeWarning):
"""tqdm multi-thread/-process errors which may cause incorrect nesting
but otherwise no adve... |
36,036 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/_tqdm_pandas.py | 7,8 | 1,25 | tqdm_pandas | 12,25 | 8,25 | import sys
__author__ = "github.com/casperdcl"
__all__ = ['tqdm_pandas']
def tqdm_pandas(tclass, **tqdm_kwargs):
FILL_FUNC_BODY | import sys
__author__ = "github.com/casperdcl"
__all__ = ['tqdm_pandas']
def tqdm_pandas(tclass, **tqdm_kwargs):
"""
Registers the given `tqdm` instance with
`pandas.core.groupby.DataFrameGroupBy.progress_apply`.
"""
FILL_FUNC_BODY | from tqdm import TqdmDeprecationWarning
if isinstance(tclass, type) or (getattr(tclass, '__name__', '').startswith(
'tqdm_')): # delayed adapter case
TqdmDeprecationWarning(
"Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm, ...)`.",
fp_write=getattr(tqdm_... | """
Registers the given `tqdm` instance with
`pandas.core.groupby.DataFrameGroupBy.progress_apply`.
"""
from tqdm import TqdmDeprecationWarning
if isinstance(tclass, type) or (getattr(tclass, '__name__', '').startswith(
'tqdm_')): # delayed adapter case
TqdmDeprecationWarni... | 41 | 106 | 257 | 363 | import sys
__author__ = "github.com/casperdcl"
__all__ = ['tqdm_pandas']
def tqdm_pandas(tclass, **tqdm_kwargs):
FILL_FUNC_BODY | import sys
__author__ = "github.com/casperdcl"
__all__ = ['tqdm_pandas']
def tqdm_pandas(tclass, **tqdm_kwargs):
"""
Registers the given `tqdm` instance with
`pandas.core.groupby.DataFrameGroupBy.progress_apply`.
"""
FILL_FUNC_BODY | |
36,037 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/auto.py | 33,34 | 1,41 | trange | 37,40 | 34,40 | """
Enables multiple commonly used features.
Method resolution order:
- `tqdm.autonotebook` without import warnings
- `tqdm.asyncio`
- `tqdm.std` base class
Usage:
>>> from tqdm.auto import trange, tqdm
>>> for i in trange(10):
... ...
"""
import warnings
from .std import TqdmExperimentalWarning
with warnings.... | """
Enables multiple commonly used features.
Method resolution order:
- `tqdm.autonotebook` without import warnings
- `tqdm.asyncio`
- `tqdm.std` base class
Usage:
>>> from tqdm.auto import trange, tqdm
>>> for i in trange(10):
... ...
"""
import warnings
from .std import TqdmExperimentalWarning
with warnings.... | return tqdm(range(*args), **kwargs)
| """
A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`.
"""
return tqdm(range(*args), **kwargs)
| 3 | 318 | 19 | 337 | """
Enables multiple commonly used features.
Method resolution order:
- `tqdm.autonotebook` without import warnings
- `tqdm.asyncio`
- `tqdm.std` base class
Usage:
>>> from tqdm.auto import trange, tqdm
>>> for i in trange(10):
... ...
"""
import warnings
from .std import TqdmExperimentalWarning
with warnings.... | """
Enables multiple commonly used features.
Method resolution order:
- `tqdm.autonotebook` without import warnings
- `tqdm.asyncio`
- `tqdm.std` base class
Usage:
>>> from tqdm.auto import trange, tqdm
>>> for i in trange(10):
... ...
"""
import warnings
from .std import TqdmExperimentalWarning
with warnings.... | |
36,039 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/cli.py | 269,271 | 268,274 | write | stdout | 271,274 | 271,274 | class stdout(object): # pylint: disable=function-redefined
@staticmethod
def write(x):
FILL_FUNC_BODY | class stdout(object): # pylint: disable=function-redefined
@staticmethod
def write(x):
FILL_FUNC_BODY | with tqdm.external_write_mode(file=fp):
fp_write(x)
stdout_write(x)
| with tqdm.external_write_mode(file=fp):
fp_write(x)
stdout_write(x)
| 4 | 43 | 38 | 81 | """
Module version for monitoring CLI pipes (`... | python -m tqdm | ...`).
"""
import logging
import re
import sys
from ast import literal_eval as numeric
from .std import TqdmKeyError, TqdmTypeError, tqdm
from .version import __version__
__all__ = ["main"]
log = logging.getLogger(__name__)
def cast(val, typ):
... | """
Module version for monitoring CLI pipes (`... | python -m tqdm | ...`).
"""
import logging
import re
import sys
from ast import literal_eval as numeric
from .std import TqdmKeyError, TqdmTypeError, tqdm
from .version import __version__
__all__ = ["main"]
log = logging.getLogger(__name__)
def cast(val, typ):
... |
36,040 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/contrib/concurrent.py | 29,30 | 1,106 | _executor_map | 40,54 | 30,54 | """
Thin wrappers around `concurrent.futures`.
"""
from contextlib import contextmanager
from operator import length_hint
from os import cpu_count
from ..auto import tqdm as tqdm_auto
from ..std import TqdmWarning
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['thread_map', 'process_map']
@contextmanager
de... | """
Thin wrappers around `concurrent.futures`.
"""
from contextlib import contextmanager
from operator import length_hint
from os import cpu_count
from ..auto import tqdm as tqdm_auto
from ..std import TqdmWarning
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['thread_map', 'process_map']
@contextmanager
de... | kwargs = tqdm_kwargs.copy()
if "total" not in kwargs:
kwargs["total"] = length_hint(iterables[0])
tqdm_class = kwargs.pop("tqdm_class", tqdm_auto)
max_workers = kwargs.pop("max_workers", min(32, cpu_count() + 4))
chunksize = kwargs.pop("chunksize", 1)
lock_name = kwargs.pop("lock_name", ... | """
Implementation of `thread_map` and `process_map`.
Parameters
----------
tqdm_class : [default: tqdm.auto.tqdm].
max_workers : [default: min(32, cpu_count() + 4)].
chunksize : [default: 1].
lock_name : [default: "":str].
"""
kwargs = tqdm_kwargs.copy()
if "total" not ... | 56 | 1,121 | 270 | 1,391 | """
Thin wrappers around `concurrent.futures`.
"""
from contextlib import contextmanager
from operator import length_hint
from os import cpu_count
from ..auto import tqdm as tqdm_auto
from ..std import TqdmWarning
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['thread_map', 'process_map']
@contextmanager
de... | """
Thin wrappers around `concurrent.futures`.
"""
from contextlib import contextmanager
from operator import length_hint
from os import cpu_count
from ..auto import tqdm as tqdm_auto
from ..std import TqdmWarning
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['thread_map', 'process_map']
@contextmanager
de... | |
36,041 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/contrib/itertools.py | 12,13 | 1,36 | product | 20,36 | 13,36 | """
Thin wrappers around `itertools`.
"""
import itertools
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['product']
def product(*iterables, **tqdm_kwargs):
FILL_FUNC_BODY | """
Thin wrappers around `itertools`.
"""
import itertools
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['product']
def product(*iterables, **tqdm_kwargs):
"""
Equivalent of `itertools.product`.
Parameters
----------
tqdm_class : [default: tqdm.aut... | kwargs = tqdm_kwargs.copy()
tqdm_class = kwargs.pop("tqdm_class", tqdm_auto)
try:
lens = list(map(len, iterables))
except TypeError:
total = None
else:
total = 1
for i in lens:
total *= i
kwargs.setdefault("total", total)
with tqdm_class(**kwar... | """
Equivalent of `itertools.product`.
Parameters
----------
tqdm_class : [default: tqdm.auto.tqdm].
"""
kwargs = tqdm_kwargs.copy()
tqdm_class = kwargs.pop("tqdm_class", tqdm_auto)
try:
lens = list(map(len, iterables))
except TypeError:
total = None
else:
... | 44 | 137 | 163 | 300 | """
Thin wrappers around `itertools`.
"""
import itertools
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['product']
def product(*iterables, **tqdm_kwargs):
FILL_FUNC_BODY | """
Thin wrappers around `itertools`.
"""
import itertools
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['product']
def product(*iterables, **tqdm_kwargs):
"""
Equivalent of `itertools.product`.
Parameters
----------
tqdm_class : [default: tqdm.aut... | |
36,042 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/contrib/logging.py | 46,51 | 1,127 | logging_redirect_tqdm | 51,99 | 51,99 | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... | # type: (...) -> Iterator[None]
"""
Context manager redirecting console logging to `tqdm.write()`, leaving
other logging handlers (e.g. log files) unaffected.
Parameters
----------
loggers : list, optional
Which handlers to redirect (default: [logging.root]).
tqdm_class : option... | # type: (...) -> Iterator[None]
"""
Context manager redirecting console logging to `tqdm.write()`, leaving
other logging handlers (e.g. log files) unaffected.
Parameters
----------
loggers : list, optional
Which handlers to redirect (default: [logging.root]).
tqdm_class : option... | 135 | 774 | 511 | 1,285 | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... | |
36,043 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/contrib/logging.py | 24,25 | 16,35 | emit | _TqdmLoggingHandler | 25,35 | 25,35 | class _TqdmLoggingHandler(logging.StreamHandler):
def __init__(
self,
tqdm_class=std_tqdm # type: Type[std_tqdm]
):
super(_TqdmLoggingHandler, self).__init__()
self.tqdm_class = tqdm_class
def emit(self, record):
FILL_FUNC_BODY | class _TqdmLoggingHandler(logging.StreamHandler):
def __init__(
self,
tqdm_class=std_tqdm # type: Type[std_tqdm]
):
super(_TqdmLoggingHandler, self).__init__()
self.tqdm_class = tqdm_class
def emit(self, record):
FILL_FUNC_BODY | try:
msg = self.format(record)
self.tqdm_class.write(msg, file=self.stream)
self.flush()
except (KeyboardInterrupt, SystemExit):
raise
except: # noqa pylint: disable=bare-except
self.handleError(record)
| try:
msg = self.format(record)
self.tqdm_class.write(msg, file=self.stream)
self.flush()
except (KeyboardInterrupt, SystemExit):
raise
except: # noqa pylint: disable=bare-except
self.handleError(record)
| 17 | 106 | 95 | 201 | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... | """
Helper functionality for interoperability with stdlib `logging`.
"""
import logging
import sys
from contextlib import contextmanager
try:
from typing import Iterator, List, Optional, Type # pylint: disable=unused-import
except ImportError:
pass
from ..std import tqdm as std_tqdm
class _TqdmLoggingHandl... |
36,044 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/contrib/utils_worker.py | 22,23 | 13,39 | submit | MonoWorker | 24,39 | 23,39 | class MonoWorker(object):
"""
Supports one running task and one waiting task.
The waiting task is the most recent submitted (others are discarded).
"""
def __init__(self):
self.pool = ThreadPoolExecutor(max_workers=1)
self.futures = deque([], 2)
def submit(self, func, *args, **k... | class MonoWorker(object):
"""
Supports one running task and one waiting task.
The waiting task is the most recent submitted (others are discarded).
"""
def __init__(self):
self.pool = ThreadPoolExecutor(max_workers=1)
self.futures = deque([], 2)
def submit(self, func, *args, **k... | futures = self.futures
if len(futures) == futures.maxlen:
running = futures.popleft()
if not running.done():
if len(futures): # clear waiting
waiting = futures.pop()
waiting.cancel()
futures.appendleft(runni... | """`func(*args, **kwargs)` may replace currently waiting task."""
futures = self.futures
if len(futures) == futures.maxlen:
running = futures.popleft()
if not running.done():
if len(futures): # clear waiting
waiting = futures.pop()
... | 41 | 127 | 165 | 292 | """
IO/concurrency helpers for `tqdm.contrib`.
"""
from collections import deque
from concurrent.futures import ThreadPoolExecutor
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['MonoWorker']
class MonoWorker(object):
"""
Supports one running task and one waiting... | """
IO/concurrency helpers for `tqdm.contrib`.
"""
from collections import deque
from concurrent.futures import ThreadPoolExecutor
from ..auto import tqdm as tqdm_auto
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['MonoWorker']
class MonoWorker(object):
"""
Supports one running task and one waiting... |
36,045 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/keras.py | 73,74 | 17,123 | on_epoch_begin | TqdmCallback | 74,96 | 74,96 | class TqdmCallback(keras.callbacks.Callback):
"""Keras callback for epoch and batch progress."""
@staticmethod
def bar2callback(bar, pop=None, delta=(lambda logs: 1)):
def callback(_, logs=None):
n = delta(logs)
if logs:
if pop:
logs = copy... | class TqdmCallback(keras.callbacks.Callback):
"""Keras callback for epoch and batch progress."""
@staticmethod
def bar2callback(bar, pop=None, delta=(lambda logs: 1)):
def callback(_, logs=None):
n = delta(logs)
if logs:
if pop:
logs = copy... | if self.epoch_bar.n < epoch:
ebar = self.epoch_bar
ebar.n = ebar.last_print_n = ebar.initial = epoch
if self.verbose:
params = self.params.get
total = params('samples', params(
'nb_sample', params('steps', None))) or self.batches
... | if self.epoch_bar.n < epoch:
ebar = self.epoch_bar
ebar.n = ebar.last_print_n = ebar.initial = epoch
if self.verbose:
params = self.params.get
total = params('samples', params(
'nb_sample', params('steps', None))) or self.batches
... | 75 | 948 | 317 | 1,265 | from copy import copy
from functools import partial
from .auto import tqdm as tqdm_auto
try:
import keras
except (ImportError, AttributeError) as e:
try:
from tensorflow import keras
except ImportError:
raise e
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['TqdmCallback']
class ... | from copy import copy
from functools import partial
from .auto import tqdm as tqdm_auto
try:
import keras
except (ImportError, AttributeError) as e:
try:
from tensorflow import keras
except ImportError:
raise e
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['TqdmCallback']
class ... |
36,047 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/tqdm/tk.py | 101,102 | 22,189 | close | tqdm_tk | 102,127 | 102,127 | class tqdm_tk(std_tqdm): # pragma: no cover
"""
Experimental Tkinter GUI version of tqdm!
Note: Window interactivity suffers if `tqdm_tk` is not running within
a Tkinter mainloop and values are generated infrequently. In this case,
consider calling `tqdm_tk.refresh()` frequently in the Tk thread.
... | class tqdm_tk(std_tqdm): # pragma: no cover
"""
Experimental Tkinter GUI version of tqdm!
Note: Window interactivity suffers if `tqdm_tk` is not running within
a Tkinter mainloop and values are generated infrequently. In this case,
consider calling `tqdm_tk.refresh()` frequently in the Tk thread.
... | if self.disable:
return
self.disable = True
with self.get_lock():
self._instances.remove(self)
def _close():
self._tk_window.after('idle', self._tk_window.destroy)
if not self._tk_dispatching:
self._tk_window.update()
... | if self.disable:
return
self.disable = True
with self.get_lock():
self._instances.remove(self)
def _close():
self._tk_window.after('idle', self._tk_window.destroy)
if not self._tk_dispatching:
self._tk_window.update()
... | 60 | 1,642 | 236 | 1,878 | """
Tkinter GUI progressbar decorator for iterators.
Usage:
>>> from tqdm.tk import trange, tqdm
>>> for i in trange(10):
... ...
"""
import re
import sys
import tkinter
import tkinter.ttk as ttk
from warnings import warn
from .std import TqdmExperimentalWarning, TqdmWarning
from .std import tqdm as std_tqdm
__a... | """
Tkinter GUI progressbar decorator for iterators.
Usage:
>>> from tqdm.tk import trange, tqdm
>>> for i in trange(10):
... ...
"""
import re
import sys
import tkinter
import tkinter.ttk as ttk
from warnings import warn
from .std import TqdmExperimentalWarning, TqdmWarning
from .std import tqdm as std_tqdm
__a... |
36,049 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/_collections.py | 92,93 | 31,107 | clear | RecentlyUsedContainer | 93,102 | 93,102 | class RecentlyUsedContainer(MutableMapping):
"""
Provides a thread-safe dict-like container which maintains up to
``maxsize`` keys while throwing away the least-recently-used keys beyond
``maxsize``.
:param maxsize:
Maximum number of recent elements to retain.
:param dispose_func:
... | class RecentlyUsedContainer(MutableMapping):
"""
Provides a thread-safe dict-like container which maintains up to
``maxsize`` keys while throwing away the least-recently-used keys beyond
``maxsize``.
:param maxsize:
Maximum number of recent elements to retain.
:param dispose_func:
... | with self.lock:
# Copy pointers to all values, then wipe the mapping
values = list(itervalues(self._container))
self._container.clear()
if self.dispose_func:
for value in values:
self.dispose_func(value)
| with self.lock:
# Copy pointers to all values, then wipe the mapping
values = list(itervalues(self._container))
self._container.clear()
if self.dispose_func:
for value in values:
self.dispose_func(value)
| 23 | 604 | 85 | 689 | from __future__ import absolute_import
try:
from collections.abc import Mapping, MutableMapping
except ImportError:
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
... | from __future__ import absolute_import
try:
from collections.abc import Mapping, MutableMapping
except ImportError:
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
... |
36,050 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/contrib/_appengine_environ.py | 8,9 | 1,37 | is_appengine | 9,12 | 9,12 | """
This module provides means to detect the App Engine environment.
"""
import os
def is_appengine():
FILL_FUNC_BODYdef is_appengine_sandbox():
"""Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restri... | """
This module provides means to detect the App Engine environment.
"""
import os
def is_appengine():
FILL_FUNC_BODYdef is_appengine_sandbox():
"""Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restri... | return is_local_appengine() or is_prod_appengine()
| return is_local_appengine() or is_prod_appengine()
| 4 | 302 | 23 | 325 | """
This module provides means to detect the App Engine environment.
"""
import os
def is_appengine():
FILL_FUNC_BODYdef is_appengine_sandbox():
"""Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restri... | """
This module provides means to detect the App Engine environment.
"""
import os
def is_appengine():
FILL_FUNC_BODYdef is_appengine_sandbox():
"""Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restri... | |
36,053 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/contrib/socks.py | 84,85 | 75,147 | _new_conn | SOCKSConnection | 88,147 | 85,147 | class SOCKSConnection(HTTPConnection):
"""
A plain-text HTTP connection that connects via a SOCKS proxy.
"""
def __init__(self, *args, **kwargs):
self._socks_options = kwargs.pop("_socks_options")
super(SOCKSConnection, self).__init__(*args, **kwargs)
def _new_conn(self):
FILL_FUNC... | class SOCKSConnection(HTTPConnection):
"""
A plain-text HTTP connection that connects via a SOCKS proxy.
"""
def __init__(self, *args, **kwargs):
self._socks_options = kwargs.pop("_socks_options")
super(SOCKSConnection, self).__init__(*args, **kwargs)
def _new_conn(self):
"... | extra_kw = {}
if self.source_address:
extra_kw["source_address"] = self.source_address
if self.socket_options:
extra_kw["socket_options"] = self.socket_options
try:
conn = socks.create_connection(
(self.host, self.port),
... | """
Establish a new connection via the SOCKS proxy.
"""
extra_kw = {}
if self.source_address:
extra_kw["source_address"] = self.source_address
if self.socket_options:
extra_kw["socket_options"] = self.socket_options
try:
conn ... | 188 | 131 | 620 | 751 | # -*- coding: utf-8 -*-
"""
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4, SOCKS4A (an extension of SOCKS4), and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
The SOCKS implementation supports t... | # -*- coding: utf-8 -*-
"""
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4, SOCKS4A (an extension of SOCKS4), and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
The SOCKS implementation supports t... |
36,055 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/fields.py | 159,161 | 126,275 | from_tuples | RequestField | 177,195 | 161,195 | class RequestField(object):
"""
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
:param data:
The data/value body.
:param filename:
An optional filename of the request field. Must be unicode.
:param headers:
... | class RequestField(object):
"""
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
:param data:
The data/value body.
:param filename:
An optional filename of the request field. Must be unicode.
:param headers:
... | if isinstance(value, tuple):
if len(value) == 3:
filename, data, content_type = value
else:
filename, data = value
content_type = guess_content_type(filename)
else:
filename = None
content_type = None
... | """
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters.
Supports constructing :class:`~urllib3.fields.RequestField` from
parameter of key/value strings AND key/filetuple. A filetuple is a
(filename, data, MIME type) tuple where the MIME type is optio... | 41 | 1,264 | 155 | 1,419 | from __future__ import absolute_import
import email.utils
import mimetypes
import re
from .packages import six
def guess_content_type(filename, default="application/octet-stream"):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`m... | from __future__ import absolute_import
import email.utils
import mimetypes
import re
from .packages import six
def guess_content_type(filename, default="application/octet-stream"):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`m... |
36,056 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/filepost.py | 15,16 | 1,99 | choose_boundary | 19,25 | 16,25 | from __future__ import absolute_import
import binascii
import codecs
import os
from io import BytesIO
from .fields import RequestField
from .packages import six
from .packages.six import b
writer = codecs.lookup("utf-8")[3]
def choose_boundary():
FILL_FUNC_BODYdef iter_field_objects(fields):
"""
Iterate ov... | from __future__ import absolute_import
import binascii
import codecs
import os
from io import BytesIO
from .fields import RequestField
from .packages import six
from .packages.six import b
writer = codecs.lookup("utf-8")[3]
def choose_boundary():
"""
Our embarrassingly-simple replacement for mimetools.choo... | boundary = binascii.hexlify(os.urandom(16))
if not six.PY2:
boundary = boundary.decode("ascii")
return boundary
| """
Our embarrassingly-simple replacement for mimetools.choose_boundary.
"""
boundary = binascii.hexlify(os.urandom(16))
if not six.PY2:
boundary = boundary.decode("ascii")
return boundary
| 11 | 750 | 54 | 804 | from __future__ import absolute_import
import binascii
import codecs
import os
from io import BytesIO
from .fields import RequestField
from .packages import six
from .packages.six import b
writer = codecs.lookup("utf-8")[3]
def choose_boundary():
FILL_FUNC_BODYdef iter_field_objects(fields):
"""
Iterate ov... | from __future__ import absolute_import
import binascii
import codecs
import os
from io import BytesIO
from .fields import RequestField
from .packages import six
from .packages.six import b
writer = codecs.lookup("utf-8")[3]
def choose_boundary():
"""
Our embarrassingly-simple replacement for mimetools.choo... | |
36,057 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/packages/backports/makefile.py | 13,16 | 1,52 | backport_makefile | 19,52 | 16,52 | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(
self, mode="r", buffering=None, encoding=None, errors=None, newli... | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(
self, mode="r", buffering=None, encoding=None, errors=None, newli... | if not set(mode) <= {"r", "w", "b"}:
raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
writing = "w" in mode
reading = "r" in mode or not writing
assert reading or writing
binary = "b" in mode
rawmode = ""
if reading:
rawmode += "r"
if writing:
... | """
Backport of ``socket.makefile`` from Python 3.5.
"""
if not set(mode) <= {"r", "w", "b"}:
raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
writing = "w" in mode
reading = "r" in mode or not writing
assert reading or writing
binary = "b" in mode
rawmode... | 126 | 141 | 346 | 487 | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(
self, mode="r", buffering=None, encoding=None, errors=None, newli... | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(
self, mode="r", buffering=None, encoding=None, errors=None, newli... | |
36,058 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/connection.py | 119,120 | 1,150 | _has_ipv6 | 121,149 | 120,149 | from __future__ import absolute_import
import socket
from ..contrib import _appengine_environ
from ..exceptions import LocationParseError
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connec... | from __future__ import absolute_import
import socket
from ..contrib import _appengine_environ
from ..exceptions import LocationParseError
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connec... | sock = None
has_ipv6 = False
# App Engine doesn't support IPV6 sockets and actually has a quota on the
# number of sockets that can be used, so just early out here instead of
# creating a socket needlessly.
# See https://github.com/urllib3/urllib3/issues/1446
if _appengine_environ.is_appeng... | """Returns True if the system can bind an IPv6 address."""
sock = None
has_ipv6 = False
# App Engine doesn't support IPV6 sockets and actually has a quota on the
# number of sockets that can be used, so just early out here instead of
# creating a socket needlessly.
# See https://github.com/... | 105 | 1,137 | 324 | 1,461 | from __future__ import absolute_import
import socket
from ..contrib import _appengine_environ
from ..exceptions import LocationParseError
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connec... | from __future__ import absolute_import
import socket
from ..contrib import _appengine_environ
from ..exceptions import LocationParseError
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connec... | |
36,059 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/proxy.py | 4,7 | 1,58 | connection_requires_http_tunnel | 17,37 | 7,37 | from .ssl_ import create_urllib3_context, resolve_cert_reqs, resolve_ssl_version
def connection_requires_http_tunnel(
proxy_url=None, proxy_config=None, destination_scheme=None
):
FILL_FUNC_BODYdef create_proxy_ssl_context(
ssl_version, cert_reqs, ca_certs=None, ca_cert_dir=None, ca_cert_data=None
):
"""
... | from .ssl_ import create_urllib3_context, resolve_cert_reqs, resolve_ssl_version
def connection_requires_http_tunnel(
proxy_url=None, proxy_config=None, destination_scheme=None
):
"""
Returns True if the connection requires an HTTP CONNECT through the proxy.
:param URL proxy_url:
URL of the p... | # If we're not using a proxy, no way to use a tunnel.
if proxy_url is None:
return False
# HTTP destinations never require tunneling, we always forward.
if destination_scheme == "http":
return False
# Support for forwarding with HTTPS proxies and HTTPS destinations.
if (
... | """
Returns True if the connection requires an HTTP CONNECT through the proxy.
:param URL proxy_url:
URL of the proxy.
:param ProxyConfig proxy_config:
Proxy configuration from poolmanager.py
:param str destination_scheme:
The scheme of the destination. (i.e https, http, etc... | 64 | 365 | 164 | 529 | from .ssl_ import create_urllib3_context, resolve_cert_reqs, resolve_ssl_version
def connection_requires_http_tunnel(
proxy_url=None, proxy_config=None, destination_scheme=None
):
FILL_FUNC_BODYdef create_proxy_ssl_context(
ssl_version, cert_reqs, ca_certs=None, ca_cert_dir=None, ca_cert_data=None
):
"""
... | from .ssl_ import create_urllib3_context, resolve_cert_reqs, resolve_ssl_version
def connection_requires_http_tunnel(
proxy_url=None, proxy_config=None, destination_scheme=None
):
"""
Returns True if the connection requires an HTTP CONNECT through the proxy.
:param URL proxy_url:
URL of the p... | |
36,060 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/request.py | 29,37 | 1,147 | make_headers | 71,101 | 37,101 | from __future__ import absolute_import
from base64 import b64encode
from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types
# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Enc... | from __future__ import absolute_import
from base64 import b64encode
from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types
# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Enc... | headers = {}
if accept_encoding:
if isinstance(accept_encoding, str):
pass
elif isinstance(accept_encoding, list):
accept_encoding = ",".join(accept_encoding)
else:
accept_encoding = ACCEPT_ENCODING
headers["accept-encoding"] = accept_encoding
... | """
Shortcuts for generating request headers.
:param keep_alive:
If ``True``, adds 'connection: keep-alive' header.
:param accept_encoding:
Can be a boolean, list, or string.
``True`` translates to 'gzip,deflate'.
List will get joined by comma.
String will be us... | 57 | 1,068 | 269 | 1,337 | from __future__ import absolute_import
from base64 import b64encode
from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types
# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Enc... | from __future__ import absolute_import
from base64 import b64encode
from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types
# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Enc... | |
36,061 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/ssltransport.py | 105,108 | 11,222 | makefile | SSLTransport | 115,150 | 108,150 | class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to chain
multiple TLS connections together. It's particularly useful if you need to
implement TLS within TLS.
The class supports ... | class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to chain
multiple TLS connections together. It's particularly useful if you need to
implement TLS within TLS.
The class supports ... | if not set(mode) <= {"r", "w", "b"}:
raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
writing = "w" in mode
reading = "r" in mode or not writing
assert reading or writing
binary = "b" in mode
rawmode = ""
if reading:
ra... | """
Python's httpclient uses makefile and buffered io when reading HTTP
messages and we need to support it.
This is unfortunately a copy and paste of socket.py makefile with small
changes to point to the socket directly.
"""
if not set(mode) <= {"r", "w", "b"}:
... | 126 | 1,667 | 352 | 2,019 | import io
import socket
import ssl
from ..exceptions import ProxySchemeUnsupported
from ..packages import six
SSL_BLOCKSIZE = 16384
class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to cha... | import io
import socket
import ssl
from ..exceptions import ProxySchemeUnsupported
from ..packages import six
SSL_BLOCKSIZE = 16384
class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to cha... |
36,064 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/url.py | 131,133 | 82,175 | url | Url | 150,171 | 133,171 | class Url(namedtuple("Url", url_attrs)):
"""
Data structure for representing an HTTP URL. Used as a return value for
:func:`parse_url`. Both the scheme and host are normalized as they are
both case-insensitive according to RFC 3986.
"""
__slots__ = ()
def __new__(
cls,
sche... | class Url(namedtuple("Url", url_attrs)):
"""
Data structure for representing an HTTP URL. Used as a return value for
:func:`parse_url`. Both the scheme and host are normalized as they are
both case-insensitive according to RFC 3986.
"""
__slots__ = ()
def __new__(
cls,
sche... | scheme, auth, host, port, path, query, fragment = self
url = u""
# We use "is not None" we want things to happen with empty strings (or 0 port)
if scheme is not None:
url += scheme + u"://"
if auth is not None:
url += auth + u"@"
if host is not No... | """
Convert self into a url
This function should more or less round-trip with :func:`.parse_url`. The
returned url may not be exactly the same as the url inputted to
:func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls
with a blank port will have : remo... | 97 | 601 | 188 | 789 | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... |
36,065 | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT | /home/hieuvd/dung_repo/raw/stars_02/gd3kr_BlenderGPT/BlenderGPT/lib/urllib3/util/wait.py | 126,127 | 1,153 | wait_for_socket | 127,141 | 127,141 | import errno
import select
import sys
from functools import partial
try:
from time import monotonic
except ImportError:
from time import time as monotonic
__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"]
class NoWayToWaitForSocketError(Exception):
pass
# How should we wait on... | import errno
import select
import sys
from functools import partial
try:
from time import monotonic
except ImportError:
from time import time as monotonic
__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"]
class NoWayToWaitForSocketError(Exception):
pass
# How should we wait on... | # We delay choosing which implementation to use until the first time we're
# called. We could do it at import time, but then we might make the wrong
# decision if someone goes wild with monkeypatching select.poll after
# we're imported.
global wait_for_socket
if _have_working_poll():
wai... | # We delay choosing which implementation to use until the first time we're
# called. We could do it at import time, but then we might make the wrong
# decision if someone goes wild with monkeypatching select.poll after
# we're imported.
global wait_for_socket
if _have_working_poll():
wai... | 65 | 1,422 | 183 | 1,605 | import errno
import select
import sys
from functools import partial
try:
from time import monotonic
except ImportError:
from time import time as monotonic
__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"]
class NoWayToWaitForSocketError(Exception):
pass
# How should we wait on... | import errno
import select
import sys
from functools import partial
try:
from time import monotonic
except ImportError:
from time import time as monotonic
__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"]
class NoWayToWaitForSocketError(Exception):
pass
# How should we wait on... | |
36,180 | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap/docs/changelog_update.py | 23,24 | 1,50 | replace_url | 24,29 | 24,29 | import re
# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Add installation CI by @giswqs in https://github.com/gee-community/geemap/pull/1656
* Fix vis control error by @giswqs in https://github.com/gee-community/geemap/pull/1660
## New Contributors
* @bengalin made their... | import re
# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Add installation CI by @giswqs in https://github.com/gee-community/geemap/pull/1656
* Fix vis control error by @giswqs in https://github.com/gee-community/geemap/pull/1660
## New Contributors
* @bengalin made their... | pr_number = match.group(1)
return f"[#{pr_number}](https://github.com/gee-community/geemap/pull/{pr_number})"
# Use re.sub to replace URLs with the desired format
| pr_number = match.group(1)
return f"[#{pr_number}](https://github.com/gee-community/geemap/pull/{pr_number})"
# Use re.sub to replace URLs with the desired format
| 15 | 580 | 68 | 648 | import re
# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Add installation CI by @giswqs in https://github.com/gee-community/geemap/pull/1656
* Fix vis control error by @giswqs in https://github.com/gee-community/geemap/pull/1660
## New Contributors
* @bengalin made their... | import re
# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Add installation CI by @giswqs in https://github.com/gee-community/geemap/pull/1656
* Fix vis control error by @giswqs in https://github.com/gee-community/geemap/pull/1660
## New Contributors
* @bengalin made their... | |
36,181 | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap/examples/heroku/config_vars.py | 7,8 | 1,45 | set_heroku_vars | 13,43 | 8,43 | import os
import platform
from subprocess import DEVNULL, STDOUT, check_call
import json
def set_heroku_vars(token_name="EARTHENGINE_TOKEN"):
FILL_FUNC_BODYif __name__ == "__main__":
set_heroku_vars(token_name="EARTHENGINE_TOKEN")
| import os
import platform
from subprocess import DEVNULL, STDOUT, check_call
import json
def set_heroku_vars(token_name="EARTHENGINE_TOKEN"):
"""Extracts Earth Engine token from the local computer and sets it as an environment variable on heroku.
Args:
token_name (str, optional): Name of the Earth En... | try:
ee_token_dir = os.path.expanduser("~/.config/earthengine/")
ee_token_file = os.path.join(ee_token_dir, "credentials")
if not os.path.exists(ee_token_file):
print("The credentials file does not exist.")
else:
with open(ee_token_file) as f:
... | """Extracts Earth Engine token from the local computer and sets it as an environment variable on heroku.
Args:
token_name (str, optional): Name of the Earth Engine token. Defaults to 'EARTHENGINE_TOKEN'.
"""
try:
ee_token_dir = os.path.expanduser("~/.config/earthengine/")
ee_tok... | 58 | 164 | 291 | 455 | import os
import platform
from subprocess import DEVNULL, STDOUT, check_call
import json
def set_heroku_vars(token_name="EARTHENGINE_TOKEN"):
FILL_FUNC_BODYif __name__ == "__main__":
set_heroku_vars(token_name="EARTHENGINE_TOKEN")
| import os
import platform
from subprocess import DEVNULL, STDOUT, check_call
import json
def set_heroku_vars(token_name="EARTHENGINE_TOKEN"):
"""Extracts Earth Engine token from the local computer and sets it as an environment variable on heroku.
Args:
token_name (str, optional): Name of the Earth En... | |
36,182 | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap | /home/hieuvd/dung_repo/raw/stars_02/gee-community_geemap/geemap/geemap/cli.py | 7,9 | 1,17 | main | 10,15 | 9,15 | """Console script for geemap."""
import sys
import click
@click.command()
def main(args=None):
FILL_FUNC_BODYif __name__ == "__main__":
sys.exit(main()) # pragma: no cover
| """Console script for geemap."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for geemap."""
FILL_FUNC_BODYif __name__ == "__main__":
sys.exit(main()) # pragma: no cover
| click.echo("Replace this message by putting your code into " "geemap.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
| """Console script for geemap."""
click.echo("Replace this message by putting your code into " "geemap.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
| 17 | 78 | 59 | 137 | """Console script for geemap."""
import sys
import click
@click.command()
def main(args=None):
FILL_FUNC_BODYif __name__ == "__main__":
sys.exit(main()) # pragma: no cover
| """Console script for geemap."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for geemap."""
FILL_FUNC_BODYif __name__ == "__main__":
sys.exit(main()) # pragma: no cover
| |
36,239 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/_version.py | 67,68 | 1,105 | get_current_git_hash | 68,76 | 68,76 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | try:
return subprocess.check_output(
["git", "log", "--no-merges", "-n", "1", "--pretty=format:%H"],
stderr=subprocess.PIPE, cwd=MY_DIR,
).strip()
except (OSError, subprocess.CalledProcessError):
return None
| try:
return subprocess.check_output(
["git", "log", "--no-merges", "-n", "1", "--pretty=format:%H"],
stderr=subprocess.PIPE, cwd=MY_DIR,
).strip()
except (OSError, subprocess.CalledProcessError):
return None
| 17 | 1,046 | 96 | 1,142 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | |
36,240 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-agent/_version.py | 76,77 | 1,105 | tag_version_data | 77,105 | 77,105 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | current_hash = get_current_git_hash()
# Not in a git repository.
if current_hash is None:
version_data["error"] = "Not in a git repository."
else:
version_data["revisionid"] = current_hash
version_data["dirty"] = is_tree_dirty()
version_data["dev"] = number_of_commit_sin... | current_hash = get_current_git_hash()
# Not in a git repository.
if current_hash is None:
version_data["error"] = "Not in a git repository."
else:
version_data["revisionid"] = current_hash
version_data["dirty"] = is_tree_dirty()
version_data["dev"] = number_of_commit_sin... | 97 | 791 | 371 | 1,162 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | |
36,241 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-agent/setup.py | 35,36 | 1,105 | find_data_files | 36,43 | 36,43 | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | result = []
for directory, _, files in os.walk(source):
files = [os.path.join(directory, x) for x in files]
result.append((directory, files))
return result
| result = []
for directory, _, files in os.walk(source):
files = [os.path.join(directory, x) for x in files]
result.append((directory, files))
return result
| 21 | 998 | 62 | 1,060 | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | |
36,242 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-agent/setup.py | 69,70 | 61,75 | run | CleanCommand | 70,75 | 70,75 | class CleanCommand(Command):
description = ("custom clean command that forcefully removes "
"dist/build directories")
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
FILL_FUNC_BODY | class CleanCommand(Command):
description = ("custom clean command that forcefully removes "
"dist/build directories")
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
FILL_FUNC_BODY | if os.getcwd() != self.cwd:
raise RuntimeError('Must be in package root: %s' % self.cwd)
os.system('rm -rf ./build ./dist')
| if os.getcwd() != self.cwd:
raise RuntimeError('Must be in package root: %s' % self.cwd)
os.system('rm -rf ./build ./dist')
| 17 | 92 | 58 | 150 | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | #!/usr/bin/env python
# Rekall
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... |
36,243 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/_version.py | 41,42 | 1,105 | get_version_file_path | 42,50 | 42,50 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | try:
return os.path.join(subprocess.check_output(
["git", "rev-parse", "--show-toplevel"], stderr=subprocess.PIPE,
cwd=MY_DIR,
).decode("utf-8").strip(), version_file)
except (OSError, subprocess.CalledProcessError):
return None
| try:
return os.path.join(subprocess.check_output(
["git", "rev-parse", "--show-toplevel"], stderr=subprocess.PIPE,
cwd=MY_DIR,
).decode("utf-8").strip(), version_file)
except (OSError, subprocess.CalledProcessError):
return None
| 15 | 1,042 | 100 | 1,142 |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... |
# Machine Generated - do not edit!
# This file is produced when the main "version.py update" command is run. That
# command copies this file to all sub-packages which contain
# setup.py. Configuration is maintain in version.yaml at the project's top
# level.
def get_versions():
return tag_version_data(raw_versio... | |
36,244 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/algo.py | 24,25 | 1,79 | EulersDecimals | 34,79 | 25,79 | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
def e_continued_fraction():
"""Continued fraction for Euler's.
This is the series 1, 0, 1, 1, 2, 1, 1, 4...
"""
yield 1
k = 0
while True:
yield k
k += 2
yield 1
yield 1
def yield_digits(p, q):
while p > 0:... | """Yields decimals of Euler's number, using continued fractions.
This is used to generate random looking, but deterministic series of digits
for testing purposes. Unlike PRNGs, the output is always guaranteed to be
the same and is implementation-independent.
For explanation of how this works see (... | 184 | 387 | 410 | 797 | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | |
36,245 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/constants.py | 104,105 | 1,106 | GetQuote | 105,106 | 105,106 | # Rekall Memory Forensics
# Copyright (C) 2008 Volatile Systems
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | # Rekall Memory Forensics
# Copyright (C) 2008 Volatile Systems
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | return QUOTES[int(time.time()) % len(QUOTES)]
| return QUOTES[int(time.time()) % len(QUOTES)]
| 4 | 1,304 | 21 | 1,325 | # Rekall Memory Forensics
# Copyright (C) 2008 Volatile Systems
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | # Rekall Memory Forensics
# Copyright (C) 2008 Volatile Systems
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | |
36,247 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/addrspaces/ewf.py | 59,60 | 29,75 | cached_read_partial | EWFAddressSpace | 61,72 | 60,72 | class EWFAddressSpace(addrspace.CachingAddressSpaceMixIn,
addrspace.BaseAddressSpace):
""" An EWF capable address space.
In order for us to work we need:
1) There must be a base AS.
2) The first 6 bytes must be 45 56 46 09 0D 0A (EVF header)
NOTE: We currently only support op... | class EWFAddressSpace(addrspace.CachingAddressSpaceMixIn,
addrspace.BaseAddressSpace):
""" An EWF capable address space.
In order for us to work we need:
1) There must be a base AS.
2) The first 6 bytes must be 45 56 46 09 0D 0A (EVF header)
NOTE: We currently only support op... | res = ""
if offset != None:
res = self.ewf_file.read(offset, length)
if len(res) < length:
to_read = length - len(res)
data = addrspace.ZEROER.GetZeros(to_read)
return res + data
return res
| """Implement our own read method for caching."""
res = ""
if offset != None:
res = self.ewf_file.read(offset, length)
if len(res) < length:
to_read = length - len(res)
data = addrspace.ZEROER.GetZeros(to_read)
return res + data
re... | 29 | 459 | 96 | 555 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Copyright (C) 2012 Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Copyright (C) 2012 Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
36,248 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/addrspaces/mips.py | 52,53 | 28,162 | _pa | MIPS32PagedMemory | 56,63 | 53,63 | class MIPS32PagedMemory(intel.IA32PagedMemory):
'''
Address space to handle the MIPS Linux memory layout, which is:
0x0000 0000 - 0x7FFF FFFF kuseg: User mapped pages
0x8000 0000 - 0x9FFF FFFF k0seg: Kernel non paged memory, this maps to
address range 0x0000 0000... | class MIPS32PagedMemory(intel.IA32PagedMemory):
'''
Address space to handle the MIPS Linux memory layout, which is:
0x0000 0000 - 0x7FFF FFFF kuseg: User mapped pages
0x8000 0000 - 0x9FFF FFFF k0seg: Kernel non paged memory, this maps to
address range 0x0000 0000... | if x < 0x80000000:
return x
elif x >= 0xA0000000:
return x - 0xA0000000
else:
return x - 0x80000000
| '''
Convert a physical address to the actual physical memory location.
'''
if x < 0x80000000:
return x
elif x >= 0xA0000000:
return x - 0xA0000000
else:
return x - 0x80000000
| 19 | 1,532 | 80 | 1,612 | # Rekall Memory Forensics
#
# Authors:
# Karl Vogel <karl.vogel@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later vers... | # Rekall Memory Forensics
#
# Authors:
# Karl Vogel <karl.vogel@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later vers... |
36,249 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/addrspaces/mmap_address_space.py | 75,76 | 31,107 | read | MmapFileAddressSpace | 76,82 | 76,82 | class MmapFileAddressSpace(addrspace.BaseAddressSpace):
""" This is an AS which uses an mmap of a file.
For this AS to be instantiated, we need
1) A valid config.LOCATION (starting with file://)
2) no one else has picked the AS before us
3) base == self (we dont operate on anyone else so we need... | class MmapFileAddressSpace(addrspace.BaseAddressSpace):
""" This is an AS which uses an mmap of a file.
For this AS to be instantiated, we need
1) A valid config.LOCATION (starting with file://)
2) no one else has picked the AS before us
3) base == self (we dont operate on anyone else so we need... | result = ""
if addr != None:
result = self.map[addr:addr + length]
return result + addrspace.ZEROER.GetZeros(length - len(result))
| result = ""
if addr != None:
result = self.map[addr:addr + length]
return result + addrspace.ZEROER.GetZeros(length - len(result))
| 18 | 714 | 58 | 772 | # Rekall Memory Forensics
# Copyright (C) 2012
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | # Rekall Memory Forensics
# Copyright (C) 2012
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
36,250 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/addrspaces/vmi.py | 70,71 | 15,87 | write | VMIAddressSpace | 71,76 | 71,76 | class VMIAddressSpace(addrspace.BaseAddressSpace):
"""An address space which operates on top of Libvmi's interface."""
__abstract = False
__name = "vmi"
order = 90
volatile = True
__image = True
def __init__(self, base=None, filename=None, session=None, **kwargs):
self.as_assert(li... | class VMIAddressSpace(addrspace.BaseAddressSpace):
"""An address space which operates on top of Libvmi's interface."""
__abstract = False
__name = "vmi"
order = 90
volatile = True
__image = True
def __init__(self, base=None, filename=None, session=None, **kwargs):
self.as_assert(li... | bytes_written = self.vmi.write_pa(addr, data)
if bytes_written != len(data):
return False
return True
| bytes_written = self.vmi.write_pa(addr, data)
if bytes_written != len(data):
return False
return True
| 12 | 800 | 45 | 845 | from urllib.parse import urlparse, parse_qs
from distutils.util import strtobool
from rekall import addrspace
libvmi = None
try:
import libvmi
from libvmi import Libvmi, VMIMode
except ImportError:
pass
SCHEME = 'vmi'
class VMIAddressSpace(addrspace.BaseAddressSpace):
"""An address space which opera... | from urllib.parse import urlparse, parse_qs
from distutils.util import strtobool
from rekall import addrspace
libvmi = None
try:
import libvmi
from libvmi import Libvmi, VMIMode
except ImportError:
pass
SCHEME = 'vmi'
class VMIAddressSpace(addrspace.BaseAddressSpace):
"""An address space which opera... |
36,251 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/inspection.py | 56,57 | 28,74 | collect | MemoryTranslation | 57,74 | 57,74 | class MemoryTranslation(plugin.KernelASMixin,
plugin.PhysicalASMixin,
plugin.TypedProfileCommand,
plugin.Command):
"""Inspect the mapping of a virtual address."""
name = "inspect_vaddr"
__args = [
dict(name="address", required... | class MemoryTranslation(plugin.KernelASMixin,
plugin.PhysicalASMixin,
plugin.TypedProfileCommand,
plugin.Command):
"""Inspect the mapping of a virtual address."""
name = "inspect_vaddr"
__args = [
dict(name="address", required... | address_space = self.session.GetParameter("default_address_space")
address = self.plugin_args.address
# Traverse the address space stack and report each address space.
while address_space is not None:
run = address_space.vtop_run(address)
if address_space == run... | address_space = self.session.GetParameter("default_address_space")
address = self.plugin_args.address
# Traverse the address space stack and report each address space.
while address_space is not None:
run = address_space.vtop_run(address)
if address_space == run... | 41 | 264 | 167 | 431 | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,252 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/pas2kas.py | 166,167 | 135,185 | render | Pas2VasMixin | 167,185 | 167,185 | class Pas2VasMixin(object):
"""Resolves a physical address to a virtual addrress in a process."""
name = "pas2vas"
__args = [
dict(name="offsets", type="ArrayIntParser",
help="A list of physical offsets to resolve."),
]
def get_virtual_address(self, physical_address, tasks=No... | class Pas2VasMixin(object):
"""Resolves a physical address to a virtual addrress in a process."""
name = "pas2vas"
__args = [
dict(name="offsets", type="ArrayIntParser",
help="A list of physical offsets to resolve."),
]
def get_virtual_address(self, physical_address, tasks=No... | renderer.table_header([('Physical', 'virtual_offset', '[addrpad]'),
('Virtual', 'physical_offset', '[addrpad]'),
('Pid', 'pid', '>6'),
('Name', 'name', '')])
tasks = list(self.filter_processes())
for ph... | renderer.table_header([('Physical', 'virtual_offset', '[addrpad]'),
('Virtual', 'physical_offset', '[addrpad]'),
('Pid', 'pid', '>6'),
('Name', 'name', '')])
tasks = list(self.filter_processes())
for ph... | 40 | 309 | 204 | 513 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,253 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/pas2kas.py | 62,63 | 32,135 | PA2VA_for_DTB | Pas2VasResolver | 63,104 | 63,104 | class Pas2VasResolver(object):
"""An object which resolves physical addresses to virtual addresses."""
def __init__(self, session):
self.session = session
self.dirty = True
# Maintains some maps to ensure fast lookups.
self.dtb2task = {}
self.dtb2maps = {}
self.d... | class Pas2VasResolver(object):
"""An object which resolves physical addresses to virtual addresses."""
def __init__(self, session):
self.session = session
self.dirty = True
# Maintains some maps to ensure fast lookups.
self.dtb2task = {}
self.dtb2maps = {}
self.d... | if dtb == None:
return None, None
# Choose the userspace mode automatically.
if userspace is None:
userspace = dtb != self.session.kernel_address_space.dtb
# Build a map for this dtb.
lookup_map = self.dtb2maps.get(dtb)
# If we want the full res... | if dtb == None:
return None, None
# Choose the userspace mode automatically.
if userspace is None:
userspace = dtb != self.session.kernel_address_space.dtb
# Build a map for this dtb.
lookup_map = self.dtb2maps.get(dtb)
# If we want the full res... | 152 | 612 | 450 | 1,062 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,254 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/pas2kas.py | 199,200 | 185,213 | DecodeFromJsonSafe | Pas2VasResolverJsonObjectRenderer | 200,213 | 200,213 | class Pas2VasResolverJsonObjectRenderer(json_renderer.StateBasedObjectRenderer):
"""Encode and decode the pas2vas maps efficiently."""
renders_type = "Pas2VasResolver"
def EncodeToJsonSafe(self, item, **_):
result = {}
result["dtb2task"] = item.dtb2task
result["dtb2maps"] = item.dt... | class Pas2VasResolverJsonObjectRenderer(json_renderer.StateBasedObjectRenderer):
"""Encode and decode the pas2vas maps efficiently."""
renders_type = "Pas2VasResolver"
def EncodeToJsonSafe(self, item, **_):
result = {}
result["dtb2task"] = item.dtb2task
result["dtb2maps"] = item.dt... | # Get the original class to instantiate the required item.
cls = self.GetImplementationFromMRO(Pas2VasResolver, value)
result = cls(session=self.session)
for attr in ["dtb2maps", "dtb2userspace", "dtb2task"]:
if attr in value:
setattr(result, attr, value[attr... | # Get the original class to instantiate the required item.
cls = self.GetImplementationFromMRO(Pas2VasResolver, value)
result = cls(session=self.session)
for attr in ["dtb2maps", "dtb2userspace", "dtb2task"]:
if attr in value:
setattr(result, attr, value[attr... | 35 | 177 | 125 | 302 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,255 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/pfn.py | 30,31 | 23,45 | summary | PhysicalAddressContext | 31,36 | 31,36 | class PhysicalAddressContext(object):
"""A lazy evaluator for context information around physical addresses."""
def __init__(self, session, address):
self.session = session
self.address = address
def summary(self):
FILL_FUNC_BODY def __str__(self):
rammap_plugin = self.session.p... | class PhysicalAddressContext(object):
"""A lazy evaluator for context information around physical addresses."""
def __init__(self, session, address):
self.session = session
self.address = address
def summary(self):
FILL_FUNC_BODY def __str__(self):
rammap_plugin = self.session.p... | rammap_plugin = self.session.plugins.rammap(
start=self.address, end=self.address+1)
for row in rammap_plugin.collect():
return row
| rammap_plugin = self.session.plugins.rammap(
start=self.address, end=self.address+1)
for row in rammap_plugin.collect():
return row
| 11 | 149 | 54 | 203 | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,256 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/common/pfn.py | 95,96 | 45,138 | collect | VADMapMixin | 96,138 | 96,138 | class VADMapMixin(object):
"""A plugin to display information about virtual address pages."""
name = "vadmap"
__args = [
dict(name="start", default=0, type="IntParser",
help="Start reading from this page."),
dict(name="end", default=2**63, type="IntParser",
help=... | class VADMapMixin(object):
"""A plugin to display information about virtual address pages."""
name = "vadmap"
__args = [
dict(name="start", default=0, type="IntParser",
help="Start reading from this page."),
dict(name="end", default=2**63, type="IntParser",
help=... | for task in self.filter_processes():
yield dict(_EPROCESS=task,
Divider="Pid: {0} {1}\n".format(task.pid, task.name))
with self.session.plugins.cc() as cc:
cc.SwitchProcessContext(task)
old_offset = 0
old_vaddr = 0
... | for task in self.filter_processes():
yield dict(_EPROCESS=task,
Divider="Pid: {0} {1}\n".format(task.pid, task.name))
with self.session.plugins.cc() as cc:
cc.SwitchProcessContext(task)
old_offset = 0
old_vaddr = 0
... | 132 | 437 | 448 | 885 | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,258 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/compressor.py | 49,50 | 33,139 | render | DarwinDumpCompressedPages | 50,139 | 50,139 | class DarwinDumpCompressedPages(core.DirectoryDumperMixin, common.AbstractDarwinCommand):
"""Dumps all compressed pages."""
__name = "dumpcompressedmemory"
SLOT_ARRAY_SIZE = 64
PAGE_SIZE = 4096
def UnpackCSize(self, c_slot):
size = c_slot.c_size
if size == self.PAGE_SIZE - 1:
... | class DarwinDumpCompressedPages(core.DirectoryDumperMixin, common.AbstractDarwinCommand):
"""Dumps all compressed pages."""
__name = "dumpcompressedmemory"
SLOT_ARRAY_SIZE = 64
PAGE_SIZE = 4096
def UnpackCSize(self, c_slot):
size = c_slot.c_size
if size == self.PAGE_SIZE - 1:
... |
pages = self.profile.get_constant_object("_c_segment_count", "int")
renderer.format("Going to dump {0} segments.\n", pages)
p_segu = self.profile.get_constant_object(
"_c_segments", "Pointer", target_args={
"target": "Array",
"target_args": {
... |
pages = self.profile.get_constant_object("_c_segment_count", "int")
renderer.format("Going to dump {0} segments.\n", pages)
p_segu = self.profile.get_constant_object(
"_c_segments", "Pointer", target_args={
"target": "Array",
"target_args": {
... | 200 | 153 | 1,006 | 1,159 | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,259 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/hooks.py | 29,30 | 24,65 | render | DarwinNotifiers | 30,65 | 30,65 | class DarwinNotifiers(common.AbstractDarwinCommand):
"""Detects hooks in I/O Kit IONotify objects."""
__name = "notifiers"
def render(self, renderer):
FILL_FUNC_BODY | class DarwinNotifiers(common.AbstractDarwinCommand):
"""Detects hooks in I/O Kit IONotify objects."""
__name = "notifiers"
def render(self, renderer):
FILL_FUNC_BODY | renderer.table_header([
("Notify Type", "notify_type", "25"),
("Handler", "handler", "[addrpad]"),
("Match Key", "match_key", "20"),
("Match Value", "match_value", "30"),
("Symbol", "symbol", ""),
])
gnotifications = self.profile.get_c... | renderer.table_header([
("Notify Type", "notify_type", "25"),
("Handler", "handler", "[addrpad]"),
("Match Key", "match_key", "20"),
("Match Value", "match_value", "30"),
("Symbol", "symbol", ""),
])
gnotifications = self.profile.get_c... | 86 | 65 | 376 | 441 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,260 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/lsmod.py | 33,34 | 25,67 | get_module_list | DarwinLsmod | 34,54 | 34,54 | class DarwinLsmod(common.AbstractDarwinCommand):
"""Lists all kernel modules."""
__name = "lsmod"
modlist = None
mod_lookup = None
def get_module_list(self):
FILL_FUNC_BODY def render(self, renderer):
renderer.table_header([("Address", "address", "[addrpad]"),
... | class DarwinLsmod(common.AbstractDarwinCommand):
"""Lists all kernel modules."""
__name = "lsmod"
modlist = None
mod_lookup = None
def get_module_list(self):
FILL_FUNC_BODY def render(self, renderer):
renderer.table_header([("Address", "address", "[addrpad]"),
... | # The kernel is also included in the module list to make it easier to
# local pointers inside it.
# See: xnu-2422.1.72/bsd/dev/dtrace/dtrace.c: 19843
kernel = self.profile.get_constant_object(
"_g_kernel_kmod_info", "kmod_info")
if kernel:
yield kernel
... | # The kernel is also included in the module list to make it easier to
# local pointers inside it.
# See: xnu-2422.1.72/bsd/dev/dtrace/dtrace.c: 19843
kernel = self.profile.get_constant_object(
"_g_kernel_kmod_info", "kmod_info")
if kernel:
yield kernel
... | 54 | 208 | 214 | 422 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,261 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/lsof.py | 35,36 | 25,41 | collect | DarwinHandles | 36,41 | 36,41 | class DarwinHandles(common.ProcessFilterMixin, common.AbstractDarwinProducer):
"""Walks open files of each proc and collects the fileproc.
This is the same algorithm as lsof, but aimed at just collecting the
fileprocs, without doing anything with them, or sorting.
"""
name = "handles"
type_nam... | class DarwinHandles(common.ProcessFilterMixin, common.AbstractDarwinProducer):
"""Walks open files of each proc and collects the fileproc.
This is the same algorithm as lsof, but aimed at just collecting the
fileprocs, without doing anything with them, or sorting.
"""
name = "handles"
type_nam... | for proc in self.filter_processes():
for _, fileproc, _ in proc.get_open_files():
yield [fileproc]
| for proc in self.filter_processes():
for _, fileproc, _ in proc.get_open_files():
yield [fileproc]
| 12 | 116 | 43 | 159 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,262 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/lsof.py | 63,64 | 41,69 | collect | DarwinLsof | 64,69 | 64,69 | class DarwinLsof(common.AbstractDarwinCommand):
"""Walks open files of each proc in order and prints PID, FD and the handle.
Each process has an array of pointers to fileproc structs - the offset into
the array is the file descriptor and each fileproc struct represents a
handle on some resource. A type... | class DarwinLsof(common.AbstractDarwinCommand):
"""Walks open files of each proc in order and prints PID, FD and the handle.
Each process has an array of pointers to fileproc structs - the offset into
the array is the file descriptor and each fileproc struct represents a
handle on some resource. A type... | procs = self.session.plugins.collect("proc").collect()
for proc in sorted(procs, key=lambda proc: proc.pid):
for fd, fileproc, _ in proc.get_open_files():
yield (proc, fd, fileproc)
| procs = self.session.plugins.collect("proc").collect()
for proc in sorted(procs, key=lambda proc: proc.pid):
for fd, fileproc, _ in proc.get_open_files():
yield (proc, fd, fileproc)
| 20 | 253 | 73 | 326 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,263 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/pas2kas.py | 35,36 | 34,39 | GetTaskStruct | DarwinPas2VasResolver | 36,39 | 36,39 | class DarwinPas2VasResolver(pas2kas.Pas2VasResolver):
def GetTaskStruct(self, addrress):
FILL_FUNC_BODY | class DarwinPas2VasResolver(pas2kas.Pas2VasResolver):
def GetTaskStruct(self, addrress):
FILL_FUNC_BODY | return self.session.profile.proc(addrress)
| return self.session.profile.proc(addrress)
| 2 | 46 | 19 | 65 | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,264 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/pas2kas.py | 44,45 | 39,46 | calculate | DarwinPas2VasResolverHook | 45,46 | 45,46 | class DarwinPas2VasResolverHook(common.AbstractDarwinParameterHook):
"""Provide the Pas2Vas resolver."""
name = "physical_address_resolver"
def calculate(self):
FILL_FUNC_BODY | class DarwinPas2VasResolverHook(common.AbstractDarwinParameterHook):
"""Provide the Pas2Vas resolver."""
name = "physical_address_resolver"
def calculate(self):
FILL_FUNC_BODY | return DarwinPas2VasResolver(session=self.session)
| return DarwinPas2VasResolver(session=self.session)
| 2 | 65 | 19 | 84 | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,265 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/sessions.py | 36,37 | 30,56 | collect | DarwinSessions | 37,56 | 37,56 | class DarwinSessions(common.AbstractDarwinProducer):
"""Finds sessions by walking their global hashtable."""
name = "sessions"
type_name = "session"
def collect(self):
FILL_FUNC_BODY | class DarwinSessions(common.AbstractDarwinProducer):
"""Finds sessions by walking their global hashtable."""
name = "sessions"
type_name = "session"
def collect(self):
FILL_FUNC_BODY | session_hash_table_size = self.profile.get_constant_object(
"_sesshash", "unsigned long")
# The hashtable is an array to session list heads.
session_hash_table = self.profile.get_constant_object(
"_sesshashtbl",
target="Pointer",
target_args=dict(... | session_hash_table_size = self.profile.get_constant_object(
"_sesshash", "unsigned long")
# The hashtable is an array to session list heads.
session_hash_table = self.profile.get_constant_object(
"_sesshashtbl",
target="Pointer",
target_args=dict(... | 47 | 66 | 214 | 280 | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,266 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/darwin/sessions.py | 67,68 | 56,72 | collect | DarwinTerminals | 68,72 | 68,72 | class DarwinTerminals(common.AbstractDarwinCommand):
"""Lists open ttys."""
name = "terminals"
table_header = [
dict(type="session", name="session",
columns=[dict(name="s_sid")]),
dict(type="tty", name="tty")
]
def collect(self):
FILL_FUNC_BODY | class DarwinTerminals(common.AbstractDarwinCommand):
"""Lists open ttys."""
name = "terminals"
table_header = [
dict(type="session", name="session",
columns=[dict(name="s_sid")]),
dict(type="tty", name="tty")
]
def collect(self):
FILL_FUNC_BODY | for session in self.session.plugins.sessions().produce():
if session.s_ttyp:
yield dict(session=session,
tty=session.s_ttyp)
| for session in self.session.plugins.sessions().produce():
if session.s_ttyp:
yield dict(session=session,
tty=session.s_ttyp)
| 9 | 109 | 52 | 161 | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,267 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/filesystems/lznt1.py | 61,62 | 1,134 | decompress_data | 63,134 | 62,134 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... |
if not logger:
lznt1_logger = logging.getLogger("ntfs.lznt1")
else:
lznt1_logger = logger.getChild("lznt1")
# Change to DEBUG to turn on module level debugging.
lznt1_logger.setLevel(logging.ERROR)
in_fd = io.BytesIO(cdata)
output_fd = io.BytesIO()
block_end = 0
while i... | """Decompresses the data."""
if not logger:
lznt1_logger = logging.getLogger("ntfs.lznt1")
else:
lznt1_logger = logger.getChild("lznt1")
# Change to DEBUG to turn on module level debugging.
lznt1_logger.setLevel(logging.ERROR)
in_fd = io.BytesIO(cdata)
output_fd = io.BytesIO... | 205 | 585 | 833 | 1,418 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | |
36,268 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/address_resolver.py | 65,66 | 61,86 | _EnsureInitialized | LinuxAddressResolver | 66,86 | 66,86 | class LinuxAddressResolver(address_resolver.AddressResolverMixin,
common.LinuxPlugin):
"""A Linux specific address resolver plugin."""
def _EnsureInitialized(self):
FILL_FUNC_BODY | class LinuxAddressResolver(address_resolver.AddressResolverMixin,
common.LinuxPlugin):
"""A Linux specific address resolver plugin."""
def _EnsureInitialized(self):
FILL_FUNC_BODY | if self._initialized:
return
# Insert a psuedo module for the kernel
self.AddModule(KernelModule(session=self.session))
# Add LKMs.
for kmod in self.session.plugins.lsmod().get_module_list():
self.AddModule(LKMModule(kmod, session=self.session))
... | if self._initialized:
return
# Insert a psuedo module for the kernel
self.AddModule(KernelModule(session=self.session))
# Add LKMs.
for kmod in self.session.plugins.lsmod().get_module_list():
self.AddModule(LKMModule(kmod, session=self.session))
... | 44 | 56 | 220 | 276 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,269 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/arp.py | 72,73 | 56,154 | get_handle_tables | Arp | 73,108 | 73,108 | class Arp(common.LinuxPlugin):
"""print the ARP table."""
# This plugin seems broken now.
__name = "arp"
table_header = [
dict(name="ip", width=45, align="r"),
dict(name="mac", width=20, align="r"),
dict(name="dev", width=15, align="r")
]
def __init__(self, **kwargs):
... | class Arp(common.LinuxPlugin):
"""print the ARP table."""
# This plugin seems broken now.
__name = "arp"
table_header = [
dict(name="ip", width=45, align="r"),
dict(name="mac", width=20, align="r"),
dict(name="dev", width=15, align="r")
]
def __init__(self, **kwargs):
... | # In earlier Linux neigh_table is a linked list.
if self.session.profile.neigh_table().m("next") != None:
tables = self.profile.get_constant_object(
"neigh_tables",
target="Pointer",
target_args=dict(
target="neigh_table"
... | # In earlier Linux neigh_table is a linked list.
if self.session.profile.neigh_table().m("next") != None:
tables = self.profile.get_constant_object(
"neigh_tables",
target="Pointer",
target_args=dict(
target="neigh_table"
... | 85 | 593 | 361 | 954 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,270 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/arp.py | 51,53 | 50,56 | modify | ArpModification | 53,56 | 53,56 | class ArpModification(obj.ProfileModification):
@classmethod
def modify(cls, profile):
FILL_FUNC_BODY | class ArpModification(obj.ProfileModification):
@classmethod
def modify(cls, profile):
FILL_FUNC_BODY | profile.add_overlay(arp_overlay)
| profile.add_overlay(arp_overlay)
| 1 | 37 | 19 | 56 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,271 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_afinfo.py | 41,42 | 29,119 | CreateChecks | CheckAFInfo | 48,82 | 42,82 | class CheckAFInfo(common.LinuxPlugin):
"""Verifies the operation function pointers of network protocols."""
__name = "check_afinfo"
table_header = [
dict(name="symbol", width=30),
dict(name="member", width=30),
dict(name="address", style="address"),
dict(name="module")
... | class CheckAFInfo(common.LinuxPlugin):
"""Verifies the operation function pointers of network protocols."""
__name = "check_afinfo"
table_header = [
dict(name="symbol", width=30),
dict(name="member", width=30),
dict(name="address", style="address"),
dict(name="module")
... | # Older kernels have the operations in the structs.
members = sorted(self.profile.file_operations().members.keys())
if self.profile.has_type("seq_operations"):
# Newer kernels use seq_ops struct.
members.extend(["seq_ops.%s" % x
for x in self.p... | """Builds the sequence of function checks we need to look at.
We support multiple kernels by adding a bunch of function names which
may not exisit on the current kernel. This is expected as the code
simply ignores struct members which are not defined on this kernel.
"""
... | 63 | 526 | 361 | 887 | # Rekall Memory Forensics
#
# This file is part of Rekall Memory Forensics.
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundatio... | # Rekall Memory Forensics
#
# This file is part of Rekall Memory Forensics.
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundatio... |
36,272 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_creds.py | 40,42 | 30,64 | is_active | CheckCreds | 42,51 | 42,51 | class CheckCreds(common.LinProcessFilter):
"""Checks if any processes are sharing credential structures"""
__name = "check_creds"
table_header = [
dict(name="task", width=40),
dict(name="cred", style="address"),
]
@classmethod
def is_active(cls, config):
FILL_FUNC_BODY def ... | class CheckCreds(common.LinProcessFilter):
"""Checks if any processes are sharing credential structures"""
__name = "check_creds"
table_header = [
dict(name="task", width=40),
dict(name="cred", style="address"),
]
@classmethod
def is_active(cls, config):
FILL_FUNC_BODY def ... | if super(CheckCreds, cls).is_active(config):
try:
# This only exists if the task_struct has a cred member.
config.profile.get_obj_offset("task_struct", "cred")
return True
except KeyError:
return False
| if super(CheckCreds, cls).is_active(config):
try:
# This only exists if the task_struct has a cred member.
config.profile.get_obj_offset("task_struct", "cred")
return True
except KeyError:
return False
| 23 | 210 | 82 | 292 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version... |
36,273 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_idt.py | 64,65 | 33,104 | CheckIDTTables | CheckIdt | 69,90 | 65,90 | class CheckIdt(common.LinuxPlugin):
""" Checks if the IDT has been altered """
__name = "check_idt"
table_header = [
dict(name="index", style="address"),
dict(name="address", style="address"),
dict(name="type", width=18, align="r"),
dict(name="present", width=7, align="r"),... | class CheckIdt(common.LinuxPlugin):
""" Checks if the IDT has been altered """
__name = "check_idt"
table_header = [
dict(name="index", style="address"),
dict(name="address", style="address"),
dict(name="type", width=18, align="r"),
dict(name="present", width=7, align="r"),... | # arch/x86/include/asm/desc_defs.h
# hw handlers + system call
if self.profile.metadata('arch') == "I386":
idt_type = "desc_struct"
else:
idt_type = "gate_struct64"
# idt_table is defined in arch/x86/kernel/traps.c for 32-bit kernels
# and in arch... | """
This works by walking the IDT table for the entries that Linux uses
and verifies that each is a symbol in the kernel
"""
# arch/x86/include/asm/desc_defs.h
# hw handlers + system call
if self.profile.metadata('arch') == "I386":
idt_type = "desc_str... | 60 | 485 | 267 | 752 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... |
36,274 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_modules.py | 72,73 | 32,90 | collect | CheckModules | 73,90 | 73,90 | class CheckModules(common.LinuxPlugin):
"""Compares module list to sysfs info, if available.
Sysfs contains a kset objects for a number of kernel objects (kobjects). One
of the ksets is the "module_kset" which holds references to all loaded
kernel modules.
Each struct module object holds within it... | class CheckModules(common.LinuxPlugin):
"""Compares module list to sysfs info, if available.
Sysfs contains a kset objects for a number of kernel objects (kobjects). One
of the ksets is the "module_kset" which holds references to all loaded
kernel modules.
Each struct module object holds within it... | lsmod = self.session.plugins.lsmod(session=self.session)
# We check the container module for membership so we do not get fulled
# by simple name clashes.
modules = set(lsmod.get_module_list())
for kobj in self.get_kset_modules():
ref_count = kobj.kref.refcount.refco... | lsmod = self.session.plugins.lsmod(session=self.session)
# We check the container module for membership so we do not get fulled
# by simple name clashes.
modules = set(lsmod.get_module_list())
for kobj in self.get_kset_modules():
ref_count = kobj.kref.refcount.refco... | 59 | 452 | 203 | 655 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... |
36,275 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_syscall.py | 144,145 | 33,173 | collect | CheckSyscall | 149,173 | 145,173 | class CheckSyscall(common.LinuxPlugin):
"""Checks if the system call table has been altered."""
__name = "check_syscall"
table_header = [
dict(name="divider", type="Divider"),
dict(name="table", hidden=True),
dict(name="index", style="address"),
dict(name="address", style="... | class CheckSyscall(common.LinuxPlugin):
"""Checks if the system call table has been altered."""
__name = "check_syscall"
table_header = [
dict(name="divider", type="Divider"),
dict(name="table", hidden=True),
dict(name="index", style="address"),
dict(name="address", style="... | for table_name, table_size in self.Find_sys_call_tables():
# The syscall table is simply an array of pointers to functions.
table = self.profile.get_constant_object(
table_name,
target="Array",
target_args=dict(
count=t... | """
This works by walking the system call table
and verifies that each is a symbol in the kernel
"""
for table_name, table_size in self.Find_sys_call_tables():
# The syscall table is simply an array of pointers to functions.
table = self.profile.get_const... | 59 | 1,454 | 254 | 1,708 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... |
36,276 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/check_tty.py | 51,52 | 30,75 | CheckTTYs | CheckTTY | 52,70 | 52,70 | class CheckTTY(common.LinuxPlugin):
"""Checks tty devices for hooks.
Some malware insert a hook into the ops struct of the tty driver. This
plugin enumerates all tty_struct objects and checks if their ops handlers
have been subverted.
"""
__name = "check_ttys"
table_header = [
dict... | class CheckTTY(common.LinuxPlugin):
"""Checks tty devices for hooks.
Some malware insert a hook into the ops struct of the tty driver. This
plugin enumerates all tty_struct objects and checks if their ops handlers
have been subverted.
"""
__name = "check_ttys"
table_header = [
dict... | drivers_list = self.profile.get_constant_object(
"tty_drivers", target="list_head", vm=self.kernel_address_space)
resolver = self.session.address_resolver
for driver in drivers_list.list_of_type("tty_driver", "tty_drivers"):
for tty in driver.ttys:
if not... | drivers_list = self.profile.get_constant_object(
"tty_drivers", target="list_head", vm=self.kernel_address_space)
resolver = self.session.address_resolver
for driver in drivers_list.list_of_type("tty_driver", "tty_drivers"):
for tty in driver.ttys:
if not... | 47 | 297 | 206 | 503 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribute this... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribute this... |
36,277 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/cpuinfo.py | 37,38 | 29,45 | collect | Banner | 38,45 | 38,45 | class Banner(common.LinuxPlugin):
"""Prints the Linux banner information."""
__name = "banner"
table_header = [
dict(name="banner", width=80)
]
def collect(self):
FILL_FUNC_BODY | class Banner(common.LinuxPlugin):
"""Prints the Linux banner information."""
__name = "banner"
table_header = [
dict(name="banner", width=80)
]
def collect(self):
FILL_FUNC_BODY |
banner = self.profile.get_constant_object(
"linux_banner", target="String", vm=self.kernel_address_space)
yield dict(banner=banner)
|
banner = self.profile.get_constant_object(
"linux_banner", target="String", vm=self.kernel_address_space)
yield dict(banner=banner)
| 8 | 74 | 60 | 134 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,278 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/cpuinfo.py | 133,134 | 45,137 | collect | CpuInfo | 134,137 | 134,137 | class CpuInfo(common.LinuxPlugin):
"""Prints information about each active processor."""
__name = "cpuinfo"
table_header = [
dict(name="CPU", width=4),
dict(name="vendor", width=20),
dict(name="model", width=80)
]
def online_cpus(self):
"""returns a list of online ... | class CpuInfo(common.LinuxPlugin):
"""Prints information about each active processor."""
__name = "cpuinfo"
table_header = [
dict(name="CPU", width=4),
dict(name="vendor", width=20),
dict(name="model", width=80)
]
def online_cpus(self):
"""returns a list of online ... | for processor, cpu in self.calculate():
yield dict(CPU=processor, vendor=cpu.x86_vendor_id,
model=cpu.x86_model_id)
| for processor, cpu in self.calculate():
yield dict(CPU=processor, vendor=cpu.x86_vendor_id,
model=cpu.x86_model_id)
| 9 | 924 | 51 | 975 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,279 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/dmesg.py | 43,44 | 31,80 | collect | LinuxDmesg | 44,80 | 44,80 | class LinuxDmesg(common.LinuxPlugin):
'''Gathers dmesg buffer.'''
__name = "dmesg"
table_header = [
dict(name="timestamp", width=16),
dict(name="facility", width=2),
dict(name="level", width=2),
dict(name="message", width=80)
]
def collect(self):
FILL_FUNC_BODY | class LinuxDmesg(common.LinuxPlugin):
'''Gathers dmesg buffer.'''
__name = "dmesg"
table_header = [
dict(name="timestamp", width=16),
dict(name="facility", width=2),
dict(name="level", width=2),
dict(name="message", width=80)
]
def collect(self):
FILL_FUNC_BODY | if self.profile.get_obj_size("log"):
# Linux 3.x uses a log struct to keep log messages. In this case the
# log is a pointer to a variable length array of log messages.
dmesg = self.profile.get_constant_object(
"log_buf",
vm=self.kernel_address... | if self.profile.get_obj_size("log"):
# Linux 3.x uses a log struct to keep log messages. In this case the
# log is a pointer to a variable length array of log messages.
dmesg = self.profile.get_constant_object(
"log_buf",
vm=self.kernel_address... | 85 | 120 | 380 | 500 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,281 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/fs.py | 241,242 | 226,284 | collect | Mcat | 242,284 | 242,284 | class Mcat(core.DirectoryDumperMixin, Mfind):
"""Returns the contents available in memory for a given file.
Ranges of the file that are not present in memory are returned blank.
"""
__name = "mcat"
table_header = [
dict(name="start", width=12),
dict(name="end", width=12),
... | class Mcat(core.DirectoryDumperMixin, Mfind):
"""Returns the contents available in memory for a given file.
Ranges of the file that are not present in memory are returned blank.
"""
__name = "mcat"
table_header = [
dict(name="start", width=12),
dict(name="end", width=12),
... | renderer = self.session.GetRenderer()
for file_info in super(Mcat, self).collect():
file_obj = file_info.get("file")
if not file_obj:
continue
page_size = self.session.kernel_address_space.PAGE_SIZE
buffer_size = 1024*1024
buff... | renderer = self.session.GetRenderer()
for file_info in super(Mcat, self).collect():
file_obj = file_info.get("file")
if not file_obj:
continue
page_size = self.session.kernel_address_space.PAGE_SIZE
buffer_size = 1024*1024
buff... | 116 | 148 | 449 | 597 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,282 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/fs.py | 107,108 | 78,197 | find | Mfind | 114,159 | 108,159 | class Mfind(common.LinuxPlugin):
"""Finds a file by name in memory."""
__name = "mfind"
__args = [
dict(name="path", default="/", positional=True,
help="Path to the file."),
dict(name="device",
help="Name of the device to match.")
]
table_header = [
... | class Mfind(common.LinuxPlugin):
"""Finds a file by name in memory."""
__name = "mfind"
__args = [
dict(name="path", default="/", positional=True,
help="Path to the file."),
dict(name="device",
help="Name of the device to match.")
]
table_header = [
... |
if not mountpoint:
mount_plugin = self.session.plugins.mount(session=self.session)
mountpoints = mount_plugin.get_mount_points()
else:
mountpoints = [mountpoint]
for mountpoint in mountpoints:
if device != None and mountpoint.device != device:
... | """Yields a list of files matching the path on the given mountpoint.
If no mountpoint is specified, all mountpoints are searched.
This is akin to doing ls -ld, except that a list is returned because
several mount points may hold files which are candidates for such path.
"""
... | 107 | 823 | 397 | 1,220 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,283 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/fs.py | 209,210 | 197,226 | collect | Mls | 210,226 | 210,226 | class Mls(Mfind):
"""Lists the files in a mounted filesystem."""
__name = "mls"
__args = [
dict(name="recursive", type="Boolean",
help="Recursive listing"),
dict(name="unallocated", type="Boolean",
help="Show files that have no inode information."),
]
def... | class Mls(Mfind):
"""Lists the files in a mounted filesystem."""
__name = "mls"
__args = [
dict(name="recursive", type="Boolean",
help="Recursive listing"),
dict(name="unallocated", type="Boolean",
help="Show files that have no inode information."),
]
def... | for file_info in super(Mls, self).collect():
entry = file_info.get("file")
if entry:
yield dict(
divider="Files on device %s mounted at %s.\n" % (
entry.mountpoint.device, entry.mountpoint.name))
if not entry.is... | for file_info in super(Mls, self).collect():
entry = file_info.get("file")
if entry:
yield dict(
divider="Files on device %s mounted at %s.\n" % (
entry.mountpoint.device, entry.mountpoint.name))
if not entry.is... | 39 | 115 | 179 | 294 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,284 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/ifconfig.py | 59,60 | 30,81 | gather_net_dev_info | Ifconfig | 60,64 | 60,64 | class Ifconfig(common.LinuxPlugin):
'''Gathers active interfaces.'''
__name = "ifconfig"
table_header = [
dict(name="interface", width=16),
dict(name="ipv4", width=20),
dict(name="MAC", width=18),
dict(name="flags", width=20)
]
def enumerate_devices(self):
... | class Ifconfig(common.LinuxPlugin):
'''Gathers active interfaces.'''
__name = "ifconfig"
table_header = [
dict(name="interface", width=16),
dict(name="ipv4", width=20),
dict(name="MAC", width=18),
dict(name="flags", width=20)
]
def enumerate_devices(self):
... | mac_addr = net_dev.mac_addr
for dev in net_dev.ip_ptr.ifa_list.walk_list("ifa_next"):
yield dev.ifa_label, dev.ifa_address, mac_addr, net_dev.flags
| mac_addr = net_dev.mac_addr
for dev in net_dev.ip_ptr.ifa_list.walk_list("ifa_next"):
yield dev.ifa_label, dev.ifa_address, mac_addr, net_dev.flags
| 12 | 478 | 68 | 546 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,285 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/iomem.py | 39,40 | 27,74 | GetResources | IOmem | 40,48 | 40,48 | class IOmem(common.LinuxPlugin):
'''mimics /proc/iomem.'''
__name = "iomem"
table_header = [
dict(name="resource", style="address"),
dict(name="start", style="address"),
dict(name="end", style="address"),
dict(name="name", type="TreeNode"),
]
def GetResources(self)... | class IOmem(common.LinuxPlugin):
'''mimics /proc/iomem.'''
__name = "iomem"
table_header = [
dict(name="resource", style="address"),
dict(name="start", style="address"),
dict(name="end", style="address"),
dict(name="name", type="TreeNode"),
]
def GetResources(self)... | # Resources are organized in a tree structure.
resource_tree_root = self.profile.get_constant_object(
"iomem_resource", target="resource")
seen = set()
return self._GetResources(resource_tree_root, seen)
| # Resources are organized in a tree structure.
resource_tree_root = self.profile.get_constant_object(
"iomem_resource", target="resource")
seen = set()
return self._GetResources(resource_tree_root, seen)
| 19 | 320 | 76 | 396 | # Rekall Memory Forensics
#
# Copyright Digital Forensics Solutions.
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | # Rekall Memory Forensics
#
# Copyright Digital Forensics Solutions.
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... |
36,286 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/keepassx.py | 58,59 | 40,147 | collect | Keepassx | 59,147 | 59,147 | class Keepassx(heap_analysis.HeapAnalysis):
"""Gathers password entries for keepassx.
The retrieved content of those entries comprises the username, title, URL
and Comment."""
name = "keepassx"
table_header = [
dict(name="divider", type="Divider"),
dict(name="task", hidden=True),
... | class Keepassx(heap_analysis.HeapAnalysis):
"""Gathers password entries for keepassx.
The retrieved content of those entries comprises the username, title, URL
and Comment."""
name = "keepassx"
table_header = [
dict(name="divider", type="Divider"),
dict(name="task", hidden=True),
... | for task in self.filter_processes():
if self.init_for_task(task):
yield dict(divider="Task: %s (%s)" % (task.name,
task.pid))
chunks_dict = dict()
data_offset = self.profile.get_obj_offset("mallo... | for task in self.filter_processes():
if self.init_for_task(task):
yield dict(divider="Task: %s (%s)" % (task.name,
task.pid))
chunks_dict = dict()
data_offset = self.profile.get_obj_offset("mallo... | 277 | 188 | 994 | 1,182 | # Gathers information about password entries for keepassx
#
# Copyright (c) 2018, Frank Block, ERNW GmbH <fblock@ernw.de>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
... | # Gathers information about password entries for keepassx
#
# Copyright (c) 2018, Frank Block, ERNW GmbH <fblock@ernw.de>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
... |
36,287 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsmod.py | 42,43 | 31,58 | get_module_list | Lsmod | 43,50 | 43,50 | class Lsmod(common.LinuxPlugin):
'''Gathers loaded kernel modules.'''
name = "lsmod"
table_header = [
dict(name="virtual", style="address"),
dict(name="start", style="address"),
dict(name="size", width=10),
dict(name="name", width=20)
]
def get_module_list(self):
FI... | class Lsmod(common.LinuxPlugin):
'''Gathers loaded kernel modules.'''
name = "lsmod"
table_header = [
dict(name="virtual", style="address"),
dict(name="start", style="address"),
dict(name="size", width=10),
dict(name="name", width=20)
]
def get_module_list(self):
FI... | modules = self.profile.get_constant_object(
"modules", target="list_head", vm=self.kernel_address_space)
# walk the modules list
for module in modules.list_of_type("module", "list"):
yield module
| modules = self.profile.get_constant_object(
"modules", target="list_head", vm=self.kernel_address_space)
# walk the modules list
for module in modules.list_of_type("module", "list"):
yield module
| 18 | 170 | 75 | 245 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,288 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsmod.py | 75,76 | 58,82 | collect | LsmodSections | 76,82 | 76,82 | class LsmodSections(common.LinuxPlugin):
"""Display all the ELF sections of kernel modules."""
name = "lsmod_sections"
table_header = [
dict(name="name", width=20),
dict(name="section", width=30),
dict(name="address", style="address")
]
def get_module_sections(self, module... | class LsmodSections(common.LinuxPlugin):
"""Display all the ELF sections of kernel modules."""
name = "lsmod_sections"
table_header = [
dict(name="name", width=20),
dict(name="section", width=30),
dict(name="address", style="address")
]
def get_module_sections(self, module... | lsmod = self.session.plugins.lsmod()
for module in lsmod.get_module_list():
for section_attr in self.get_module_sections(module):
yield (module.name, section_attr.name.deref(),
section_attr.address)
| lsmod = self.session.plugins.lsmod()
for module in lsmod.get_module_list():
for section_attr in self.get_module_sections(module):
yield (module.name, section_attr.name.deref(),
section_attr.address)
| 15 | 177 | 77 | 254 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,289 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsmod.py | 117,118 | 82,182 | get_module_parameters | Lsmod_parameters | 118,175 | 118,175 | class Lsmod_parameters(common.LinuxPlugin):
"""Display parameters for all kernel modules."""
name = "lsmod_parameters"
_arg_lookuptable = {
"linux!param_get_bool": ("bool", {}),
"linux!param_get_byte": ("char", {}),
"linux!param_get_charp": ("Pointer", dict(target="String")),
... | class Lsmod_parameters(common.LinuxPlugin):
"""Display parameters for all kernel modules."""
name = "lsmod_parameters"
_arg_lookuptable = {
"linux!param_get_bool": ("bool", {}),
"linux!param_get_byte": ("char", {}),
"linux!param_get_charp": ("Pointer", dict(target="String")),
... | for kernel_param in module.m("kp"):
if kernel_param.getter_addr == None:
continue
getter_function = self.profile.Function(
offset=kernel_param.getter_addr,
vm=self.kernel_address_space)
value = None
lookup = self.a... | for kernel_param in module.m("kp"):
if kernel_param.getter_addr == None:
continue
getter_function = self.profile.Function(
offset=kernel_param.getter_addr,
vm=self.kernel_address_space)
value = None
lookup = self.a... | 139 | 493 | 627 | 1,120 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,290 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsmod.py | 198,199 | 182,218 | render | Moddump | 199,218 | 199,218 | class Moddump(common.LinuxPlugin):
'''Dumps loaded kernel modules.'''
__name = "moddump"
__args = [
dict(name="dump_dir", help="Dump directory.",
required=True),
dict(name="regexp", default=None, type="RegEx",
help="Regexp on the module name.")
]
def dump... | class Moddump(common.LinuxPlugin):
'''Dumps loaded kernel modules.'''
__name = "moddump"
__args = [
dict(name="dump_dir", help="Dump directory.",
required=True),
dict(name="regexp", default=None, type="RegEx",
help="Regexp on the module name.")
]
def dump... | lsmod_plugin = self.session.plugins.lsmod(session=self.session)
for module in lsmod_plugin.get_module_list():
if self.plugin_args.regexp:
if not module.name:
continue
if not self.plugin_args.regexp.search(module.name):
... | lsmod_plugin = self.session.plugins.lsmod(session=self.session)
for module in lsmod_plugin.get_module_list():
if self.plugin_args.regexp:
if not module.name:
continue
if not self.plugin_args.regexp.search(module.name):
... | 38 | 162 | 231 | 393 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,291 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsof.py | 67,68 | 34,83 | collect | Lsof | 68,83 | 68,83 | class Lsof(common.LinProcessFilter):
"""Lists open files."""
__name = "lsof"
table_header = [
dict(name="divider", type="Divider"),
dict(name="proc", hidden=True),
dict(name="file_struct", hidden=True),
dict(name="name", width=30),
dict(name="pid", width=6, align="r... | class Lsof(common.LinProcessFilter):
"""Lists open files."""
__name = "lsof"
table_header = [
dict(name="divider", type="Divider"),
dict(name="proc", hidden=True),
dict(name="file_struct", hidden=True),
dict(name="name", width=30),
dict(name="pid", width=6, align="r... | for task in self.filter_processes():
yield dict(divider=task)
for file_struct, fd in self.get_open_files(task):
yield dict(proc=task,
name=task.comm,
pid=task.pid,
user=task.uid,
... | for task in self.filter_processes():
yield dict(divider=task)
for file_struct, fd in self.get_open_files(task):
yield dict(proc=task,
name=task.comm,
pid=task.pid,
user=task.uid,
... | 22 | 359 | 189 | 548 | # Rekall Memory Forensics
#
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Versi... | # Rekall Memory Forensics
#
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Versi... |
36,292 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/lsof.py | 84,86 | 83,92 | is_active | TestLsof | 86,88 | 86,88 | class TestLsof(testlib.SimpleTestCase):
@classmethod
def is_active(cls, session):
FILL_FUNC_BODY PARAMETERS = dict(
commandline="lsof --proc_regex %(proc_name)s",
proc_name="bash"
)
| class TestLsof(testlib.SimpleTestCase):
@classmethod
def is_active(cls, session):
FILL_FUNC_BODY PARAMETERS = dict(
commandline="lsof --proc_regex %(proc_name)s",
proc_name="bash"
)
| return Lsof.is_active(session)
| return Lsof.is_active(session)
| 2 | 81 | 16 | 97 | # Rekall Memory Forensics
#
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Versi... | # Rekall Memory Forensics
#
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Versi... |
36,293 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/mount.py | 44,45 | 33,169 | get_mount_points | Mount | 45,153 | 45,153 | class Mount(common.LinuxPlugin):
"""Lists the mount points."""
__name = "mount"
table_header = [
dict(name="Device", width=50),
dict(name="Path", width=50),
dict(name="Type", width=14),
dict(name="flags", width=20),
]
def get_mount_points(self):
FILL_FUNC_BODY de... | class Mount(common.LinuxPlugin):
"""Lists the mount points."""
__name = "mount"
table_header = [
dict(name="Device", width=50),
dict(name="Path", width=50),
dict(name="Type", width=14),
dict(name="flags", width=20),
]
def get_mount_points(self):
FILL_FUNC_BODY de... | if self.profile.get_constant("set_mphash_entries"):
# Kernel 3.14 starts using an hlist_head instead of a list_head
mnttype = "mount"
mount_hashtable_target_type = "hlist_head"
elif self.profile.has_type("mount"):
# Kernel 3.3 makes mount_hashtable be a ta... | if self.profile.get_constant("set_mphash_entries"):
# Kernel 3.14 starts using an hlist_head instead of a list_head
mnttype = "mount"
mount_hashtable_target_type = "hlist_head"
elif self.profile.has_type("mount"):
# Kernel 3.3 makes mount_hashtable be a ta... | 370 | 279 | 1,478 | 1,757 | from __future__ import division
# Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | from __future__ import division
# Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... |
36,294 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/netstat.py | 32,33 | 27,120 | sockets | Netstat | 34,50 | 33,50 | class Netstat(common.LinuxPlugin):
"""Print the active network connections."""
__name = "netstat"
def sockets(self):
FILL_FUNC_BODY def render(self, renderer):
unix_sockets = []
inet_sockets = []
for task, fd, sock, iaddr in self.sockets():
inet_sock = sock.derefere... | class Netstat(common.LinuxPlugin):
"""Print the active network connections."""
__name = "netstat"
def sockets(self):
"""Enumerate all socket objects."""
FILL_FUNC_BODY def render(self, renderer):
unix_sockets = []
inet_sockets = []
for task, fd, sock, iaddr in self.sock... |
lsof = self.session.plugins.lsof(session=self.session)
for task, file_struct, fd in lsof.lsof():
if (file_struct.f_op == self.profile.get_constant(
"socket_file_ops", is_address=True) or
file_struct.m("d_entry").d_op == self.profile.get_constant(
... | """Enumerate all socket objects."""
lsof = self.session.plugins.lsof(session=self.session)
for task, file_struct, fd in lsof.lsof():
if (file_struct.f_op == self.profile.get_constant(
"socket_file_ops", is_address=True) or
file_struct.m("d_entry").d_o... | 37 | 854 | 241 | 1,095 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,295 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/netstat.py | 164,165 | 120,178 | render | PacketQueues | 165,178 | 165,178 | class PacketQueues(common.LinuxPlugin):
"""Dumps the current packet queues for all known open sockets."""
__name = "pkt_queues"
@classmethod
def args(cls, parser):
super(PacketQueues, cls).args(parser)
parser.add_argument(
"--dump_dir", default=None, help="Output directory"... | class PacketQueues(common.LinuxPlugin):
"""Dumps the current packet queues for all known open sockets."""
__name = "pkt_queues"
@classmethod
def args(cls, parser):
super(PacketQueues, cls).args(parser)
parser.add_argument(
"--dump_dir", default=None, help="Output directory"... | netstat_plugin = self.session.plugins.netstat(session=self.session)
sockets = netstat_plugin.sockets()
all_sockets = list(sockets)
skipped_sockets_count = 0
for task, fd, socket, _ in all_sockets:
if not self.process_socket(renderer, task, fd, socket):
... | netstat_plugin = self.session.plugins.netstat(session=self.session)
sockets = netstat_plugin.sockets()
all_sockets = list(sockets)
skipped_sockets_count = 0
for task, fd, socket, _ in all_sockets:
if not self.process_socket(renderer, task, fd, socket):
... | 33 | 507 | 162 | 669 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... |
36,296 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/pas2kas.py | 31,32 | 30,35 | GetTaskStruct | LinPas2VasResolver | 32,35 | 32,35 | class LinPas2VasResolver(pas2kas.Pas2VasResolver):
def GetTaskStruct(self, address):
FILL_FUNC_BODY | class LinPas2VasResolver(pas2kas.Pas2VasResolver):
def GetTaskStruct(self, address):
FILL_FUNC_BODY | return self.session.profile.task_struct(address)
| return self.session.profile.task_struct(address)
| 2 | 44 | 20 | 64 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,297 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/pas2kas.py | 40,41 | 35,42 | calculate | LinPas2VasResolverHook | 41,42 | 41,42 | class LinPas2VasResolverHook(common.AbstractLinuxParameterHook):
"""Provide the Pas2Vas resolver."""
name = "physical_address_resolver"
def calculate(self):
FILL_FUNC_BODY | class LinPas2VasResolverHook(common.AbstractLinuxParameterHook):
"""Provide the Pas2Vas resolver."""
name = "physical_address_resolver"
def calculate(self):
FILL_FUNC_BODY | return LinPas2VasResolver(session=self.session)
| return LinPas2VasResolver(session=self.session)
| 2 | 62 | 18 | 80 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... |
36,298 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/psaux.py | 35,36 | 30,44 | render | PSAux | 36,44 | 36,44 | class PSAux(common.LinProcessFilter):
"""Gathers processes along with full command line and start time."""
__name = "psaux"
def render(self, renderer):
FILL_FUNC_BODY | class PSAux(common.LinProcessFilter):
"""Gathers processes along with full command line and start time."""
__name = "psaux"
def render(self, renderer):
FILL_FUNC_BODY | renderer.table_header([
("PID", "pid", "5"),
("UID", "uid", "5"),
("GID", "gid", "5"),
("Command", "command", "50")])
for task in self.filter_processes():
renderer.table_row(task.pid, task.uid, task.gid, task.commandline)
| renderer.table_header([
("PID", "pid", "5"),
("UID", "uid", "5"),
("GID", "gid", "5"),
("Command", "command", "50")])
for task in self.filter_processes():
renderer.table_row(task.pid, task.uid, task.gid, task.commandline)
| 21 | 59 | 106 | 165 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... |
36,299 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/pstree.py | 38,39 | 30,62 | render | LinPSTree | 39,54 | 39,54 | class LinPSTree(common.LinuxPlugin):
"""Shows the parent/child relationship between processes.
This plugin prints a parent/child relationship tree by walking the
task_struct.children and task_struct.sibling members.
"""
__name = "pstree"
def render(self, renderer):
FILL_FUNC_BODY def recurs... | class LinPSTree(common.LinuxPlugin):
"""Shows the parent/child relationship between processes.
This plugin prints a parent/child relationship tree by walking the
task_struct.children and task_struct.sibling members.
"""
__name = "pstree"
def render(self, renderer):
FILL_FUNC_BODY def recurs... | renderer.table_header([("Pid", "pid", ">6"),
("Ppid", "ppid", ">6"),
("Uid", "uid", ">6"),
("", "depth", "0"),
("Name", "name", "<30"),
])
root_task... | renderer.table_header([("Pid", "pid", ">6"),
("Ppid", "ppid", ">6"),
("Uid", "uid", ">6"),
("", "depth", "0"),
("Name", "name", "<30"),
])
root_task... | 35 | 182 | 181 | 363 | # This file is part of Rekall Memory Forensics.
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Fre... | # This file is part of Rekall Memory Forensics.
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Fre... |
36,300 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/psxview.py | 42,43 | 27,63 | render | LinuxPsxView | 43,63 | 43,63 | class LinuxPsxView(common.LinProcessFilter):
"""Find hidden processes comparing various process listings."""
__name = "psxview"
METHODS = common.LinProcessFilter.METHODS + [
"PidHashTable",
]
__args = [
dict(name="method", choices=list(METHODS), type="ChoiceArray",
de... | class LinuxPsxView(common.LinProcessFilter):
"""Find hidden processes comparing various process listings."""
__name = "psxview"
METHODS = common.LinProcessFilter.METHODS + [
"PidHashTable",
]
__args = [
dict(name="method", choices=list(METHODS), type="ChoiceArray",
de... | headers = [('Offset(V)', 'virtual_offset', '[addrpad]'),
('Name', 'name', '<20'),
('PID', 'pid', '>12'),
]
for method in self.plugin_args.method:
headers.append((method, method, "%s" % len(method)))
renderer.table_header(heade... | headers = [('Offset(V)', 'virtual_offset', '[addrpad]'),
('Name', 'name', '<20'),
('PID', 'pid', '>12'),
]
for method in self.plugin_args.method:
headers.append((method, method, "%s" % len(method)))
renderer.table_header(heade... | 41 | 140 | 206 | 346 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... |
36,301 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/linux/psxview.py | 66,67 | 63,74 | calculate | PidHashTableHook | 67,74 | 67,74 | class PidHashTableHook(common.AbstractLinuxParameterHook):
name = "pslist_PidHashTable"
def calculate(self):
FILL_FUNC_BODY | class PidHashTableHook(common.AbstractLinuxParameterHook):
name = "pslist_PidHashTable"
def calculate(self):
FILL_FUNC_BODY | seen = set()
pidhashtable_plugin = self.session.plugins.pidhashtable()
for task in pidhashtable_plugin.filter_processes():
if task.obj_offset not in seen:
seen.add(task.obj_offset)
return seen
| seen = set()
pidhashtable_plugin = self.session.plugins.pidhashtable()
for task in pidhashtable_plugin.filter_processes():
if task.obj_offset not in seen:
seen.add(task.obj_offset)
return seen
| 18 | 46 | 79 | 125 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... |
36,302 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 67,68 | 64,72 | calculate | AMD64Mode | 68,72 | 68,72 | class AMD64Mode(kb.ParameterHook):
name = "mode_amd64"
def calculate(self):
FILL_FUNC_BODY | class AMD64Mode(kb.ParameterHook):
name = "mode_amd64"
def calculate(self):
FILL_FUNC_BODY | if self.session.profile:
return self.session.profile.metadata("arch") == "AMD64"
| if self.session.profile:
return self.session.profile.metadata("arch") == "AMD64"
| 6 | 41 | 35 | 76 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,303 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 167,168 | 163,173 | calculate | DarwinMemoryMode | 168,173 | 168,173 | class DarwinMemoryMode(kb.ParameterHook):
"""Windows memory image or live windows."""
name = "mode_darwin_memory"
def calculate(self):
FILL_FUNC_BODY | class DarwinMemoryMode(kb.ParameterHook):
"""Windows memory image or live windows."""
name = "mode_darwin_memory"
def calculate(self):
FILL_FUNC_BODY | return (self.session.GetParameter("mode_live_memory") or
self.session.GetParameter("mode_image")) and (
self.session.GetParameter("mode_darwin"))
| return (self.session.GetParameter("mode_live_memory") or
self.session.GetParameter("mode_image")) and (
self.session.GetParameter("mode_darwin"))
| 7 | 52 | 54 | 106 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,304 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 91,92 | 88,96 | calculate | DarwinMode | 92,96 | 92,96 | class DarwinMode(kb.ParameterHook):
name = "mode_darwin"
def calculate(self):
FILL_FUNC_BODY | class DarwinMode(kb.ParameterHook):
name = "mode_darwin"
def calculate(self):
FILL_FUNC_BODY | if self.session.profile:
return self.session.profile.metadata("os") == "darwin"
| if self.session.profile:
return self.session.profile.metadata("os") == "darwin"
| 6 | 39 | 33 | 72 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,305 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 123,124 | 119,134 | calculate | ImageMode | 124,134 | 124,134 | class ImageMode(kb.ParameterHook):
"""Determines if we are reading from an image."""
name = "mode_image"
def calculate(self):
FILL_FUNC_BODY | class ImageMode(kb.ParameterHook):
"""Determines if we are reading from an image."""
name = "mode_image"
def calculate(self):
FILL_FUNC_BODY | # If there is no physical address space but a filename was specified we
# try to load the physical_address_space from the filename.
if (not self.session.physical_address_space and
self.session.GetParameter("filename")):
self.session.plugins.load_as().GetPhysicalAddressSpa... | # If there is no physical address space but a filename was specified we
# try to load the physical_address_space from the filename.
if (not self.session.physical_address_space and
self.session.GetParameter("filename")):
self.session.plugins.load_as().GetPhysicalAddressSpa... | 33 | 51 | 120 | 171 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,306 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 156,157 | 152,163 | calculate | LinMemoryMode | 157,163 | 157,163 | class LinMemoryMode(kb.ParameterHook):
"""Windows memory image or live windows."""
name = "mode_linux_memory"
def calculate(self):
FILL_FUNC_BODY | class LinMemoryMode(kb.ParameterHook):
"""Windows memory image or live windows."""
name = "mode_linux_memory"
def calculate(self):
FILL_FUNC_BODY | if self.session.profile:
return (self.session.GetParameter("mode_live_memory") or
self.session.GetParameter("mode_image")) and (
self.session.GetParameter("mode_linux"))
| if self.session.profile:
return (self.session.GetParameter("mode_live_memory") or
self.session.GetParameter("mode_image")) and (
self.session.GetParameter("mode_linux"))
| 9 | 50 | 63 | 113 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,307 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 83,84 | 80,88 | calculate | LinMode | 84,88 | 84,88 | class LinMode(kb.ParameterHook):
name = "mode_linux"
def calculate(self):
FILL_FUNC_BODY | class LinMode(kb.ParameterHook):
name = "mode_linux"
def calculate(self):
FILL_FUNC_BODY | if self.session.profile:
return self.session.profile.metadata("os") == "linux"
| if self.session.profile:
return self.session.profile.metadata("os") == "linux"
| 6 | 37 | 32 | 69 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,308 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 114,115 | 111,119 | calculate | LiveAPIMode | 115,119 | 115,119 | class LiveAPIMode(kb.ParameterHook):
name = "mode_live_api"
def calculate(self):
FILL_FUNC_BODY | class LiveAPIMode(kb.ParameterHook):
name = "mode_live_api"
def calculate(self):
FILL_FUNC_BODY | if self.session.profile:
return self.session.GetParameter("live_mode") == "API"
| if self.session.profile:
return self.session.GetParameter("live_mode") == "API"
| 6 | 41 | 33 | 74 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,309 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 107,108 | 104,111 | calculate | LiveMemoryMode | 108,111 | 108,111 | class LiveMemoryMode(kb.ParameterHook):
name = "mode_live_memory"
def calculate(self):
FILL_FUNC_BODY | class LiveMemoryMode(kb.ParameterHook):
name = "mode_live_memory"
def calculate(self):
FILL_FUNC_BODY | return self.session.GetParameter("live_mode") == "Memory"
| return self.session.GetParameter("live_mode") == "Memory"
| 4 | 40 | 23 | 63 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
36,310 | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall | /home/hieuvd/dung_repo/raw/stars_02/google_rekall/rekall/rekall-core/rekall/plugins/modes.py | 99,100 | 96,104 | calculate | LiveMode | 100,104 | 100,104 | class LiveMode(kb.ParameterHook):
name = "mode_live"
def calculate(self):
FILL_FUNC_BODY | class LiveMode(kb.ParameterHook):
name = "mode_live"
def calculate(self):
FILL_FUNC_BODY | return bool(self.session.GetParameter("live_mode"))
| return bool(self.session.GetParameter("live_mode"))
| 2 | 37 | 23 | 60 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later ver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.