예제 #1
0
        // Token: 0x06000168 RID: 360 RVA: 0x000051E4 File Offset: 0x000033E4
        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];
            MHCardReader.E5557_Select_Page(0);
            int num = MHCardReader.E5557_Read_Free(7, array);

            if (num != 0)
            {
                num = MHCardReader.E5557_Direct_Read(0, 0, 1, this.pwd, array);
                if (array[0] != 0 || array[1] != 8 || array[2] != 128 || array[3] != 56 || num != 0)
                {
                    return(-1);
                }
                byte[] data = new byte[]
                {
                    0,
                    8,
                    128,
                    232
                };
                num = MHCardReader.E5557_Write_Pwd(0, 0, 0, this.pwd, data);
            }
            if (num == 0)
            {
                num = MHCardReader.E5557_Write_Free(0, 1, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 2, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 3, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 4, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 5, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 6, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 7, 0, new byte[4]);
            }
            MHCardReader.E5557_Select_Page(0);
            if (MHCardReader.E5557_Read_Free(7, array) == 0)
            {
                if (beep)
                {
                    MHCardReader.Beep_Option();
                }
                MHCardReader.Led_Option();
                if (initialize)
                {
                    this.initializeCard();
                }
                return(0);
            }
            WMMessageBox.Show(this.owner, "清除数据失败,请手工清除!");
            return(-1);
        }
예제 #2
0
        // Token: 0x06000166 RID: 358 RVA: 0x000050D8 File Offset: 0x000032D8
        public override int initializeCard()
        {
            if (!this.checkDevice(true))
            {
                return(-1);
            }
            this.pwd = base.getPassword();
            if (this.pwd == null)
            {
                return(-2);
            }
            byte[] result = new byte[28];
            MHCardReader.E5557_Select_Page(0);
            int num = MHCardReader.E5557_Read_Free(7, result);

            if (num != 0)
            {
                return(1);
            }
            num = MHCardReader.E5557_Write_Free(0, 7, 0, this.pwd);
            if (num != 0)
            {
                return(-1);
            }
            if (MHCardReader.E5557_Write_Free(0, 0, 0, new byte[]
            {
                0,
                8,
                128,
                56
            }) == 0)
            {
                return(0);
            }
            return(-1);
        }