drcoms / drcom-generic

Dr.COM/DrCOM 现已覆盖 d p x三版。
GNU Affero General Public License v3.0
1.14k stars 268 forks source link

latest-pppoe.py与latest-wired.py的区别 #259

Closed NERD-k closed 7 years ago

NERD-k commented 7 years ago

请问:latest-pppoe.py与latest-wired.py的区别是什么啊? 我想要用Pythin3,还是用latest-pppoe.py,然后修改适应Python3吗?

ly0 commented 7 years ago

pppoe是p版的 wired是d版的

NERD-k commented 7 years ago

OMG,看遍WIKI没看到提示啊(也许我没注意)。。。 还是谢谢指点。

NERD-k commented 7 years ago

pppoe目前版本不支持Python3的环境吧?

mchome commented 7 years ago

不支持,你可以移植一下。

NERD-k commented 7 years ago

有谁感兴趣的看看这个 转 python3 的 sublime_text_2017-10-06_19-08-39

后面全是0???看来我做的不对啊

NERD-k commented 7 years ago

不太懂啊,我只能让他能跑起来,但都是得到的 recv1/unexpected,不太懂啊

conemu64_2017-10-07_19-02-49

NERD-k commented 7 years ago

运行 通不过的。应该是字节的问题。foo 等等也是要转化 为 byte conemu64_2017-10-12_23-47-42

NERD-k commented 7 years ago

我稍微改了一下后,又有这个错误。。。 sublime_text_2017-10-13_01-30-04

NERD-k commented 7 years ago

修改这些

>  git diff
>  diff --git a/pppoe.py b/pppoe.py
>  index 2cfc2ca..695d392 100644
>  --- a/pppoe.py
>  +++ b/pppoe.py
>  @@ -7,6 +7,7 @@ import sys
>   import random
>   import os
>   import hashlib
>  +import binascii
>  
>   # CONFIG
>   server = '172.30.1.80'
>  @@ -31,10 +32,10 @@ def log(*args, **kwargs):
>       if DEBUG:
>           with open(LOG_PATH,'ab') as f:
>               try:
>  -                f.write(s)
>  +                f.write(bytes(s))
>                   f.write('\n')
>               except:
>  -                f.write('FUCK WINDOWS' + '\n')
>  +                f.write(b'FUCK WINDOWS' + b'\n')
>   def dump(n):
>       s = '%x' % n
>       if len(s) & 1:
>  @@ -324,8 +325,8 @@ def main():
>           daemon()
>           execfile(CONF, globals())
>       log('auth svr: ' + server)
>  -    log('pppoe_flag: ' + binascii.hexlify(pppoe_flag))
>  -    log('keep_alive2_flag: ' + binascii.hexlify(keep_alive2_flag))
>  +    log('pppoe_flag: ' + str(binascii.hexlify(pppoe_flag)))
>  +    log('keep_alive2_flag: ' + str(binascii.hexlify(keep_alive2_flag)))
>  
>       s = Socket(server)
>       while True:
>  @@ -334,4 +335,4 @@ def main():
>           keep_alive2(s, pppoe)
>  
>   if __name__ == '__main__':
>  -    main()
>  \ No newline at end of file
>  +    main()
>  C:\Users\NERD\Desktop [master +21 ~1 -0 !]