Пример #1
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.instance_id = rb[0x80]
     self.file_id = HaspASN1.asn1_get_intval(rb[0x81])
     self.offset = HaspASN1.asn1_get_intval(rb[0x82])
     self.amount = HaspASN1.asn1_get_intval(rb[0x83])
     self.seedvals = rb[0x84]
Пример #2
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.instance_id = rb[0x80]
     self.is_decrypt = HaspASN1.asn1_get_intval(rb[0x81])
     self.crypt_type = HaspASN1.asn1_get_intval(rb[0x82])
     self.enc_len = HaspASN1.asn1_get_intval(rb[0x83])
     self.data = rb[0x84]
     self.seedvals = rb[0x85]
     self.val_86 = HaspASN1.asn1_get_intval(rb[0x86])
Пример #3
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.status = HaspASN1.asn1_get_intval(rb[0x80])
     self.instance_id = rb[0x81]
     self.hasp_serial = HaspASN1.asn1_get_intval(rb[0x82])
     self.val_83 = HaspASN1.asn1_get_intval(rb[0x83])
     self.val_84 = HaspASN1.asn1_get_intval(rb[0x84])
     self.val_85 = HaspASN1.asn1_get_intval(rb[0x85])
     self.val_87 = HaspASN1.asn1_get_intval(rb[0x87])
     self.schannel_id = HaspASN1.asn1_get_intval(rb[0x88])
     self.val_89 = HaspASN1.asn1_get_intval(rb[0x89])
     self.val_8a = rb[0x8A]
     self.val_8b = HaspASN1.asn1_get_intval(rb[0x8B])
