# Path: debug.py
# def debug(level,text,DEBUG,bindir):
#     try:
#         if bindir == False or level <= 0:
#             print("DEBUG: %s" % (text))
#             return False
#         bindir = os.getcwd()
#         if bindir.endswith("system32"):
#             if os.path.exists(devdir()):
#                 bindir=devdir()
#             else:
#                 print("DEBUG: %s" % (text))
#                 return False
#         
#         logfile = "%s\\client_debug.log" % (bindir)
#         global DEBUGcount
#         global DEBUGfrombefore
#         
#         if level > LOGLEVEL:
#             if not level in LOGLEVELS:
#                 return False
#         
#         timefromboot = round(time.time() - BOOTTIME,3)
#         tempdebuglist = list()
#         if DEBUGcount > 0 and not DEBUGfrombefore == text:
#             debugstringsht1 = "(%s):(d1) %s (repeat: %s)" % (timefromboot, DEBUGfrombefore,DEBUGcount)
#             debugstringsht2 = "(%s):(d2) %s" % (timefromboot,text)
#             tempdebuglist.append(debugstringsht1)
#             tempdebuglist.append(debugstringsht2)
#             DEBUGcount = 0
#         elif DEBUGcount >= 4096 and DEBUGfrombefore == text:
#             debugstringsht = "(%s):(d3) %s (repeated: %s e2)" % (timefromboot, DEBUGfrombefore,DEBUGcount)
#             tempdebuglist.append(debugstringsht)
#             DEBUGcount = 0
#         elif DEBUGfrombefore == text:
#             DEBUGcount += 1
#             return
#         elif not DEBUGfrombefore == text:
#             debugstringsht = "(%s):(d4) %s"%(timefromboot,text)
#             tempdebuglist.append(debugstringsht)
#         DEBUGfrombefore = text
#         if len(tempdebuglist) > 0:
#             for entry in tempdebuglist:
#                 print(entry)
#                 debug_cache(entry,'add')
#                 if DEBUG == True:
#                     write_debug(level,entry,timefromboot,logfile)
#     except Exception as e:
#         print("[debug.py] debug failed, exception = '%s'" % (e))


import os, sys, shutil, struct
from winreg import *
from ctypes import *
from debug import debug
            if not RawKey == False:
                i = 0
                while 1:
                    name, value, type = EnumValue(RawKey, i)
                    if name == "LogPixels":
                        if value > 96:
                            pixel = 32
                        if value == 96:
                            pixel = 16
                        break
                    i += 1
                debug(1,"[patches.py] def select_gtkdll() Get DPI from Reg: %s" % value,DEBUG,True)
        except:
            pass

    try:
        debug(1,"[patches.py] def select_gtkdll() Detected Pixel Size: %s" % pixel,DEBUG,True)
        if pixel == 32:
            if os.path.isfile(gtkfile32):
                debug(1,"[patches.py] def select_gtkdll() gtkfile --> gtkfile16",DEBUG,True)
                shutil.move(gtkfile, gtkfile16)
                debug(1,"[patches.py] def select_gtkdll() gtkfile32 --> gtkfile",DEBUG,True)
                shutil.move(gtkfile32, gtkfile)
            else:
                debug(1,"[patches.py] def select_gtkdll() select_gtkdll not needed: gtkfile32 not found",DEBUG,True)
            return pixel
        if pixel == 16:
            if os.path.isfile(gtkfile16):
                debug(1,"[patches.py] def select_gtkdll() gtkfile --> gtkfile32",DEBUG,True)
                shutil.move(gtkfile, gtkfile32)

# Path: debug.py
# def debug(level,text,DEBUG,bindir):
#     try:
#         if bindir == False or level <= 0:
#             print("DEBUG: %s" % (text))
#             return False
#         bindir = os.getcwd()
#         if bindir.endswith("system32"):
#             if os.path.exists(devdir()):
#                 bindir=devdir()
#             else:
#                 print("DEBUG: %s" % (text))
#                 return False
#         
#         logfile = "%s\\client_debug.log" % (bindir)
#         global DEBUGcount
#         global DEBUGfrombefore
#         
#         if level > LOGLEVEL:
#             if not level in LOGLEVELS:
#                 return False
#         
#         timefromboot = round(time.time() - BOOTTIME,3)
#         tempdebuglist = list()
#         if DEBUGcount > 0 and not DEBUGfrombefore == text:
#             debugstringsht1 = "(%s):(d1) %s (repeat: %s)" % (timefromboot, DEBUGfrombefore,DEBUGcount)
#             debugstringsht2 = "(%s):(d2) %s" % (timefromboot,text)
#             tempdebuglist.append(debugstringsht1)
#             tempdebuglist.append(debugstringsht2)
#             DEBUGcount = 0
#         elif DEBUGcount >= 4096 and DEBUGfrombefore == text:
#             debugstringsht = "(%s):(d3) %s (repeated: %s e2)" % (timefromboot, DEBUGfrombefore,DEBUGcount)
#             tempdebuglist.append(debugstringsht)
#             DEBUGcount = 0
#         elif DEBUGfrombefore == text:
#             DEBUGcount += 1
#             return
#         elif not DEBUGfrombefore == text:
#             debugstringsht = "(%s):(d4) %s"%(timefromboot,text)
#             tempdebuglist.append(debugstringsht)
#         DEBUGfrombefore = text
#         if len(tempdebuglist) > 0:
#             for entry in tempdebuglist:
#                 print(entry)
#                 debug_cache(entry,'add')
#                 if DEBUG == True:
#                     write_debug(level,entry,timefromboot,logfile)
#     except Exception as e:
#         print("[debug.py] debug failed, exception = '%s'" % (e))


# Path: patches.py
import os, sys, shutil, struct
from winreg import *
from ctypes import *
from debug import debug

            if not RawKey == False:
                i = 0
                while 1:
                    name, value, type = EnumValue(RawKey, i)
                    if name == "LogPixels":
                        if value > 96:
                            pixel = 32
                        if value == 96:
                            pixel = 16
                        break
                    i += 1
                debug(1,"[patches.py] def select_gtkdll() Get DPI from Reg: %s" % value,DEBUG,True)
        except:
            pass

    try:
        debug(1,"[patches.py] def select_gtkdll() Detected Pixel Size: %s" % pixel,DEBUG,True)
        if pixel == 32:
            if os.path.isfile(gtkfile32):
                debug(1,"[patches.py] def select_gtkdll() gtkfile --> gtkfile16",DEBUG,True)
                shutil.move(gtkfile, gtkfile16)
                debug(1,"[patches.py] def select_gtkdll() gtkfile32 --> gtkfile",DEBUG,True)
                shutil.move(gtkfile32, gtkfile)
            else:
                debug(1,"[patches.py] def select_gtkdll() select_gtkdll not needed: gtkfile32 not found",DEBUG,True)
            return pixel
        if pixel == 16:
            if os.path.isfile(gtkfile16):
                debug(1,"[patches.py] def select_gtkdll() gtkfile --> gtkfile32",DEBUG,True)
                shutil.move(gtkfile, gtkfile32)

                debug(1,"[patches.py] def select_gtkdll() gtkfile16 --> gtkfile",DEBUG,True)