]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
fix debug printing function, add readmem function
authorskamkar <skamkar@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 13 Jul 2009 08:22:24 +0000 (08:22 +0000)
committerskamkar <skamkar@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 13 Jul 2009 08:22:24 +0000 (08:22 +0000)
armsrc/appmain.c
armsrc/apps.h
winsrc/command.cpp
winsrc/prox.h

index a137a8fe6c2fc14697d42c7ee3f46176b10f765b..09f11f03670f2a6308b784580f79d56dc0cfd884 100644 (file)
@@ -69,8 +69,8 @@ void ToSendStuffBit(int b)
 void DbpString(char *str)
 {
        /* this holds up stuff unless we're connected to usb */
-       if (!usbattached)
-               return;
+//     if (!usbattached)
+//             return;
        
        UsbCommand c;
        c.cmd = CMD_DEBUG_PRINT_STRING;
@@ -85,8 +85,8 @@ void DbpString(char *str)
 void DbpIntegers(int x1, int x2, int x3)
 {
        /* this holds up stuff unless we're connected to usb */
-       if (!usbattached)
-               return;
+//     if (!usbattached)
+//             return;
 
        UsbCommand c;
        c.cmd = CMD_DEBUG_PRINT_INTEGERS;
@@ -833,6 +833,9 @@ void UsbPacketReceived(BYTE *packet, int len)
                        LCDReset();
                        break;
 #endif
+               case CMD_READ_MEM:
+                       ReadMem(c->ext1);
+                       break;
                case CMD_SWEEP_LF:
                        SweepLFrange();
                        break;
@@ -864,6 +867,17 @@ void UsbPacketReceived(BYTE *packet, int len)
        }
 }
 
+void ReadMem(int addr)
+{
+       const DWORD *data = ((DWORD *)addr);
+       int i;
+       
+       DbpString("Reading memory at address");
+       DbpIntegers(0, 0, addr);
+       for (i = 0; i < 8; i+= 2)
+               DbpIntegers(0, data[i], data[i+1]);
+}
+
 void AppMain(void)
 {
        memset(BigBuf,0,sizeof(BigBuf));
index 7e40fdd0a300723d358dc6160cb403a9a852858b..67f9349b1eb9dd95b0b82dc94e46f21c018ee60a 100644 (file)
@@ -8,6 +8,7 @@
 #define __APPS_H\r
 \r
 /// appmain.c\r
+void ReadMem(int addr);
 void AppMain(void);\r
 void SamyRun(void);\r
 void DbpIntegers(int a, int b, int c);\r
index eb4342fe28eda5e04bca94401417df0cc404df46..485eff5240dafb70205c1e90587fe6d22d4bca9c 100644 (file)
@@ -2520,6 +2520,14 @@ static void CmdHIDsimTAG(char *str)
        SendCommand(&c, FALSE);\r
 }\r
 \r
+static void CmdReadmem(char *str)\r
+{\r
+       UsbCommand c;\r
+       c.cmd = CMD_READ_MEM;\r
+       c.ext1 = atoi(str);\r
+       SendCommand(&c, FALSE);\r
+}\r
+\r
 static void CmdLcdReset(char *str)\r
 {\r
        UsbCommand c;\r
@@ -2619,7 +2627,7 @@ static struct {
        {"hisamplest",          CmdHi14readt,0,         "    Get samples HF, for testing"},\r
        {"hisimlisten",         CmdHisimlisten,0,       "    Get HF samples as fake tag"},\r
        {"hpf",                         CmdHpf,1,               "    Remove DC offset from trace"},\r
-       {"indalademod",         CmdIndalademod,0,         "['224'] -- Demodulate samples for Indala 64 bit UID (option '224' for 224 bit)"},\r
+       {"indalademod",         CmdIndalademod,0,         "['224'] -- Demodulate samples for Indala 64 bit UID (option '224' for 224 bit)"},\r
        {"lcd",                         CmdLcd,0,                       "<HEX command> <count> -- Send command/data to LCD"},\r
        {"lcdreset",                    CmdLcdReset,0,          "    Hardware reset LCD"},\r
        {"load",                                CmdLoad,1,              "<filename> -- Load trace (to graph window"},\r
@@ -2633,6 +2641,7 @@ static struct {
        {"norm",                                CmdNorm,1,              "    Normalize max/min to +/-500"},\r
        {"plot",                                CmdPlot,1,              "    Show graph window"},\r
        {"quit",                                CmdQuit,1,                      "    Quit program"},\r
+       {"readmem",                     CmdReadmem,0,                   "    [address] Read memory at decimal address from flash"},\r
        {"reset",                       CmdReset,0,                     "    Reset the Proxmark3"},\r
        {"save",                                CmdSave,1,              "<filename> -- Save trace (from graph window)"},\r
        {"scale",                       CmdScale,1,             "<int> -- Set cursor display scale"},\r
index a9f3a2ef49f52b7b7c34cd1a7bffe42a28b0b8a4..5550e5958113df254dc6df14ccc72a473830ecf8 100644 (file)
@@ -42,6 +42,7 @@ static void CmdHi15tag(char *str);
 static void CmdHi14read_sim(char *str);\r
 static void CmdHi14readt(char *str);\r
 static void CmdHisimlisten(char *str);\r
+static void CmdReadmem(char *str);\r
 static void CmdHi14sim(char *str);\r
 static void CmdHi14asim(char *str);\r
 static void CmdHi14snoop(char *str);\r
Impressum, Datenschutz