Exemple #1
0
        // Token: 0x0600019E RID: 414 RVA: 0x00005FA8 File Offset: 0x000041A8
        public override int initializeCard()
        {
            if (!this.checkDevice(true))
            {
                return(-1);
            }
            this.pwd = base.getPassword();
            if (this.pwd == null)
            {
                return(-2);
            }
            byte[] revbuffer = new byte[28];
            int    num       = (int)QingtongReader.qt_T5557_readm(this.device, 0, 1, revbuffer);

            if (num != 0)
            {
                return(1);
            }
            string s = "00000000";

            byte[] array = new byte[4];
            QingtongReader.asc_hex(Encoding.Default.GetBytes(s), array, 4U);
            QingtongReader.qt_T5557_writem(this.device, 7, 1, this.pwd, 0);
            return((int)QingtongReader.qt_T5557_Config(this.device, 49, array, 32, 0, 49, 49, 48));
        }
Exemple #2
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);
        }