Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion DeDRM_plugin/adobekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ class ADEPTError(Exception):
c_long, c_ulong

from ctypes.wintypes import LPVOID, DWORD, BOOL
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg

def _load_crypto_libcrypto():
from ctypes.util import find_library
Expand Down
5 changes: 4 additions & 1 deletion DeDRM_plugin/ignoblekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def getNookLogFiles():
logFiles = []
found = False
if iswindows:
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg

# some 64 bit machines do not have the proper registry key for some reason
# or the python interface to the 32 vs 64 bit registry is broken
Expand Down
6 changes: 5 additions & 1 deletion DeDRM_plugin/kindlekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def decode(data,map):
create_unicode_buffer, create_string_buffer, CFUNCTYPE, addressof, \
string_at, Structure, c_void_p, cast

import winreg
try:
import winreg
except ImportError:
import _winreg as winreg

MAX_PATH = 255
kernel32 = windll.kernel32
advapi32 = windll.advapi32
Expand Down
5 changes: 4 additions & 1 deletion DeDRM_plugin/simpleprefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def __init__(self, target, description):
self.file2key[filename] = key
self.target = target + 'Prefs'
if sys.platform.startswith('win'):
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg
regkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\")
path = winreg.QueryValueEx(regkey, 'Local AppData')[0]
prefdir = path + os.sep + self.target
Expand Down
5 changes: 4 additions & 1 deletion Obok_plugin/obok/legacy_obok.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def __oldcookiedeviceid(self):
pwsdid = ''
try:
if sys.platform.startswith('win'):
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg
regkey_browser = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\Kobo\\Kobo Desktop Edition\\Browser')
cookies = winreg.QueryValueEx(regkey_browser, 'cookies')
bytearrays = cookies[0]
Expand Down
5 changes: 4 additions & 1 deletion Obok_plugin/obok/obok.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ def __init__ (self, serials = [], device_path = None, desktopkobodir = u""):

if (self.kobodir == u""):
if sys.platform.startswith('win'):
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg
if sys.getwindowsversion().major > 5:
if 'LOCALAPPDATA' in os.environ.keys():
# Python 2.x does not return unicode env. Use Python 3.x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ if iswindows:
c_long, c_ulong

from ctypes.wintypes import LPVOID, DWORD, BOOL
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg

def _load_crypto_libcrypto():
from ctypes.util import find_library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ def getNookLogFiles():
logFiles = []
found = False
if iswindows:
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg

# some 64 bit machines do not have the proper registry key for some reason
# or the python interface to the 32 vs 64 bit registry is broken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ if iswindows:
create_unicode_buffer, create_string_buffer, CFUNCTYPE, addressof, \
string_at, Structure, c_void_p, cast

import winreg
try:
import winreg
except ImportError:
import _winreg as winreg
MAX_PATH = 255
kernel32 = windll.kernel32
advapi32 = windll.advapi32
Expand Down
5 changes: 4 additions & 1 deletion Other_Tools/Kobo/obok.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ def __init__ (self, serials = [], device_path = None):
if (self.kobodir == u""):
# step 4. we haven't found a device with serials, so try desktop apps
if sys.platform.startswith('win'):
import winreg
try:
import winreg
except ImportError:
import _winreg as winreg
if sys.getwindowsversion().major > 5:
if 'LOCALAPPDATA' in os.environ.keys():
# Python 2.x does not return unicode env. Use Python 3.x
Expand Down