]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
Add command and code for bidirectional LF emulation of Hitag2. Should be extended...
[proxmark3-svn] / armsrc / appmain.c
index 551ee694e493a0742b4e3878595c7454caf9ceb5..59cc6dead3bf6a5bbbf99ad96c15dfae2cc640f7 100644 (file)
@@ -236,10 +236,28 @@ 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);
 }
@@ -627,6 +645,9 @@ void UsbPacketReceived(BYTE *packet, int len)
                case CMD_VERSION:
                        SendVersion();
                        break;
+               case CMD_LF_SIMULATE_BIDIR:
+                       SimulateTagLowFrequencyBidir(c->ext1, c->ext2);
+                       break;
 #ifdef WITH_LCD
                case CMD_LCD_RESET:
                        LCDReset();
Impressum, Datenschutz