|
| 1 | +From 4dfae62014575bd2d19d0adf072e00c3ddd7fffe Mon Sep 17 00:00:00 2001 |
| 2 | +From: pwnslinger < [email protected]> |
| 3 | +Date: Fri, 6 Jul 2018 15:22:08 -0700 |
| 4 | +Subject: [PATCH] issue 202 fix |
| 5 | + |
| 6 | +--- |
| 7 | + middleware/qira_webserver.py | 8 ++++++-- |
| 8 | + middleware/qira_webstatic.py | 5 +++-- |
| 9 | + requirements.txt | 3 ++- |
| 10 | + run_tests.sh | 10 ++++++++-- |
| 11 | + 4 files changed, 19 insertions(+), 7 deletions(-) |
| 12 | + |
1 | 13 | diff --git a/middleware/qira_webserver.py b/middleware/qira_webserver.py
|
2 |
| -index 3eac66a..068df7a 100644 |
| 14 | +index 3eac66a..3d51317 100644 |
3 | 15 | --- a/middleware/qira_webserver.py
|
4 | 16 | +++ b/middleware/qira_webserver.py
|
5 |
| -@@ -431,7 +431,7 @@ def run_server(largs, lprogram): |
| 17 | +@@ -38,7 +38,8 @@ def func_wrapper(*args, **kwargs): |
| 18 | + LIMIT = 0 |
| 19 | + |
| 20 | + from flask import Flask, Response, redirect, request |
| 21 | +-from flask.ext.socketio import SocketIO, emit |
| 22 | ++#from flask.ext.socketio import SocketIO, emit |
| 23 | ++from flask_socketio import SocketIO, emit |
| 24 | + |
| 25 | + # http://stackoverflow.com/questions/8774958/keyerror-in-module-threading-after-a-successful-py-test-run |
| 26 | + import threading |
| 27 | +@@ -66,6 +67,7 @@ def push_trace_update(i): |
| 28 | + t.needs_update = False |
| 29 | + |
| 30 | + def push_updates(full = True): |
| 31 | ++ |
| 32 | + socketio.emit('pmaps', program.get_pmaps(), namespace='/qira') |
| 33 | + socketio.emit('maxclnum', program.get_maxclnum(), namespace='/qira') |
| 34 | + socketio.emit('arch', list(program.tregs), namespace='/qira') |
| 35 | +@@ -431,7 +433,9 @@ def run_server(largs, lprogram): |
6 | 36 | print "****** starting WEB SERVER on %s:%d" % (qira_config.HOST, qira_config.WEB_PORT)
|
7 | 37 | threading.Thread(target=mwpoller).start()
|
8 | 38 | try:
|
9 | 39 | - socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT, log=open("/dev/null", "w"))
|
10 |
| -+ socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT) |
| 40 | ++ #socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT, log=open("/dev/null", "w")) |
| 41 | ++ socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT, |
| 42 | ++ log_output=False) |
11 | 43 | except KeyboardInterrupt:
|
12 | 44 | print "*** User raised KeyboardInterrupt"
|
13 | 45 | exit()
|
| 46 | +diff --git a/middleware/qira_webstatic.py b/middleware/qira_webstatic.py |
| 47 | +index 778f4bc..c1e5478 100644 |
| 48 | +--- a/middleware/qira_webstatic.py |
| 49 | ++++ b/middleware/qira_webstatic.py |
| 50 | +@@ -9,7 +9,8 @@ |
| 51 | + from qira_webserver import app |
| 52 | + |
| 53 | + from flask import Flask, Response, redirect, request |
| 54 | +-from flask.ext.socketio import SocketIO, emit |
| 55 | ++#from flask.ext.socketio import SocketIO, emit |
| 56 | ++from flask_socketio import SocketIO, emit |
| 57 | + |
| 58 | + from qira_base import * |
| 59 | + import json |
| 60 | +@@ -81,7 +82,7 @@ def graph_dot(): |
| 61 | + os.system("dot /tmp/in.dot > /tmp/out.dot") |
| 62 | + ret = open("/tmp/out.dot").read() |
| 63 | + #print "DOT RESPONSE", ret |
| 64 | +- return ret |
| 65 | ++ return ret |
| 66 | + |
| 67 | + # currently if we aren't using static, we don't want to draw the staticview |
| 68 | + # or be able to makefunction |
| 69 | +diff --git a/requirements.txt b/requirements.txt |
| 70 | +index c46478f..8a69c04 100644 |
| 71 | +--- a/requirements.txt |
| 72 | ++++ b/requirements.txt |
| 73 | +@@ -12,5 +12,6 @@ capstone |
| 74 | + hexdump |
| 75 | + nose |
| 76 | + ./qiradb |
| 77 | +-https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709 |
| 78 | ++pyparsing>=2.1.4 |
| 79 | ++#https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709 |
| 80 | + |
| 81 | +diff --git a/run_tests.sh b/run_tests.sh |
| 82 | +index 0e65d07..2411c1c 100755 |
| 83 | +--- a/run_tests.sh |
| 84 | ++++ b/run_tests.sh |
| 85 | +@@ -36,8 +36,14 @@ fi |
| 86 | + # phantomjs |
| 87 | + # use phantomjs2.0 for non-draft WebSockets protol |
| 88 | + # unforunately this doesn't ship with Ubuntu by default |
| 89 | +- |
| 90 | +-sudo apt-get install $LIBICU |
| 91 | ++if [ $(sudo apt-get install $LIBICU; echo $?) != 100 ]; then |
| 92 | ++ echo "libcsu55 installed successfully." |
| 93 | ++else |
| 94 | ++ echo "missing dependencies, fixing source" |
| 95 | ++ echo -e "deb http://security.ubuntu.com/ubuntu trusty-security main" | sudo tee -a /etc/apt/sources.list |
| 96 | ++ sudo apt-get update |
| 97 | ++ sudo apt-get install $LIBICU |
| 98 | ++fi |
| 99 | + |
| 100 | + wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-$VER.tar.bz2 |
| 101 | + tar xf ./phantomjs-2.0.0-ubuntu-$VER.tar.bz2 |
0 commit comments