returnNone#matches = result.decode("utf-8").splitlines()#WARNING: ONLY CONSIDERING FIRST MATCH#TODO: Improve#return os.path.dirname(os.path.realpath(matches[0]))DETECTED_WINDOWS_PATH[path]=os.path.dirname(os.path.realpath(result))returnDETECTED_WINDOWS_PATH[path]
defgetUserProfiles(path):version=getWindowsVersion(path)ifversion<_WIN_XP:profilepath=getWindowsDirectory(path)+"/Profiles"if(os.path.exists(profilepath)):return[profilepath+profforprofinos.listdir(profilepath)]return[]elifversion==_WIN_XP:profilepath=path+"/Documents and Settings"if(os.path.exists(profilepath)):return[profilepath+profforprofinos.listdir(profilepath)]return[]else:profiles=[]profilepath=path+"/Users"if(os.path.exists(profilepath)):foreleminos.listdir(profilepath):if(os.path.isdir(profilepath+"/"+elem)):profiles.append(profilepath+"/"+elem)returnprofiles