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;
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;
LCDReset();
break;
#endif
+ case CMD_READ_MEM:
+ ReadMem(c->ext1);
+ break;
case CMD_SWEEP_LF:
SweepLFrange();
break;
}
}
+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));
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
{"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
{"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