A lot of changes...
.. ntag simulation stuff from @marshmellows branch "ntag/sim" .. hf mf mifare fixes from @pwpivi. .. hw status command .. speedtest function from @pwpivi .. Viking Functionalities, (not a proper DEMOD, but a start) .. GetCountUS better precision from @pwpivi .. bin2hex, hex2bin from @holiman ... starting with getting the T55x7 CONFIGURATION_BLOCK for different clone situations. Ripped from Adam Lauries RFidler, nothing working or finished.. ... Started working with the T55x7 read command with password actually performs a write block... See Issue #136 https://github.com/Proxmark/proxmark3/issues/136 Not solved yet. ... Started add SHA256.. not working yet..
This commit is contained in:
46
common/cmd.c
46
common/cmd.c
@@ -50,30 +50,32 @@ bool cmd_receive(UsbCommand* cmd) {
|
||||
}
|
||||
|
||||
bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len) {
|
||||
UsbCommand txcmd;
|
||||
|
||||
for (size_t i=0; i<sizeof(UsbCommand); i++) {
|
||||
((byte_t*)&txcmd)[i] = 0x00;
|
||||
}
|
||||
|
||||
// Compose the outgoing command frame
|
||||
txcmd.cmd = cmd;
|
||||
txcmd.arg[0] = arg0;
|
||||
txcmd.arg[1] = arg1;
|
||||
txcmd.arg[2] = arg2;
|
||||
UsbCommand txcmd;
|
||||
|
||||
// Add the (optional) content to the frame, with a maximum size of USB_CMD_DATA_SIZE
|
||||
if (data && len) {
|
||||
len = MIN(len,USB_CMD_DATA_SIZE);
|
||||
for (size_t i=0; i<len; i++) {
|
||||
txcmd.d.asBytes[i] = ((byte_t*)data)[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Send frame and make sure all bytes are transmitted
|
||||
if (usb_write((byte_t*)&txcmd,sizeof(UsbCommand)) != 0) return false;
|
||||
|
||||
return true;
|
||||
// 0x00 the whole command.
|
||||
for (size_t i=0; i < sizeof(UsbCommand); i++)
|
||||
((byte_t*)&txcmd)[i] = 0x00;
|
||||
|
||||
// Compose the outgoing command frame
|
||||
txcmd.cmd = cmd;
|
||||
txcmd.arg[0] = arg0;
|
||||
txcmd.arg[1] = arg1;
|
||||
txcmd.arg[2] = arg2;
|
||||
|
||||
// Add the (optional) content to the frame, with a maximum size of USB_CMD_DATA_SIZE
|
||||
if (data && len) {
|
||||
len = MIN(len, USB_CMD_DATA_SIZE);
|
||||
for (size_t i=0; i<len; i++) {
|
||||
txcmd.d.asBytes[i] = ((byte_t*)data)[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Send frame and make sure all bytes are transmitted
|
||||
if ( usb_write( (byte_t*)&txcmd, sizeof(UsbCommand)) != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user