def _load_config_file(self): fpath = bridge.pn(bridge.pjoin(bridge.get_root_path(), conf.proxy_config_file)) with open(fpath, 'rb') as f: blob = f.read() text = blob.decode('utf-8') info = json.loads(text) return info
def _run_you(self,arg): y_bin = bridge.pn(bridge.pjoin(bridge.get_root_path(), conf.bin_you_get)) py_bin = sys.executable args = [py_bin, y_bin] + arg PIPE = subprocess.PIPE print(args) p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE, shell=False) stdout, stderr = p.communicate() # try to decode stdout = bridge.try_decode(stdout) stderr = bridge.try_decode(stderr) #print(stdout) return stdout, stderr
def _run(self, arg, need_stderr=False): y_bin = bridge.pn(bridge.pjoin(bridge.get_root_path(), self.bin)) py_bin = sys.executable if "PyRun.exe" in py_bin: args = [py_bin, '--normal', y_bin] else: args = [py_bin, y_bin] args = args + arg PIPE = subprocess.PIPE logging.debug(args) p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE if need_stderr else None, shell=False) stdout, stderr = p.communicate() # try to decode stdout = bridge.try_decode(stdout) stderr = bridge.try_decode(stderr) if need_stderr else None # print(stdout) return stdout, stderr
def init(self): for n in range(3): if IsOpen(CONFIG["host"], CONFIG["port"]) and self.checkinit(): return else: self._run_kill_271_cmd5() for i in range(5): if not IsOpen(CONFIG["host"], CONFIG["port"]): time.sleep(1 + i) else: url = 'http://%s:%d/' % ( CONFIG["host"], CONFIG["port"]) + 'handwich_bridge/load_core?id=cmd5&path=' + urllib.parse.quote( bridge.pn(bridge.pjoin(bridge.get_root_path(), './lib/kill_271_cmd5/kill_271_cmd5.swf'))) if CONFIG["key"] != None: url += '?key=' + str(CONFIG["key"]) getUrl(url, allowCache=False, usePool=False) if self.checkinit(): return CONFIG["port"] += 1 raise Exception("can't init server")
datefmt='%H:%M:%S', stream=sys.stdout) import os import socket try: from .lib import bridge except Exception as e: from lib import bridge need_close = True if __name__ == '__main__': CONFIG["port"] = 8000 else: try: with open(bridge.pn(bridge.pjoin(bridge.get_root_path(), '../../../ver.txt'))) as f: ver = f.readline() if "2016" in ver or "2015" in ver: import ctypes MessageBox = ctypes.windll.user32.MessageBoxW MessageBox(None, '你的猎影版本太低,请更新你的猎影到最新版本!', '错误', 0x00000010) sys.exit(5) except SystemExit as e: raise e except: pass logging.info(bridge.pn(bridge.pjoin(bridge.get_root_path(), './run.py'))) if CONFIG["uuid"] in str(bridge.pn(bridge.pjoin(bridge.get_root_path(), './run.py'))).replace('_', '-'): need_close = False logging.info(need_close)
try: from .common import * except Exception as e: from common import * pool = Pool() try: from .lib import bridge except Exception as e: from lib import bridge import sys sys.path.insert( 0, bridge.pn(bridge.pjoin(bridge.get_root_path(), './lib/flask_lib'))) import re, threading, sys, json, os, time, logging, importlib from argparse import ArgumentParser try: from flask import Flask, request except Exception: from .flask import Flask, request app = Flask(__name__) version = { 'port_version': "0.5.0", 'type': 'parse', 'version': '0.7.0', 'uuid': '{C35B9DFC-559F-49E2-B80B-79B66EC77471}', 'filter': [],
# author wwqgtxx <*****@*****.**> try: from .common import * except Exception as e: from common import * pool = Pool() try: from .lib import bridge except Exception as e: from lib import bridge import sys sys.path.insert(0, bridge.pn(bridge.pjoin(bridge.get_root_path(), './lib/flask_lib'))) import re,threading,sys,json,os,time,logging,importlib from argparse import ArgumentParser try: from flask import Flask,request except Exception: from .flask import Flask,request app = Flask(__name__) version = { 'port_version' : "0.5.0", 'type' : 'parse', 'version' : '0.6.4',