Пример #4
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.instance_id
             },
             0x81: {
                 'value': self.is_decrypt,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.crypt_type,
                 'type': 'intval'
             },
             0x83: {
                 'value': self.enc_len,
                 'type': 'intval'
             },
             0x84: {
                 'value': self.data
             },
             0x85: {
                 'value': self.seedvals
             },
             0x86: {
                 'value': self.val_86,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #5
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.val_80,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.hasp_id,
                 'type': 'intval',
                 'blen': 3
             },
             0x82: {
                 'value': self.scope,
                 'type': 'strval'
             },
             0x83: {
                 'value': self.format,
                 'type': 'strval'
             },
             0x84: {
                 'value': self.val_84
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #6
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.instance_id
             },
             0x81: {
                 'value': self.file_id,
                 'type': 'intval',
                 'blen': 3
             },
             0x82: {
                 'value': self.offset,
                 'type': 'intval'
             },
             0x83: {
                 'value': self.data
             },
             0x84: {
                 'value': self.seedvals
             },
             0x85: {
                 'value': self.val_85,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #7
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.val_80 = HaspASN1.asn1_get_intval(rb[0x80])
     self.hasp_id = HaspASN1.asn1_get_intval(rb[0x81])
     self.scope = HaspASN1.asn1_get_strval(rb[0x82])
     self.format = HaspASN1.asn1_get_strval(rb[0x83])
     self.val_84 = HaspASN1.asn1_get_intval(rb[0x84])
Пример #8
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.instance_id
             },
             0x81: {
                 'value': self.val_81,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #9
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.data
             },
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #10
0
 def serialize(self):
     bcid = struct.pack(">I", self.schannel_address)
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': bcid
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #11
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.instance_id
             },
             0x81: {
                 'value': self.file_id,
                 'type': 'intval',
                 'blen': 3
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #12
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.timestamp,
                 'type': 'intval',
                 'blen': 5
             },
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #13
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.instance_id
             },
             0x82: {
                 'value': self.hasp_serial,
                 'type': 'intval'
             },
             0x83: {
                 'value': self.val_83,
                 'type': 'intval'
             },
             0x84: {
                 'value': self.val_84,
                 'type': 'intval'
             },
             0x85: {
                 'value': self.val_85,
                 'type': 'intval'
             },
             0x87: {
                 'value': self.val_87,
                 'type': 'intval'
             },
             0x88: {
                 'value': self.schannel_id,
                 'type': 'intval'
             },
             0x89: {
                 'value': self.val_89,
                 'type': 'intval'
             },
             0x8A: {
                 'value': self.val_8a
             },
             0x8B: {
                 'value': self.val_8b,
                 'type': 'intval'
             },
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #14
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.num_written,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.seedvals
             },
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #15
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.val_80,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.val_81,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.val_82,
                 'type': 'intval'
             },
             0x84: {
                 'value': HaspUtils.GetTimestamp(),
                 'type': 'intval',
                 'blen': 5
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #16
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.status = HaspASN1.asn1_get_intval(rb[0x80])
     self.info = HaspASN1.asn1_get_strval(rb[0x81])
Пример #17
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.status = HaspASN1.asn1_get_intval(rb[0x80])
     self.num_written = HaspASN1.asn1_get_intval(rb[0x81])
     self.seedvals = rb[0x82]
Пример #18
0
 def serialize(self):
     rb = {self.packet_id: {0x80: {'value': self.instance_id}}}
     return HaspASN1.asn1_pack(rb)
Пример #19
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.instance_id = rb[0x80]
Пример #20
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.instance_id
             },
             0x82: {
                 'value': self.hasp_serial,
                 'type': 'intval'
             },
             0x83: {
                 'value': self.val_83,
                 'type': 'intval'
             },
             0x84: {
                 'value': self.val_84,
                 'type': 'intval'
             },
             0x85: {
                 'value': self.val_85,
                 'type': 'intval'
             },
             0x86: {
                 'value': self.val_86,
                 'type': 'intval'
             },
             0x87: {
                 'value': self.val_87,
                 'type': 'intval'
             },
             0x88: {
                 'value': self.val_88,
                 'type': 'intval'
             },
             0x89: {
                 'value': self.val_89,
                 'type': 'intval'
             },
             0x8A: {
                 'value': self.val_8a,
                 'type': 'intval'
             },
             0x8B: {
                 'value': self.val_8b,
                 'type': 'intval'
             },
             0x8C: {
                 'value': self.schannel_address,
                 'type': 'intval'
             },
             0x8D: {
                 'value': self.val_8d,
                 'type': 'intval'
             },
             0x8E: {
                 'value': self.val_8e
             },
             0x8F: {
                 'value': self.val_8f,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #21
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.instance_id = rb[0x80]
     self.file_id = HaspASN1.asn1_get_intval(rb[0x81])
Пример #22
0
 def serialize(self):
     rb = {
         self.packet_id: {
             0x80: {
                 'value': self.pid,
                 'type': 'intval',
                 'blen': 2
             },
             0x81: {
                 'value': self.tid,
                 'type': 'intval',
                 'blen': 2
             },
             0x82: {
                 'value': self.hasp_uid,
                 'type': 'intval',
                 'blen': 2
             },
             0x83: {
                 'value': self.vendor_id,
                 'type': 'intval',
                 'blen': 3
             },
             0x84: {
                 'value': self.username,
                 'type': 'strval'
             },
             0x85: {
                 'value': self.machine_name,
                 'type': 'strval'
             },
             0x86: {
                 'value': self.login_type,
                 'type': 'strval'
             },
             0x87: {
                 'value': self.spec,
                 'type': 'strval'
             },
             0x88: {
                 'value': self.scope,
                 'type': 'strval'
             },
             0x89: {
                 'value': self.val_89,
                 'type': 'intval'
             },
             0x8A: {
                 'value': self.val_8a,
                 'type': 'intval'
             },
             0x8B: {
                 'value': HaspUtils.GetTimestamp(),
                 'type': 'intval',
                 'blen': 5
             },
             0x8C: {
                 'value': self.val_8c,
                 'type': 'intval'
             },
             0x8D: {
                 'value': self.val_8d,
                 'type': 'intval'
             },
             0x8E: {
                 'value': self.val_8e,
                 'type': 'intval'
             },
             0x8F: {
                 'value': self.val_8f,
                 'type': 'intval'
             },
             0x90: {
                 'value': self.volume_serial,
                 'type': 'intval',
                 'blen': 4
             },
             0x91: {
                 'value': self.val_91,
                 'type': 'intval'
             },
             0x92: {
                 'value': self.hasp_handle,
                 'type': 'intval',
                 'blen': 5
             },
             0x93: {
                 'value': self.val_93,
                 'type': 'intval'
             },
         }
     }
     return HaspASN1.asn1_pack(rb)
Пример #23
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.status = HaspASN1.asn1_get_intval(rb[0x80])
     self.schannel_address = struct.unpack(">I", rb[0x81])[0]
Пример #24
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.val_80 = HaspASN1.asn1_get_intval(rb[0x80])
     self.val_81 = HaspASN1.asn1_get_intval(rb[0x81])
     self.val_82 = HaspASN1.asn1_get_intval(rb[0x82])
     self.timestamp = HaspASN1.asn1_get_intval(rb[0x84])
Пример #25
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.pid = HaspASN1.asn1_get_intval(rb[0x80])
     self.tid = HaspASN1.asn1_get_intval(rb[0x81])
     self.hasp_uid = HaspASN1.asn1_get_intval(rb[0x82])
     self.vendor_id = HaspASN1.asn1_get_intval(rb[0x83])
     self.username = HaspASN1.asn1_get_strval(rb[0x84])
     self.machine_name = HaspASN1.asn1_get_strval(rb[0x85])
     self.login_type = HaspASN1.asn1_get_strval(rb[0x86])
     self.spec = HaspASN1.asn1_get_strval(rb[0x87])
     self.scope = HaspASN1.asn1_get_strval(rb[0x88])
     self.val_89 = HaspASN1.asn1_get_intval(rb[0x89])
     self.val_8A = HaspASN1.asn1_get_intval(rb[0x8A])
     self.timestamp = HaspASN1.asn1_get_intval(rb[0x8B])
     self.val_8c = HaspASN1.asn1_get_intval(rb[0x8C])
     self.val_8d = HaspASN1.asn1_get_intval(rb[0x8D])
     self.val_8e = HaspASN1.asn1_get_intval(rb[0x8E])
     self.val_8f = HaspASN1.asn1_get_intval(rb[0x8F])
     self.volume_serial = HaspASN1.asn1_get_intval(rb[0x90])
     self.val_91 = HaspASN1.asn1_get_intval(rb[0x91])
     self.hasp_handle = HaspASN1.asn1_get_intval(rb[0x92])
     self.val_93 = HaspASN1.asn1_get_intval(rb[0x93])
Пример #26
0
 def parse(self, data):
     rb = HaspASN1.de_asn1(data)[self.packet_id]
     self.status = HaspASN1.asn1_get_intval(rb[0x80])
     self.data = rb[0x81]
     self.val_82 = HaspASN1.asn1_get_intval(rb[0x82])