SystemRage / py-kms

KMS Server Emulator written in Python
The Unlicense
2.04k stars 618 forks source link

unpack requires a string argument of length 1 #26

Closed CirnoT closed 5 years ago

CirnoT commented 5 years ago
python pykms_Client.py

                        Client generating RPC Bind Request...

Server receiving
<===============        Client sending RPC Bind Request...

Server sending
===============>        Client received RPC Bind Response !!!

                        RPC Bind acknowledged !!!

                        Client generating Activation Request dictionary...

                        Client generating Activation Request data...

                        Client generating RPC Activation Request...

Server receiving
<===============        Client sending RPC Activation Request...

Server sending
===============>        Client received Response !!!

Traceback (most recent call last):
  File "pykms_Client.py", line 266, in <module>
    clt_main(with_gui = False)
  File "pykms_Client.py", line 188, in clt_main
    client_create()
  File "pykms_Client.py", line 151, in client_create
    parsed = MSRPCRespHeader(response)
  File "/opt/py-kms/pykms_Dcerpc.py", line 641, in __init__
    MSRPCHeader.__init__(self, aBuffer, alignment)
  File "/opt/py-kms/pykms_Dcerpc.py", line 588, in __init__
    Structure.__init__(self,data, alignment)
  File "/opt/py-kms/pykms_Structure.py", line 110, in __init__
    self.fromString(data)
  File "/opt/py-kms/pykms_Structure.py", line 167, in fromString
    self[field[0]] = self.unpack(field[1], data[:size], dataClassOrCode = dataClassOrCode, field = field[0])
  File "/opt/py-kms/pykms_Structure.py", line 329, in unpack
    return self.unpack(two[0],data)
  File "/opt/py-kms/pykms_Structure.py", line 385, in unpack
    return unpack(format, b(data))[0]
struct.error: ('unpack requires a string argument of length 1', "When unpacking field 'ver_major | B=5 | ''[:1]'")

Do yourself a favor and:

SystemRage commented 5 years ago

Good advice, however tested (both command line and GUI) and here no problems.