Skip to content

Commit aff586f

Browse files
committed
Changed decode from ASCII to UTF-8
1 parent c811606 commit aff586f

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

sparrowbluetooth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def run(self):
387387
if not self.btMonRunning():
388388
self.startBTMon()
389389

390-
curLine = self.btmonProc.stdout.readline().decode('ASCII').replace('\n', '')
390+
curLine = self.btmonProc.stdout.readline().decode('UTF-8').replace('\n', '')
391391

392392
# Address
393393
fieldValue = self.getFieldValue(p_address, curLine)
@@ -516,7 +516,7 @@ def run(self):
516516
rssi_offset = -54 # Note: This is direct from the Ubertooth bluetooth module. I thought the RSSI's looked really high.
517517

518518
while not specanProc.poll() and not self.signalStop:
519-
dataline = specanProc.stdout.readline().decode('ASCII').replace('\n', '')
519+
dataline = specanProc.stdout.readline().decode('UTF-8').replace('\n', '')
520520
dataline = dataline.replace(' ', '')
521521
data = dataline.split(',')
522522
if len(data) >= 3:
@@ -957,7 +957,7 @@ def getNumUbertoothDevices():
957957
if result.returncode != 0:
958958
return 0
959959

960-
hciResult = result.stdout.decode('ASCII')
960+
hciResult = result.stdout.decode('UTF-8')
961961
p = re.compile('^.*(1d50)', re.MULTILINE)
962962
tmpInterfaces = p.findall(hciResult)
963963

@@ -980,7 +980,7 @@ def getBluetoothInterfaces(printResults=False):
980980
if result.returncode != 0:
981981
return []
982982

983-
hciResult = result.stdout.decode('ASCII')
983+
hciResult = result.stdout.decode('UTF-8')
984984
p = re.compile('^.*(hci[0-9])', re.MULTILINE)
985985
tmpInterfaces = p.findall(hciResult)
986986

@@ -1003,7 +1003,7 @@ def getBluetoothInterfaces(printResults=False):
10031003
def getUbertoothSpecanProcesses():
10041004
# Returns a list of process id's
10051005
result = subprocess.run(['pgrep', '-f','ubertooth-specan'], stdout=subprocess.PIPE,stderr=subprocess.DEVNULL)
1006-
testResult = result.stdout.decode('ASCII')
1006+
testResult = result.stdout.decode('UTF-8')
10071007

10081008
retVal = []
10091009
if result.returncode != 0:
@@ -1063,7 +1063,7 @@ def ubertoothOnline():
10631063
params = ['ubertooth-util', '-v']
10641064

10651065
result = subprocess.run(params, stdout=subprocess.PIPE,stderr=subprocess.PIPE)
1066-
testResult = result.stdout.decode('ASCII')
1066+
testResult = result.stdout.decode('UTF-8')
10671067
if 'could not open Ubertooth device' in testResult:
10681068
return -3, 'Unable to find Ubertooth device'
10691069

sparrowcommon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def gzipUncompress(inputBytes):
8282
with gzip.GzipFile(fileobj=inp, mode='rb') as ofile:
8383
gunzippedString = ofile.read()
8484

85-
return gunzippedString.decode('ASCII')
85+
return gunzippedString.decode('UTF-8')
8686

8787
# ------------------ Class Base Thread ----------------------------------
8888
class BaseThreadClass(Thread):

sparrowgps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def GPSDRunning():
214214
# ps.stdout.close()
215215
# ps.wait()
216216

217-
# gpsResult = output.decode('ASCII')
217+
# gpsResult = output.decode('UTF-8')
218218

219219
# if re.search('/gpsd', gpsResult) is None:
220220
# return False

sparrowhackrf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def run(self):
9090
iteration = 0
9191

9292
while not hackrfsweepProc.poll() and not self.signalStop:
93-
dataline = hackrfsweepProc.stdout.readline().decode('ASCII').replace('\n', '')
93+
dataline = hackrfsweepProc.stdout.readline().decode('UTF-8').replace('\n', '')
9494

9595
dataline = dataline.replace(' ', '')
9696
data = dataline.split(',')
@@ -163,7 +163,7 @@ def getNumHackrfDevices():
163163
if result.returncode != 0:
164164
return 0
165165

166-
hciResult = result.stdout.decode('ASCII')
166+
hciResult = result.stdout.decode('UTF-8')
167167
p = re.compile('^.*(1d50)', re.MULTILINE)
168168
tmpInterfaces = p.findall(hciResult)
169169

sparrowwifiagent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def restartAgent():
177177
os.system(newCommand)
178178
# subprocess.Popen(params, stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
179179
# result = subprocess.run(params, stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
180-
# restartResult = result.stdout.decode('ASCII')
180+
# restartResult = result.stdout.decode('UTF-8')
181181
os.kill(os.getpid(), 9)
182182

183183
def updateRunningConfig(newCfg):

wirelessengine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def convertUnknownToString(ssid):
494494

495495
def getInterfaces(printResults=False):
496496
result = subprocess.run(['iwconfig'], stdout=subprocess.PIPE,stderr=subprocess.DEVNULL)
497-
wirelessResult = result.stdout.decode('ASCII')
497+
wirelessResult = result.stdout.decode('UTF-8')
498498
p = re.compile('^(.*?) IEEE', re.MULTILINE)
499499
tmpInterfaces = p.findall(wirelessResult)
500500

@@ -518,7 +518,7 @@ def getMonitoringModeInterfaces(printResults=False):
518518
# Note: for standard scans with iw, this isn't required. Just root access.
519519
# This is only required for some of the more advanced pen testing capabilities
520520
result = subprocess.run(['iwconfig'], stdout=subprocess.PIPE,stderr=subprocess.DEVNULL)
521-
wirelessResult = result.stdout.decode('ASCII')
521+
wirelessResult = result.stdout.decode('UTF-8')
522522
p = re.compile('^(.*?) IEEE.*?Mode:Monitor', re.MULTILINE)
523523
tmpInterfaces = p.findall(wirelessResult)
524524

@@ -626,7 +626,7 @@ def scanForNetworks(interfaceName, frequency=0, printResults=False):
626626

627627
retCode = result.returncode
628628
errString = ""
629-
wirelessResult = result.stdout.decode('ASCII')
629+
wirelessResult = result.stdout.decode('UTF-8')
630630

631631
# debug
632632
if (printResults):

0 commit comments

Comments
 (0)