Skip to content

Commit 447bb78

Browse files
authored
Merge pull request #2663 from douniwan5788/fix_concatbits_again
fix Hitag S concatbits and `lf em 410x clone --hts`
2 parents d39775c + f0b9340 commit 447bb78

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

client/src/cmdlfem410x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ static int CmdEM410xClone(const char *Cmd) {
732732

733733
packet.cmd = HTSF_82xx;
734734
memcpy(packet.pwd, "\xBB\xDD\x33\x99", HITAGS_PAGE_SIZE);
735+
packet.mode = HITAGS_UID_REQ_FADV;
735736
SendCommandNG(CMD_LF_HITAGS_WRITE, (uint8_t *)&packet, sizeof(packet));
736737
if (WaitForResponseTimeout(CMD_LF_HITAGS_WRITE, &resp, 4000) == false) {
737738
PrintAndLogEx(WARNING, "timeout while waiting for reply.");

common/commonutil.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ size_t concatbits(uint8_t *dest, int dest_offset, const uint8_t *src, int src_of
554554
end = nbits;
555555
step = 1;
556556
} else {
557-
i = nbits;
558-
end = 0;
557+
i = nbits - 1;
558+
end = -1;
559559
step = -1;
560560
}
561561

include/hitag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ typedef struct {
161161
uint8_t logdata_1[4];
162162
uint8_t nonce[4];
163163

164-
//Hitag s section
164+
// Hitag S section
165165
uint8_t mode;
166166
} PACKED lf_hitag_data_t;
167167

0 commit comments

Comments
 (0)