可以读取IC卡的所有区块了,感觉可以把澳门通破解了。。
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ extern "C" {
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "stdio.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
+7
-1
@@ -65,7 +65,13 @@ static void MX_SPI1_Init(void);
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
int _write(int file , char *ptr,int len)
|
||||
{
|
||||
int i = 0;
|
||||
for(i = 0;i<len;i++)
|
||||
ITM_SendChar((*ptr++));
|
||||
return len;
|
||||
}
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,9 +72,9 @@ void HAL_MspInit(void)
|
||||
|
||||
/* System interrupt init*/
|
||||
|
||||
/** DISABLE: JTAG-DP Disabled and SW-DP Disabled
|
||||
/** NOJTAG: JTAG-DP Disabled and SW-DP Enabled
|
||||
*/
|
||||
__HAL_AFIO_REMAP_SWJ_DISABLE();
|
||||
__HAL_AFIO_REMAP_SWJ_NOJTAG();
|
||||
|
||||
/* USER CODE BEGIN MspInit 1 */
|
||||
|
||||
|
||||
+10
-8
@@ -1,8 +1,10 @@
|
||||
main.c:75:5:main 8 static
|
||||
main.c:122:6:SystemClock_Config 72 static
|
||||
main.c:161:13:MX_I2C2_Init 8 static
|
||||
main.c:195:13:MX_SPI1_Init 8 static
|
||||
main.c:233:13:MX_TIM6_Init 16 static
|
||||
main.c:271:13:MX_GPIO_Init 48 static
|
||||
main.c:363:13:MX_FSMC_Init 40 static
|
||||
main.c:427:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
core_cm3.h:1876:26:ITM_SendChar 16 static,ignoring_inline_asm
|
||||
main.c:68:5:_write 32 static
|
||||
main.c:81:5:main 8 static
|
||||
main.c:128:6:SystemClock_Config 72 static
|
||||
main.c:167:13:MX_I2C2_Init 8 static
|
||||
main.c:201:13:MX_SPI1_Init 8 static
|
||||
main.c:239:13:MX_TIM6_Init 16 static
|
||||
main.c:277:13:MX_GPIO_Init 48 static
|
||||
main.c:369:13:MX_FSMC_Init 40 static
|
||||
main.c:433:6:Error_Handler 4 static,ignoring_inline_asm
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
APP_IDcard.c:12:6:APP_IDcard_init 16 static
|
||||
APP_IDcard.c:27:6:APP_IDcard_loop 16 static
|
||||
APP_IDcard.c:30:6:APP_IDcard_loop 24 static
|
||||
|
||||
@@ -1 +1 @@
|
||||
Main_APP.c:21:6:main_app 96 static
|
||||
Main_APP.c:24:6:main_app 96 static
|
||||
|
||||
Binary file not shown.
+16588
-16234
File diff suppressed because it is too large
Load Diff
+1885
-1209
File diff suppressed because it is too large
Load Diff
+33
-13
@@ -19,20 +19,28 @@ unsigned char SN[4];
|
||||
unsigned char RFID[16];
|
||||
unsigned char status;
|
||||
unsigned char s=0x08;
|
||||
char KEY[6]={0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
char KEYA[6]={0,0,0,0,0,0};
|
||||
char KEYB[6]={0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
uint32_t card_number_D=0;
|
||||
|
||||
char fundcard,PA,sele,checkkey;
|
||||
char fundcard,PA,sele,checkkey,read_flag;
|
||||
|
||||
//ͨ¹ýdebug·µ»Ø¿¨Æ¬Êý¾Ý
|
||||
|
||||
void APP_IDcard_loop()
|
||||
{
|
||||
fundcard = PcdRequest(PICC_REQALL,CT);
|
||||
if(fundcard==MI_OK)
|
||||
{
|
||||
|
||||
status=MI_ERR;
|
||||
PA = PcdAnticoll(SN);
|
||||
if(PA==MI_OK)
|
||||
{
|
||||
printf("\n***********************\n");
|
||||
printf("Card Type:%X%X\n",CT[0],CT[1]);
|
||||
printf("CardId:%X%X%X%X\n",SN[0],SN[1],SN[2],SN[3]);
|
||||
|
||||
sprintf(idcard_str,"CardId:%X%X",CT[0],CT[1]);
|
||||
LCD_ShowString(idcard_window->x, idcard_window->y+16, idcard_str, 16, GREEN, RED);
|
||||
sprintf(idcard_str,"CardId:%X%X%X%X",SN[0],SN[1],SN[2],SN[3]);
|
||||
@@ -41,22 +49,34 @@ void APP_IDcard_loop()
|
||||
sele=PcdSelect(SN);
|
||||
if(sele==MI_OK)
|
||||
{
|
||||
LCD_ShowString(idcard_window->x, idcard_window->y+48, "SELE OK", 16, GREEN, RED);
|
||||
|
||||
checkkey=MI_ERR;
|
||||
checkkey=PcdAuthState(0x61,0,KEY,SN);
|
||||
LCD_ShowString(idcard_window->x, idcard_window->y+48, "Key ok", 16, GREEN, RED);
|
||||
for(int a=0;a<64;a++)
|
||||
{
|
||||
checkkey=PcdAuthState(0x61,a,KEYB,SN);
|
||||
if(checkkey==MI_OK)
|
||||
{
|
||||
LCD_ShowString(idcard_window->x, idcard_window->y+48+16, "KEY OK", 16, GREEN, RED);
|
||||
//PcdRead(0,RFID);
|
||||
}
|
||||
checkkey=MI_ERR;
|
||||
checkkey=PcdAuthState(0x61,32,KEY,SN);
|
||||
if(checkkey==MI_OK)
|
||||
read_flag=PcdRead(a,RFID);
|
||||
if(read_flag==MI_OK)
|
||||
{
|
||||
LCD_ShowString(idcard_window->x, idcard_window->y+48+32, "KEY OK", 16, GREEN, RED);
|
||||
//PcdRead(0,RFID);
|
||||
for(int d=0;d<16;d++)
|
||||
{
|
||||
printf("%02X",RFID[d]);
|
||||
}
|
||||
}else
|
||||
{
|
||||
printf("READ_ERROR");
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
printf("KEY_ERROR");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ extern touch_device t0;
|
||||
|
||||
task run_loop;//主循环状态机
|
||||
|
||||
|
||||
|
||||
|
||||
void main_app()
|
||||
{
|
||||
char str[64];
|
||||
|
||||
+11
-2
@@ -2,7 +2,7 @@
|
||||
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="true"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||
@@ -16,7 +16,7 @@
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="72000000"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||
@@ -39,6 +39,15 @@
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]}}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_0" value="Enabled=true:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_1" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_2" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_3" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.itmports" value="1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.itmports_priv" value="0:0:0:0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.pc_sample" value="0:16384"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.timestamps" value="1:1"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.trace_events" value="Cpi=0:Exc=0:Sleep=0:Lsu=0:Fold=0:Exetrc=0"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
|
||||
|
||||
@@ -47,21 +47,23 @@ Mcu.Pin32=PD9
|
||||
Mcu.Pin33=PD10
|
||||
Mcu.Pin34=PD14
|
||||
Mcu.Pin35=PD15
|
||||
Mcu.Pin36=PD0
|
||||
Mcu.Pin37=PD1
|
||||
Mcu.Pin38=PD4
|
||||
Mcu.Pin39=PD5
|
||||
Mcu.Pin36=PA13
|
||||
Mcu.Pin37=PA14
|
||||
Mcu.Pin38=PD0
|
||||
Mcu.Pin39=PD1
|
||||
Mcu.Pin4=PF9
|
||||
Mcu.Pin40=PG12
|
||||
Mcu.Pin41=VP_SYS_VS_ND
|
||||
Mcu.Pin42=VP_SYS_VS_Systick
|
||||
Mcu.Pin43=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin40=PD4
|
||||
Mcu.Pin41=PD5
|
||||
Mcu.Pin42=PG12
|
||||
Mcu.Pin43=PB3
|
||||
Mcu.Pin44=VP_SYS_VS_Systick
|
||||
Mcu.Pin45=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin5=PF10
|
||||
Mcu.Pin6=OSC_IN
|
||||
Mcu.Pin7=OSC_OUT
|
||||
Mcu.Pin8=PA0-WKUP
|
||||
Mcu.Pin9=PA4
|
||||
Mcu.PinsNb=44
|
||||
Mcu.PinsNb=46
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103ZETx
|
||||
@@ -87,6 +89,10 @@ PA0-WKUP.GPIOParameters=GPIO_Label
|
||||
PA0-WKUP.GPIO_Label=KEY0
|
||||
PA0-WKUP.Locked=true
|
||||
PA0-WKUP.Signal=GPIO_Input
|
||||
PA13.Mode=Trace_Asynchronous_SW
|
||||
PA13.Signal=SYS_JTMS-SWDIO
|
||||
PA14.Mode=Trace_Asynchronous_SW
|
||||
PA14.Signal=SYS_JTCK-SWCLK
|
||||
PA4.GPIOParameters=GPIO_Label
|
||||
PA4.GPIO_Label=RC522_CS
|
||||
PA4.Locked=true
|
||||
@@ -136,6 +142,8 @@ PB2.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||
PB2.Locked=true
|
||||
PB2.PinState=GPIO_PIN_SET
|
||||
PB2.Signal=GPIO_Output
|
||||
PB3.Mode=Trace_Asynchronous_SW
|
||||
PB3.Signal=SYS_JTDO-TRACESWO
|
||||
PD0.Signal=FSMC_D2_DA2
|
||||
PD1.Signal=FSMC_D3_DA3
|
||||
PD10.Signal=FSMC_D15_DA15
|
||||
@@ -289,8 +297,6 @@ SPI1.VirtualType=VM_MASTER
|
||||
TIM6.IPParameters=Prescaler,Period
|
||||
TIM6.Period=10000-1
|
||||
TIM6.Prescaler=72-1
|
||||
VP_SYS_VS_ND.Mode=No_Debug
|
||||
VP_SYS_VS_ND.Signal=SYS_VS_ND
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
|
||||
Reference in New Issue
Block a user