Compare commits

...

2 Commits

Author SHA1 Message Date
Fierelier d80d911fd6 Actually add the online parts to the main script jesus christ 2022-06-22 07:19:47 +02:00
Fierelier 4e939d3ad5 Better os.path.join function 2022-06-22 07:17:54 +02:00
1 changed files with 39 additions and 2 deletions

41
run.py
View File

@ -8,7 +8,28 @@ def newexcepthook(type,value,traceback):
sys.excepthook = newexcepthook
import os
p = os.path.join
def p(*args):
args = list(args)
index = 0
length = len(args)
while index < length:
arg = args[index]
arg = arg.replace("/",os.path.sep)
arg = arg.replace("\\",os.path.sep)
if index != 0: arg = arg.lstrip(os.path.sep)
arg = arg.rstrip(os.path.sep)
while os.path.sep + os.path.sep in arg:
arg = arg.replace(os.path.sep + os.path.sep,os.path.sep)
if arg == "":
del args[index]
length -= 1
continue
args[index] = arg
index += 1
return os.path.sep.join(args)
pUp = os.path.dirname
s = False
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
@ -112,6 +133,10 @@ def main():
else:
opusnt.target["index"] = 1
opusnt.getMaxIndex()
elif "online" in arglist:
opusnt.target["type"] = "online"
opusnt.target["path"] = os.environ["SystemDrive"]
opusnt.target["regmap"] = {}
else:
opusnt.target["type"] = "offline"
opusnt.target["path"] = arglist["path"]
@ -154,8 +179,20 @@ def main():
break
printStatus("mounting registry hives...")
regNames = []
for reg in regs:
opusnt.mountReg(opusnt.regTmpPath + reg, opusnt.filePath(regs[reg]))
regNames.append(reg)
for reg in regNames:
opusnt.mountReg(opusnt.regTmpPath + reg, opusnt.filePath(regs[reg]),regs,reg)
regNames = None
if opusnt.target["type"] == "online":
opusnt.target["regmap"][opusnt.regTmpPath + "software"] = "HKEY_LOCAL_MACHINE\\SOFTWARE"
opusnt.target["regmap"][opusnt.regTmpPath + "system"] = "HKEY_LOCAL_MACHINE\\SYSTEM"
for key in opusnt.regQueryKeys("HKEY_USERS"):
if key.endswith("_Classes"): continue
regs["user-mounted_" +key.split("\\")[1]] = ""
opusnt.target["regmap"][opusnt.regTmpPath + "user-mounted_" +key.split("\\")[1]] = key
opusnt.getVersion(winreg.HKEY_LOCAL_MACHINE,(opusnt.regTmpPath + "software").split("\\",1)[-1])
printStatus("\nwindows version:")