Skip to content

Instantly share code, notes, and snippets.

@caioluders
Created April 16, 2017 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caioluders/07cefba88b531149d46b366f3651d7a0 to your computer and use it in GitHub Desktop.
Save caioluders/07cefba88b531149d46b366f3651d7a0 to your computer and use it in GitHub Desktop.
def zk_open_the_fucking_door(self,cmd,ss):
command = cmd
command_string = ss
chksum = 0
session_id = self.session_id
reply_id = unpack('HHHH', self.data_recv[:8])[3]
buf = self.createHeader(command, chksum, session_id,
reply_id, command_string)
self.zkclient.sendto(buf, self.address)
#print buf.encode("hex")
try:
self.data_recv, addr = self.zkclient.recvfrom(1024)
self.session_id = unpack('HHHH', self.data_recv[:8])[2]
return self.data_recv[8:]
except:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment