X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/63e1d35a07b1faa00e5c864024129a9faf8210c1..0fa01ec7da07559ab8ebbad1e4e9ec3ef2d85809:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 128f4063..737873ad 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -310,7 +310,7 @@ void ReadMem(int addr) /* osimage version information is linked in */ extern struct version_information version_information; /* bootrom version information is pointed to from _bootphase1_version_pointer */ -extern char *_bootphase1_version_pointer, _flash_start, _flash_end; +extern char *_bootphase1_version_pointer, _flash_start, _flash_end, _bootrom_start, _bootrom_end, __data_src_start__; void SendVersion(void) { char temp[512]; /* Limited data payload in USB packets */ @@ -331,10 +331,15 @@ void SendVersion(void) FormatVersionInformation(temp, sizeof(temp), "os: ", &version_information); DbpString(temp); - FpgaGatherVersion(temp, sizeof(temp)); + FpgaGatherVersion(FPGA_BITSTREAM_LF, temp, sizeof(temp)); DbpString(temp); - // Send Chip ID - cmd_send(CMD_ACK,*(AT91C_DBGU_CIDR),0,0,NULL,0); + FpgaGatherVersion(FPGA_BITSTREAM_HF, temp, sizeof(temp)); + DbpString(temp); + + // Send Chip ID and used flash memory + uint32_t text_and_rodata_section_size = (uint32_t)&__data_src_start__ - (uint32_t)&_flash_start; + uint32_t compressed_data_section_size = common_area.arg1; + cmd_send(CMD_ACK, *(AT91C_DBGU_CIDR), text_and_rodata_section_size + compressed_data_section_size, 0, NULL, 0); } #ifdef WITH_LF @@ -826,17 +831,11 @@ void UsbPacketReceived(uint8_t *packet, int len) case CMD_MIFAREU_READBL: MifareUReadBlock(c->arg[0],c->arg[1], c->d.asBytes); break; - case CMD_MIFAREUC_AUTH1: - MifareUC_Auth1(c->arg[0],c->d.asBytes); - break; - case CMD_MIFAREUC_AUTH2: - MifareUC_Auth2(c->arg[0],c->d.asBytes); + case CMD_MIFAREUC_AUTH: + MifareUC_Auth(c->arg[0],c->d.asBytes); break; case CMD_MIFAREU_READCARD: - MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes); - break; - case CMD_MIFAREUC_READCARD: - MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes); + MifareUReadCard(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes); break; case CMD_MIFAREUC_SETPWD: MifareUSetPwd(c->arg[0], c->d.asBytes);