mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 07:05:40 -07:00
comments to @merlokk
This commit is contained in:
parent
a49e2ff342
commit
d7165b3aa9
1 changed files with 21 additions and 3 deletions
|
@ -599,7 +599,7 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||||
if (iddatalen == 4) {
|
if (iddatalen == 4) {
|
||||||
rawdata[0] = 0xff;
|
rawdata[0] = 0xff;
|
||||||
rawdata[1] = 0xff;
|
rawdata[1] = 0xff;
|
||||||
rawdata[2] = (modulation == 0) ? 0x63 : 0xca;
|
rawdata[2] = (modulation == 0) ? 0x63 : 0xCA;
|
||||||
memcpy(&rawdata[3], iddata, 4);
|
memcpy(&rawdata[3], iddata, 4);
|
||||||
rawdata[7] = (modulation == 0) ? TexcomTK13CRC(iddata) : TexcomTK17CRC(iddata);
|
rawdata[7] = (modulation == 0) ? TexcomTK13CRC(iddata) : TexcomTK17CRC(iddata);
|
||||||
rawdatalen = 8;
|
rawdatalen = 8;
|
||||||
|
@ -610,6 +610,23 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//iceman, use a struct
|
||||||
|
/*
|
||||||
|
struct p {
|
||||||
|
uint8_t modulation;
|
||||||
|
uint32_t timeout;
|
||||||
|
uint8_t data[8];
|
||||||
|
} PACKED payload;
|
||||||
|
|
||||||
|
payload.modulation = modulation;
|
||||||
|
payload.timeout = cmdtimeout;
|
||||||
|
memcpy(payload.data, rawdata, sizeof(payload.data));
|
||||||
|
|
||||||
|
SendCommandNG(CMD_HF_TEXKOM_SIMULATE, (uint8_t*)&payload, sizeof(payload));
|
||||||
|
|
||||||
|
// Iceman, cmdtimeout is always 0. You never set it
|
||||||
|
*/
|
||||||
|
|
||||||
// <texkom 8bytes><modulation 1b><timeout 4b>
|
// <texkom 8bytes><modulation 1b><timeout 4b>
|
||||||
uint8_t data[13] = {0};
|
uint8_t data[13] = {0};
|
||||||
memcpy(data, rawdata, 8);
|
memcpy(data, rawdata, 8);
|
||||||
|
@ -621,9 +638,10 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||||
|
|
||||||
if (cmdtimeout > 0 && cmdtimeout < 2800) {
|
if (cmdtimeout > 0 && cmdtimeout < 2800) {
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
if (!WaitForResponseTimeout(CMD_HF_TEXKOM_SIMULATE, &resp, 3000)) {
|
if (WaitForResponseTimeout(CMD_HF_TEXKOM_SIMULATE, &resp, 3000) == false) {
|
||||||
if (verbose)
|
if (verbose) {
|
||||||
PrintAndLogEx(WARNING, "(hf texkom simulate) command execution time out");
|
PrintAndLogEx(WARNING, "(hf texkom simulate) command execution time out");
|
||||||
|
}
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(INFO, "simulate command execution done");
|
PrintAndLogEx(INFO, "simulate command execution done");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue