Add files via upload

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
Niel Nielsen authored and Philippe Teuwen committed 2026-09-01 17:57:31 +02:00
1 parent 769dc479c2
commit f8a0ed0096
3 files changed
+11 -5

No files matched your search

+4 -2
View File
@@ -182,7 +182,8 @@ static int pm3_sign_write(uint8_t *signature, uint8_t slen) {
clearCommandBuffer();
PacketResponseNG resp;
SendCommandNG(CMD_FLASHMEM_WRITE, (uint8_t *)&payload, (sizeof(payload) - sizeof(payload.data)) + payload.len);
uint32_t plen = (sizeof(payload) - sizeof(payload.data)) + payload.len; // header + valid data, not the padded struct
SendCommandNG(CMD_FLASHMEM_WRITE, (uint8_t *)&payload, plen);
if (WaitForResponseTimeout(CMD_FLASHMEM_WRITE, &resp, 2000) == false) {
PrintAndLogEx(WARNING, "timeout while waiting for reply");
@@ -516,7 +517,8 @@ static int CmdFlashMemLoad(const char *Cmd) {
.len = bytes_in_packet,
};
memcpy(payload.data, data + bytes_sent, bytes_in_packet);
SendCommandNG(CMD_FLASHMEM_WRITE, (uint8_t *)&payload, (sizeof(payload) - sizeof(payload.data)) + payload.len);
uint32_t plen = (sizeof(payload) - sizeof(payload.data)) + payload.len;
SendCommandNG(CMD_FLASHMEM_WRITE, (uint8_t *)&payload, plen);
bytes_remaining -= bytes_in_packet;
bytes_sent += bytes_in_packet;
+6 -2
View File
@@ -3396,7 +3396,9 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
} else {
uint32_t maxkeys = (pm3_max_cmd_data_size() - sizeof(mf_chkkeys_fast_t)) / 6;
if (maxkeys > 255) maxkeys = 255;
if (maxkeys > 255) {
maxkeys = 255;
}
uint32_t chunksize = key_cnt > maxkeys ? maxkeys : key_cnt;
bool firstChunk = true, lastChunk = false;
@@ -4048,7 +4050,9 @@ static int CmdHF14AMfChk_fast(const char *Cmd) {
}
uint32_t maxkeys = (pm3_max_cmd_data_size() - sizeof(mf_chkkeys_fast_t)) / 6;
if (maxkeys > 255) maxkeys = 255;
if (maxkeys > 255) {
maxkeys = 255;
}
uint32_t chunksize = (keycnt > maxkeys) ? maxkeys : keycnt;
bool firstChunk = true, lastChunk = false;
+1 -1
View File
@@ -1336,7 +1336,7 @@ static int CmdSmartBruteforceSFI(const char *Cmd) {
int hexlen = 0;
uint8_t cmddata[PM3_CMD_DATA_SIZE];
int res = param_gethex_to_eol(caid, 0, cmddata, (int)(pm3_max_cmd_data_size() - sizeof(smart_card_raw_t)), &hexlen);
int res = param_gethex_to_eol(caid, 0, cmddata, sizeof(cmddata), &hexlen);
if (res) {
continue;
}