defgetInstance():returnRegistryModule()classRegistryModule(Module):def__init__(self):self.name="winreg"self.description="Extracts Windows Registry files"
mntpoint+=mntidfiles=[]windir=winver.getWindowsDirectory(mntpoint)ifwindir==None:raiseException("No Windows installation present")version=winver.getWindowsVersion(mntpoint)profiles=winver.getUserProfiles(mntpoint)ifversion<=winver._WIN_ME:#9xfiles=[windir+"USER.DAT",windir+"SYSTEM.DAT"]if(len(profiles)>0):forprofileinprofiles:if(os.path.isfile(profile+"USER.DAT")):files+=[profile+"USER.DAT"]ifversion==winver._WIN_ME:#MEfiles+=[windir+"CLASSES.DAT"]elifversion>winver._WIN_ME:#NTfiles+=[windir+"/System32/config/SAM"]files+=[windir+"/System32/config/SECURITY"]files+=[windir+"/System32/config/SOFTWARE"]files+=[windir+"/System32/config/SYSTEM"]files+=[windir+"/System32/config/DEFAULT"]forprofileinprofiles:files+=[profile+"/NTUSER.DAT"]ifversion>winver._WIN_NTandversion<winver._WIN_VISTA:#2k XP 2k3files+=[profile+"/Local Settings/Application Data/Microsoft/Windows/UsrClass.dat"]else:#Vista+files+=[profile+"/AppData/Local/Microsoft/Windows/UsrClass.dat"]