Description

There's no further technical introduction needed; those who understand this code will naturally know its use.

import struct

def makeKcjPropQuery(src, buffer):
    totalSize = len(src) + len(buffer) + 14
    dataBLK = bytearray(totalSize)
    struct.pack_into('I', dataBLK, 0, 547486795)
    dataBLK[4] = 1
    struct.pack_into('H', dataBLK, 5, len(src))
    struct.pack_into('H', dataBLK, 7, len(buffer))
    dataBLK[9:9+len(src)] = src.encode()
    dataBLK[9+len(src):9+len(src)+len(buffer)] = buffer
    dataBLK[-1] = 0x7E
    return dataBLK.hex()

kcjPropName = "rw_eut_su_time"
buffer = bytearray([0] * 1)
hexData= makeKcjPropQuery(kcjPropName, buffer[1:])
print("Query Command for " + kcjPropName + " is " + hexData)
评论