Example #1
0
def get_device_manager():
    global _device_manager
    if _device_manager is None:
        from . import core
        try:
            import _frida
        except Exception as ex:
            import colorama
            from colorama import Back, Fore, Style
            import sys
            colorama.init(autoreset=True)
            print("")
            print("***")
            if str(ex).startswith("No module named "):
                print(Back.RED + Fore.WHITE + Style.BRIGHT +
                      "Frida native extension not found" + Style.RESET_ALL)
                print(Fore.WHITE + Style.BRIGHT +
                      "Please check your PYTHONPATH." + Style.RESET_ALL)
            else:
                print(Back.RED + Fore.WHITE + Style.BRIGHT +
                      "Failed to load the Frida native extension: %s" % ex +
                      Style.RESET_ALL)
                if sys.version_info[0] == 2:
                    current_python_version = "%d.%d" % sys.version_info[:2]
                else:
                    current_python_version = "%d.x" % sys.version_info[0]
                print(
                    Fore.WHITE + Style.BRIGHT +
                    "Please ensure that the extension was compiled for Python "
                    + current_python_version + "." + Style.RESET_ALL)
            print("***")
            print("")
            raise ex
        _device_manager = core.DeviceManager(_frida.DeviceManager())
    return _device_manager
Example #2
0
def get_device_manager():
    global _device_manager
    if _device_manager is None:
        from . import core
        import _frida
        _device_manager = core.DeviceManager(_frida.DeviceManager())
        _device_manager.enumerate_devices() # warm up
    return _device_manager
Example #3
0
def get_device_manager():
    global _device_manager
    if _device_manager is None:
        from . import core
        _device_manager = core.DeviceManager(_frida.DeviceManager())
    return _device_manager