Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在执行ShowMobaXterm.py时出现TypeError: DecryptPassword() takes 2 positional arguments but 4 were given错误时,请将第 232 与 231 行的 删除, 如果有中文编码,可以将 encode('ansi') => d… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
16 changes: 7 additions & 9 deletions python3/ShowMobaXterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def WinRegistryReadValue(Root, SubKey: str, ValueName: str, ExpectValueType: int

if len(sys.argv) == 2:
cipher = MobaXtermCryptoSafe(
sys.argv[1].encode('ansi')
sys.argv[1].encode("utf8","ignore")
)
else:
Value, ValueType = winreg.QueryValueEx(
Expand All @@ -182,9 +182,9 @@ def WinRegistryReadValue(Root, SubKey: str, ValueName: str, ExpectValueType: int
); assert(ValueType == winreg.REG_SZ)

cipher = MobaXtermCrypto(
platform.node().encode('ansi'),
os.getlogin().encode('ansi'),
Value.encode('ansi')
platform.node().encode("utf8","ignore"),
os.getlogin().encode("utf8","ignore"),
Value.encode("utf8","ignore")
)

try:
Expand All @@ -201,7 +201,7 @@ def WinRegistryReadValue(Root, SubKey: str, ValueName: str, ExpectValueType: int

CredentialPassword = cipher.DecryptCredential(
CredentialPassword
).decode('ansi')
).decode("utf8","ignore")

print('[*] Name: %s' % ValueName)
print('[*] Username: %s' % CredentialUsername)
Expand All @@ -227,10 +227,8 @@ def WinRegistryReadValue(Root, SubKey: str, ValueName: str, ExpectValueType: int
ConnUsername = ConnUsername.split(':')[-1]

ConnPassword = cipher.DecryptPassword(
Value,
ConnHostname.encode('ansi'),
ConnUsername.encode('ansi')
).decode('ansi')
Value
).decode("utf8","ignore")

print('[*] Name: %s' % ValueName)
print('[*] Password: %s' % ConnPassword)
Expand Down