This commit is contained in:
iceman1001 2024-11-02 15:14:55 +01:00
commit 3317175a82
2 changed files with 11 additions and 4 deletions

View file

@ -125,7 +125,7 @@ int infoThinFilm(bool verbose) {
SendCommandNG(CMD_HF_THINFILM_READ, NULL, 0); SendCommandNG(CMD_HF_THINFILM_READ, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_HF_THINFILM_READ, &resp, 1500)) { if (WaitForResponseTimeout(CMD_HF_THINFILM_READ, &resp, 1500) == false) {
PrintAndLogEx(WARNING, "timeout while waiting for reply."); PrintAndLogEx(WARNING, "timeout while waiting for reply.");
return PM3_ETIMEOUT; return PM3_ETIMEOUT;
} }
@ -186,9 +186,16 @@ int CmdHfThinFilmSim(const char *Cmd) {
int ret; int ret;
while (!(ret = kbd_enter_pressed())) { while (!(ret = kbd_enter_pressed())) {
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 500) == 0) continue;
if (resp.status != PM3_SUCCESS) break; if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 500) == 0) {
continue;
}
if (resp.status != PM3_SUCCESS) {
break;
}
} }
if (ret) { if (ret) {
PrintAndLogEx(INFO, "Client side interrupted"); PrintAndLogEx(INFO, "Client side interrupted");
PrintAndLogEx(WARNING, "Simulation still running on Proxmark3 till next command or button press"); PrintAndLogEx(WARNING, "Simulation still running on Proxmark3 till next command or button press");

View file

@ -365,7 +365,7 @@ static int CmdEM410xDemod(const char *Cmd) {
bool invert = arg_get_lit(ctx, 4); bool invert = arg_get_lit(ctx, 4);
bool amplify = arg_get_lit(ctx, 5); bool amplify = arg_get_lit(ctx, 5);
uint8_t bin[512] = {0}; uint8_t bin[512] = {0};
int bin_len = sizeof(bin) - 1; // CLIGetStrWithReturn does not guarantee string to be null-terminated int bin_len = sizeof(bin) - 1; // CLIGetStrWithReturn does not guarantee string to be null-terminated
CLIGetStrWithReturn(ctx, 6, bin, &bin_len); CLIGetStrWithReturn(ctx, 6, bin, &bin_len);
CLIParserFree(ctx); CLIParserFree(ctx);