Example #1
0
        // Token: 0x0600019A RID: 410 RVA: 0x00005D28 File Offset: 0x00003F28
        public override int writeCard(uint[] datas)
        {
            if (!this.checkDevice(true))
            {
                return(-1);
            }
            uint num = this.getCardID(false);

            this.pwd = base.getPassword(false, num);
            if (this.pwd == null)
            {
                return(-2);
            }
            num = num * ICardReader.DATA_PASS1 + ICardReader.DATA_PASS2;
            for (int i = 0; i < datas.Length; i++)
            {
                datas[i] ^= num;
            }
            byte[] sendbuffer = base.uInt32tobyte(datas);
            if (QingtongReader.qt_T5557_pwdwritem(this.device, 1, 6, this.pwd, sendbuffer, 0) == 0 && (int)this.device > 0)
            {
                QingtongReader.dv_beep(this.device, 10);
                return(0);
            }
            return(-1);
        }
Example #2
0
        // Token: 0x0600019B RID: 411 RVA: 0x00005DC8 File Offset: 0x00003FC8
        public override uint[] readCard(bool beep)
        {
            if (!this.checkDevice(true))
            {
                return(null);
            }
            uint num = this.getCardID(false);

            this.pwd = base.getPassword(false, num);
            if (this.pwd == null)
            {
                return(null);
            }
            byte[] array = new byte[28];
            if (QingtongReader.qt_T5557_readm(this.device, 0, 1, array) == 0)
            {
                WMMessageBox.Show(this.owner, "该卡为空白卡,请先初始化!");
                return(null);
            }
            int num2 = (int)QingtongReader.qt_T5557_pwdreadm(this.device, 0, 7, this.pwd, array);

            if (num2 != 0)
            {
                WMMessageBox.Show(this.owner, "读卡错误!");
                return(null);
            }
            if ((int)this.device > 0 && beep)
            {
                QingtongReader.dv_beep(this.device, 10);
            }
            uint[] array2 = base.byte2Uint32(array);
            uint[] array3 = new uint[]
            {
                array2[1],
                array2[2],
                array2[3],
                array2[4],
                array2[5],
                array2[6]
            };
            num = num * ICardReader.DATA_PASS1 + ICardReader.DATA_PASS2;
            for (int i = 0; i < array3.Length; i++)
            {
                array3[i] ^= num;
            }
            CRCUtil crcutil = new CRCUtil(array3);

            if (!crcutil.checkCRC())
            {
                WMMessageBox.Show(this.owner, "CRC检查错误!");
                return(null);
            }
            return(array3);
        }
Example #3
0
 // Token: 0x06000199 RID: 409 RVA: 0x00005CD4 File Offset: 0x00003ED4
 public override bool initReader(IWin32Window window)
 {
     this.owner  = window;
     this.device = QingtongReader.ic_init(100, 100U);
     if ((int)this.device > 0)
     {
         QingtongReader.dv_beep(this.device, 10);
         byte rateValue = 32;
         QingtongReader.qt_T5557_set_rate(this.device, rateValue);
         return(true);
     }
     return(false);
 }
Example #4
0
        // Token: 0x060001A0 RID: 416 RVA: 0x000060C0 File Offset: 0x000042C0
        public override int clearAllData(bool beep, bool initialize)
        {
            if (!this.checkDevice(true))
            {
                return(-2);
            }
            this.pwd = base.getPassword(beep);
            if (this.pwd == null)
            {
                return(-1);
            }
            byte[] array = new byte[28];
            int    num   = (int)QingtongReader.qt_T5557_readm(this.device, 0, 7, array);

            if (num != 0)
            {
                num = (int)QingtongReader.qt_T5557_pwdreadm(this.device, 0, 7, this.pwd, array);
                if (num == 0)
                {
                    num = (int)QingtongReader.qt_T5557_Config(this.device, 1, this.pwd, 32, 0, 0, 7, 0);
                }
            }
            if (num == 0)
            {
                num = (int)(QingtongReader.qt_T5557_writem(this.device, 1, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 2, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 3, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 4, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 5, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 6, 1, new byte[4], 0) + QingtongReader.qt_T5557_writem(this.device, 7, 1, new byte[4], 0));
            }
            num = (int)QingtongReader.qt_T5557_read(this.device, 0, array);
            if (num == 0)
            {
                for (byte b = 1; b < 7; b += 1)
                {
                    byte[] array2 = new byte[4];
                    num = (int)QingtongReader.qt_T5557_read(this.device, b, array2);
                    if (num != 0)
                    {
                        break;
                    }
                    if (base.byte2Uint32(array2)[0] != 0U)
                    {
                        num = -1;
                        break;
                    }
                }
                if (num == 0)
                {
                    if (beep)
                    {
                        QingtongReader.dv_beep(this.device, 10);
                    }
                    if (initialize)
                    {
                        this.initializeCard();
                    }
                }
                else
                {
                    WMMessageBox.Show(this.owner, "清除数据失败,请手工清除!");
                }
                return(num);
            }
            return(num);
        }