Skip to content

Commit 280834a

Browse files
pwnslingerzardus
authored andcommitted
qira patched, flask_socketio problem fixed
1 parent cf6ceba commit 280834a

File tree

1 file changed

+91
-3
lines changed

1 file changed

+91
-3
lines changed

qira/qira_fix.patch

+91-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,101 @@
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+
113
diff --git a/middleware/qira_webserver.py b/middleware/qira_webserver.py
2-
index 3eac66a..068df7a 100644
14+
index 3eac66a..3d51317 100644
315
--- a/middleware/qira_webserver.py
416
+++ 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):
636
print "****** starting WEB SERVER on %s:%d" % (qira_config.HOST, qira_config.WEB_PORT)
737
threading.Thread(target=mwpoller).start()
838
try:
939
- 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)
1143
except KeyboardInterrupt:
1244
print "*** User raised KeyboardInterrupt"
1345
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

Comments
 (0)