X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/bea2a8660edd6cabce704207548d669761ef4a6d..802a36162a7a5452ad1b276399087df11b46ccd1:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index a3871eb6..9696b008 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -236,6 +236,32 @@ void ReadMem(int addr) DbpIntegers(0, data[i], data[i+1]); } +/* osimage version information is linked in */ +extern struct version_information version_information; +void SendVersion(void) +{ + char temp[48]; /* Limited data payload in USB packets */ + DbpString("Prox/RFID mark3 RFID instrument"); + + /* Try to find the bootrom version information. For the time being, expect + * to find a pointer at address 0x1001fc, perform slight sanity checks on + * the pointer, then use it. + */ + void *bootrom_version = *(void**)0x1001fc; + if( bootrom_version < (void*)0x100000 || bootrom_version > (void*)0x101000 ) { + DbpString("bootrom version information appears invalid"); + } else { + FormatVersionInformation(temp, sizeof(temp), "bootrom: ", bootrom_version); + DbpString(temp); + } + + FormatVersionInformation(temp, sizeof(temp), "os: ", &version_information); + DbpString(temp); + + FpgaGatherVersion(temp, sizeof(temp)); + DbpString(temp); +} + // samy's sniff and repeat routine void SamyRun() { @@ -616,6 +642,9 @@ void UsbPacketReceived(BYTE *packet, int len) case CMD_SET_LF_DIVISOR: FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1); break; + case CMD_VERSION: + SendVersion(); + break; #ifdef WITH_LCD case CMD_LCD_RESET: LCDReset();