From d95ad7d90cffc369f745766ddf9a5fe7e7f777a7 Mon Sep 17 00:00:00 2001 From: leviolet Date: Tue, 1 Sep 2020 20:44:45 +0800 Subject: [PATCH 1/2] modified newclinet-py3.py for linux(WSL). --- .gitmodules | 5 +++-- jlu-drcom-csharp | 1 - jlu-drcom-dotnet | 1 + jlu-drcom-py3/newclinet-py3.py | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) delete mode 160000 jlu-drcom-csharp create mode 160000 jlu-drcom-dotnet diff --git a/.gitmodules b/.gitmodules index ee03195..a0b152f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,7 @@ [submodule "dr-jlu-win32"] path = dr-jlu-win32 url = https://github.com/ImFengLala/dr-jlu-win32 -[submodule "jlu-drcom-csharp"] - path = jlu-drcom-csharp + +[submodule "jlu-drcom-dotnet"] + path = jlu-drcom-dotnet url = https://github.com/leviolet/DrcomDotnet diff --git a/jlu-drcom-csharp b/jlu-drcom-csharp deleted file mode 160000 index 6100d7a..0000000 --- a/jlu-drcom-csharp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6100d7a66423768426928bccfab23674f59f2ec3 diff --git a/jlu-drcom-dotnet b/jlu-drcom-dotnet new file mode 160000 index 0000000..6466fe1 --- /dev/null +++ b/jlu-drcom-dotnet @@ -0,0 +1 @@ +Subproject commit 6466fe1df2a0a7d4846c4bce4882fe6d942fd15f diff --git a/jlu-drcom-py3/newclinet-py3.py b/jlu-drcom-py3/newclinet-py3.py index b4e36d3..843fc77 100644 --- a/jlu-drcom-py3/newclinet-py3.py +++ b/jlu-drcom-py3/newclinet-py3.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # coding: utf-8 # license: AGPL-V3 +# tested: Windows 10, WSL 1 import re import socket @@ -87,7 +88,7 @@ def log(*args, **kwargs): print(*args, **kwargs) if DEBUG and platform.uname().system != 'Windows': with open(LOG_PATH,'a') as f: - f.write(s + '\n') + f.write(str(s) + '\n') def challenge(svr, ran): @@ -370,7 +371,7 @@ def daemon(): def main(): if not IS_TEST: daemon() - execfile(CONF, globals()) + exec(open(CONF).read(), globals()) log("auth svr:", server, "\nusername:", username , "\npassword:", password, "\nmac:", str(hex(mac))) log(bind_ip) From 6d1a90d0729b1c1c610b9178930de15e71a935ec Mon Sep 17 00:00:00 2001 From: leviolet Date: Tue, 1 Sep 2020 21:41:36 +0800 Subject: [PATCH 2/2] use with-as --- jlu-drcom-py3/newclinet-py3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jlu-drcom-py3/newclinet-py3.py b/jlu-drcom-py3/newclinet-py3.py index 843fc77..3e5e208 100644 --- a/jlu-drcom-py3/newclinet-py3.py +++ b/jlu-drcom-py3/newclinet-py3.py @@ -371,7 +371,8 @@ def daemon(): def main(): if not IS_TEST: daemon() - exec(open(CONF).read(), globals()) + with open(CONF) as f: + exec(f.read(), globals()) log("auth svr:", server, "\nusername:", username , "\npassword:", password, "\nmac:", str(hex(mac))) log(bind_ip)