Skip to content

Commit

Permalink
[WIP] python 3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Apr 16, 2019
1 parent 69d10f5 commit e9a9952
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Windows/lazagne/softwares/games/kalypsomedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import char_to_int
from lazagne.config.winstructure import char_to_int, chr_or_byte

try:
from ConfigParser import ConfigParser # Python 2.7
Expand All @@ -20,11 +20,11 @@ def xorstring(self, s, k):
"""
xors the two strings
"""
return "".join(chr(char_to_int(x) ^ char_to_int(y)) for x, y in zip(s, k))
return b''.join(chr_or_byte(char_to_int(x) ^ char_to_int(y)) for x, y in zip(s, k))

def run(self):
creds = []
key = 'lwSDFSG34WE8znDSmvtwGSDF438nvtzVnt4IUv89'
key = b'lwSDFSG34WE8znDSmvtwGSDF438nvtzVnt4IUv89'
inifile = os.path.join(constant.profile['APPDATA'], u'Kalypso Media\\Launcher\\launcher.ini')

# The actual user details are stored in *.userdata files
Expand Down
9 changes: 4 additions & 5 deletions Windows/lazagne/softwares/multimedia/eyecon.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ def __init__(self):
ModuleInfo.__init__(self, name='EyeCon', category='multimedia')

def deobfuscate(self, ciphered_str):
# Should not work with python 3: need test
return ''.join([chr(ord(c) ^ k) for c,k in zip(codecs.decode(ciphered_str, 'hex'), self.hex_key)])
return b''.join([chr_or_byte(char_to_int(c) ^ k) for c, k in zip(codecs.decode(ciphered_str, 'hex'), self.hex_key)])

def get_db_hosts(self):
hosts =[]
hosts = []
paths = (
('EyeCON DB Host', HKEY_LOCAL_MACHINE, 'SOFTWARE\\WOW6432Node\\eyevis\\eyeDB', 'DB1'),
('EyeCON DB Host', HKEY_LOCAL_MACHINE, 'SOFTWARE\\WOW6432Node\\eyevis\\eyeDB', 'DB2'),
Expand All @@ -40,7 +39,7 @@ def get_db_hosts(self):
try:
hkey = OpenKey(path[1], path[2])
reg_key = winreg.QueryValueEx(hkey, path[3])[0]
if reg_key != '':
if reg_key:
hosts += [reg_key]
except Exception:
# skipping if value doesn't exist
Expand Down Expand Up @@ -95,5 +94,5 @@ def run(self):
hosts = self.get_db_hosts()
credentials = self.credentials_from_registry()
for cred in credentials:
cred['host(s)'] = ', '.join(hosts)
cred['host(s)'] = b', '.join(hosts)
return credentials
2 changes: 1 addition & 1 deletion Windows/lazagne/softwares/wifi/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def decrypt_using_netsh(self, ssid):
stdout=PIPE,
stderr=PIPE)
stdout, stderr = process.communicate()
for st in stdout.split('\n'):
for st in stdout.deocde().split('\n'):
if any(i in st.lower() for i in language_keys):
password = st.split(':')[1].strip()
return password
Expand Down

0 comments on commit e9a9952

Please sign in to comment.