Exemplo n.º 1
0
Arquivo: start.py Projeto: VYRNACH/MAD
def start_mitm_receiver(received_mapped, auths):
    from mitm_receiver.MITMReceiver import MITMReceiver
    mapping = {}
    mitm_receiver = MITMReceiver(args.mitmreceiver_ip,
                                 int(args.mitmreceiver_port), received_mapped,
                                 args, auths)
    mitm_receiver.run_receiver()
Exemplo n.º 2
0
                sys.exit(0)

            pogoWindowManager = None
            jobstatus: dict = {}
            MitmMapperManager.register('MitmMapper', MitmMapper)
            mitm_mapper_manager = MitmMapperManager()
            mitm_mapper_manager.start()
            mitm_mapper: MitmMapper = mitm_mapper_manager.MitmMapper(
                mapping_manager, db_wrapper)

            from ocr.pogoWindows import PogoWindows
            pogoWindowManager = PogoWindows(args.temp_path,
                                            args.ocr_thread_count)

            mitm_receiver_process = MITMReceiver(args.mitmreceiver_ip,
                                                 int(args.mitmreceiver_port),
                                                 mitm_mapper, args,
                                                 mapping_manager, db_wrapper)
            mitm_receiver_process.start()

            logger.info('Starting websocket server on port {}'.format(
                str(args.ws_port)))
            ws_server = WebsocketServer(args, mitm_mapper, db_wrapper,
                                        mapping_manager, pogoWindowManager)
            t_ws = Thread(name='scanner', target=ws_server.start_server)
            t_ws.daemon = False
            t_ws.start()

            # init jobprocessor
            device_Updater = deviceUpdater(ws_server, args, jobstatus)

            webhook_worker = None
Exemplo n.º 3
0
                sys.exit(1)

            mitm_mapper = MitmMapper(device_mappings)
            ocr_enabled = False
            for routemanager in routemanagers.keys():
                area = routemanagers.get(routemanager, None)
                if area is None:
                    continue
                if "ocr" in area.get("mode", ""):
                    ocr_enabled = True
            if ocr_enabled:
                from ocr.copyMons import MonRaidImages
                MonRaidImages.runAll(args.pogoasset, db_wrapper=db_wrapper)

            mitm_receiver = MITMReceiver(args.mitmreceiver_ip,
                                         int(args.mitmreceiver_port),
                                         mitm_mapper, args, auths, db_wrapper)
            t_mitm = Thread(name='mitm_receiver',
                            target=mitm_receiver.run_receiver)
            t_mitm.daemon = False
            t_mitm.start()

            log.info('Starting scanner....')
            ws_server = WebsocketServer(args, mitm_mapper, db_wrapper,
                                        routemanagers, device_mappings, auths)
            t_ws = Thread(name='scanner', target=ws_server.start_server)
            t_ws.daemon = True
            t_ws.start()

            log.info("Starting file watcher for mappings.json changes.")
            t_file_watcher = Thread(name='file_watcher',
Exemplo n.º 4
0
                if ("ocr" in area.get("mode", "") or "pokestop" in area.get("mode", "")) and args.no_ocr:
                    logger.error(
                        'No-OCR Mode is activated - No OCR Mode possible.')
                    logger.error(
                        'Check your config.ini and be sure that CV2 and Tesseract is installed')
                    sys.exit(1)

            if not args.no_ocr:
                from ocr.pogoWindows import PogoWindows
                pogoWindowManager = PogoWindows(args.temp_path, args.ocr_thread_count)

            if ocr_enabled:
                from ocr.copyMons import MonRaidImages
                MonRaidImages.runAll(args.pogoasset, db_wrapper=db_wrapper)

            mitm_receiver = MITMReceiver()
            t_mitm = Process(name='mitm_receiver',
                             target=mitm_receiver.run_receiver, args=(mitm_receiver, args.mitmreceiver_ip, int(args.mitmreceiver_port),
                                         mitm_mapper, args, auths))
            # t_mitm.daemon = True
            t_mitm.start()
            time.sleep(5)

            logger.info('Starting scanner')
            ws_server = WebsocketServer(args, mitm_mapper, db_wrapper,
                                        routemanagers, device_mappings, auths, pogoWindowManager)
            t_ws = Thread(name='scanner', target=ws_server.start_server)
            t_ws.daemon = False
            t_ws.start()

            webhook_worker = None
Exemplo n.º 5
0
Arquivo: start.py Projeto: na-ji/MAD
def start_mitm_receiver(mitm_mapper, auths, db_wrapper):
    from mitm_receiver.MITMReceiver import MITMReceiver
    mitm_receiver = MITMReceiver(args.mitmreceiver_ip,
                                 int(args.mitmreceiver_port), mitm_mapper,
                                 args, auths, db_wrapper)
    mitm_receiver.run_receiver()