Skip to content

Commit 06ff793

Browse files
authored
Merge branch 'master' into master
Signed-off-by: Jarek Barwinski <116510448+jareckib@users.noreply.github.com>
2 parents 6469c87 + f31ee26 commit 06ff793

File tree

124 files changed

+3726
-2272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+3726
-2272
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ jobs:
4545
- name: Install dependencies
4646
run: sudo apt-get install -yqq make autoconf build-essential ca-certificates pkg-config libreadline-dev gcc-arm-none-eabi libnewlib-dev qtbase5-dev libbz2-dev liblz4-dev libbluetooth-dev libpython3-dev python3 python3-dev libpython3-all-dev liblua5.4-dev liblua5.4-0 lua5.4 sed libssl-dev
4747

48+
- name: Install Python dependencies
49+
run: |
50+
python3 -m pip install --upgrade pip
51+
python3 -m pip install setuptools
52+
python3 -m pip install ansicolors sslcrypto
53+
if [ -f requirements.txt ]; then python3 -m pip install -r requirements.txt; fi
54+
4855
- name: Checkout repository
4956
uses: actions/checkout@v4
5057

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file.
33
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
44

55
## [unreleased][unreleased]
6+
- Improved `pcf7931` generic readability of the code. Unified datatypes and added documentation/explainations (@tinooo)
7+
- Improved `lf pcf7931` read code - fixed some checks for more stability (@tinooo)
8+
- Changed `trace list -t seos` - improved annotation (@iceman1001)
9+
- Added `make commands` to regenerate commands documentation files and autocompletion data independently of `make style` (@doegox)
10+
- Added texecom identification, thanks @en4rab ! (@iceman1001)
11+
- Added `hf 15 slixprotectpage` command
12+
- Fixed `hf mf gload` - missing parameter (@iceman1001)
13+
- Changed `hf mf gload` - now handles 1k ev1 sized dumps (@iceman1001)
14+
- Changed wiegand format unpack functions to clear struct later (@iceman1001)
15+
- Changed `wiegand decode` - now accepts new padding format (@iceman1001)
16+
- Changed `mem spiffs tree` - ID is now shown in decimal (@iceman1001)
17+
- Added sample wiegand format 56bit (@iceman1001)
18+
- Changed Wiegand formats to include number of bits (@iceman1001)
19+
- Fix compilation warning in hitagS (@iceman1001)
20+
- Added new wiegand format H800002 (@jmichelp)
21+
- Changed `Makefile.platform.sample` file - now have clear instructions for generating images for other proxmark3 hardware (@iceman1001)
22+
- Changed `doc/magic_cards_notes.md` - now contains documentation for iKey LLC's MF4 tag (@team-orangeBlue)
623
- Changed `hf mf cload` - now accepts MFC Ev1 sized dumps (@iceman1001)
724
- Changed `hf mfu info` - now properly identify ULEv1 AES 50pF (@iceman1001)
825
- Changed `hf mf info` - now differentiates between full USCUID and cut down ZUID chips (@nvx)

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ help:
204204
@echo "+ fpga_compress - Make tools/fpga_compress"
205205
@echo
206206
@echo "+ style - Apply some automated source code formatting rules"
207+
@echo "+ commands - Regenerate commands documentation files and autocompletion data
207208
@echo "+ check - Run offline tests. Set CHECKARGS to pass arguments to the test script"
208209
@echo "+ .../check - Run offline tests against specific target. See above."
209210
@echo "+ miscchecks - Detect various encoding issues in source code"
@@ -303,7 +304,7 @@ endif
303304
# easy printing of MAKE VARIABLES
304305
print-%: ; @echo $* = $($*)
305306

306-
style:
307+
style: commands
307308
# Make sure astyle is installed
308309
@command -v astyle >/dev/null || ( echo "Please install 'astyle' package first" ; exit 1 )
309310
# Remove spaces & tabs at EOL, add LF at EOF if needed on *.c, *.h, *.cpp. *.lua, *.py, *.pl, Makefile, *.v, pm3
@@ -317,13 +318,14 @@ style:
317318
--keep-one-line-blocks --max-continuation-indent=60 \
318319
--style=google --pad-oper --unpad-paren --pad-header \
319320
--align-pointer=name {} \;
321+
322+
commands:
320323
# Update commands.md
321324
[ -x client/proxmark3 ] && client/proxmark3 -m | tr -d '\r' > doc/commands.md
322325
# Make sure python3 is installed
323326
@command -v python3 >/dev/null || ( echo "Please install 'python3' package first" ; exit 1 )
324327
# Update commands.json, patch port in case it was run under Windows
325328
[ -x client/proxmark3 ] && client/proxmark3 --fulltext | sed 's#com[0-9]#/dev/ttyACM0#'|python3 client/pyscripts/pm3_help2json.py - - | tr -d '\r' > doc/commands.json
326-
327329
# Update the readline autocomplete autogenerated code
328330
[ -x client/proxmark3 ] && client/proxmark3 --fulltext | python3 client/pyscripts/pm3_help2list.py - - | tr -d '\r' > client/src/pm3line_vocabulary.h
329331

Makefile.platform.sample

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# If you want to use it, copy this file as Makefile.platform and adjust it to your needs
22
# Run 'make PLATFORM=' to get an exhaustive list of possible parameters for this file.
33

4+
# By default PM3 RDV4 image is generated.
5+
# Comment the line below and uncomment further down according to which device you have
46
PLATFORM=PM3RDV4
7+
8+
# For PM3 Easy:
9+
# uncomment the line below
510
#PLATFORM=PM3GENERIC
11+
12+
# For ICOPY-X and PM3 Max:
13+
# uncomment the two lines below
14+
#PLATFORM=PM3ICOPY3
15+
#PLATFORM_EXTRAS=FLASH
16+
17+
618
# If you want more than one PLATFORM_EXTRAS option, separate them by spaces:
719
#PLATFORM_EXTRAS=BTADDON
820
#PLATFORM_EXTRAS=FLASH
921
#PLATFORM_EXTRAS=SMARTCARD
1022
#PLATFORM_EXTRAS=BTADDON FLASH
1123
#STANDALONE=LF_SAMYRUN
1224

25+
1326
# Uncomment the line below to set the correct LED order on board Proxmark3 Easy
1427
# Only available with PLATFORM=PM3GENERIC
1528
#LED_ORDER=PM3EASY

armsrc/BigBuf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,10 @@ bool RAMFUNC LogTraceBits(const uint8_t *btBytes, uint16_t bitLen, uint32_t time
321321
// Emulator memory
322322
int emlSet(const uint8_t *data, uint32_t offset, uint32_t length) {
323323
uint8_t *mem = BigBuf_get_EM_addr();
324-
if (!mem) {
324+
if (mem == NULL) {
325325
return PM3_EMALLOC;
326326
}
327+
327328
if (offset + length <= CARD_MEMORY_SIZE) {
328329
memcpy(mem + offset, data, length);
329330
return PM3_SUCCESS;
@@ -335,9 +336,10 @@ int emlSet(const uint8_t *data, uint32_t offset, uint32_t length) {
335336

336337
int emlGet(uint8_t *out, uint32_t offset, uint32_t length) {
337338
uint8_t *mem = BigBuf_get_EM_addr();
338-
if (!mem) {
339+
if (mem == NULL) {
339340
return PM3_EMALLOC;
340341
}
342+
341343
if (offset + length <= CARD_MEMORY_SIZE) {
342344
memcpy(out, mem + offset, length);
343345
return PM3_SUCCESS;

armsrc/Standalone/hf_colin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void WriteTagToFlash(uint32_t uid, size_t size) {
311311
uint32_t len = size;
312312
uint8_t data[(size * (16 * 64)) / 1024];
313313

314-
emlGetMem(data, 0, (size * 64) / 1024);
314+
emlGetMem_xt(data, 0, (size * 64) / 1024, MIFARE_BLOCK_SIZE);
315315

316316
char dest[SPIFFS_OBJ_NAME_LEN];
317317
uint8_t buid[4];
@@ -646,7 +646,7 @@ void RunMod(void) {
646646
emlClearMem();
647647
uint8_t mblock[16];
648648
for (uint8_t sectorNo = 0; sectorNo < sectorsCnt; sectorNo++) {
649-
emlGetMem(mblock, FirstBlockOfSector(sectorNo) + NumBlocksPerSector(sectorNo) - 1, 1);
649+
emlGetMem_xt(mblock, FirstBlockOfSector(sectorNo) + NumBlocksPerSector(sectorNo) - 1, 1, MIFARE_BLOCK_SIZE);
650650
for (uint8_t t = 0; t < 2; t++) {
651651
memcpy(mblock + t * 10, foundKey[t][sectorNo], 6);
652652
}
@@ -807,7 +807,7 @@ int e_MifareECardLoad(uint32_t numofsectors, uint8_t keytype) {
807807
emlSetMem_xt(dataoutbuf, FirstBlockOfSector(s) + blockNo, 1, 16);
808808
} else {
809809
// sector trailer, keep the keys, set only the AC
810-
emlGetMem(dataoutbuf2, FirstBlockOfSector(s) + blockNo, 1);
810+
emlGetMem_xt(dataoutbuf2, FirstBlockOfSector(s) + blockNo, 1, MIFARE_BLOCK_SIZE);
811811
memcpy(&dataoutbuf2[6], &dataoutbuf[6], 4);
812812
emlSetMem_xt(dataoutbuf2, FirstBlockOfSector(s) + blockNo, 1, 16);
813813
}
@@ -878,7 +878,7 @@ void saMifareMakeTag(void) {
878878
int flags = 0;
879879
for (int blockNum = 0; blockNum < 16 * 4; blockNum++) {
880880
uint8_t mblock[16];
881-
emlGetMem(mblock, blockNum, 1);
881+
emlGetMem_xt(mblock, blockNum, 1, MIFARE_BLOCK_SIZE);
882882
// switch on field and send magic sequence
883883
if (blockNum == 0)
884884
flags = 0x08 + 0x02;

armsrc/Standalone/hf_mattyrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void RunMod(void) {
500500
uint8_t mblock[MIFARE_BLOCK_SIZE];
501501
for (uint8_t sectorNo = 0; sectorNo < sectorsCnt; ++sectorNo) {
502502
if (validKey[0][sectorNo] || validKey[1][sectorNo]) {
503-
emlGetMem(mblock, FirstBlockOfSector(sectorNo) + NumBlocksPerSector(sectorNo) - 1, 1);
503+
emlGetMem_xt(mblock, FirstBlockOfSector(sectorNo) + NumBlocksPerSector(sectorNo) - 1, 1, MIFARE_BLOCK_SIZE);
504504
for (uint8_t keyType = 0; keyType < 2; ++keyType) {
505505
if (validKey[keyType][sectorNo]) {
506506
memcpy(mblock + keyType * 10, foundKey[keyType][sectorNo], 6);

armsrc/Standalone/hf_msdsal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void RunMod(void) {
445445
// received a RATS request
446446
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) {
447447
prevCmd = 0;
448-
p_response = &responses[RESP_INDEX_RATS];
448+
p_response = &responses[RESP_INDEX_ATS];
449449

450450
} else {
451451
if (g_dbglevel == DBG_DEBUG) {

armsrc/Standalone/hf_reblay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void RunMod() {
338338
} else if (receivedCmd[1] == 0x70 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && len == 9) { // Received a SELECT (cascade 1)
339339
p_response = &responses[RESP_INDEX_SAKC1];
340340
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) { // Received a RATS request
341-
p_response = &responses[RESP_INDEX_RATS];
341+
p_response = &responses[RESP_INDEX_ATS];
342342
resp = 1;
343343
} else if (receivedCmd[0] == 0xf2 && len == 4) { // ACKed - Time extension
344344
DbpString(_YELLOW_("!!") " Reader accepted time extension!");

armsrc/Standalone/hf_tcprst.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void RunMod(void) {
247247
} else if (receivedCmd[1] == 0x70 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT_2 && len == 9) { // Received a SELECT (cascade 2)
248248
p_response = &responses[RESP_INDEX_SAKC2];
249249
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) { // Received a RATS request
250-
p_response = &responses[RESP_INDEX_RATS];
250+
p_response = &responses[RESP_INDEX_ATS];
251251
} else if (receivedCmd[0] == ISO14443A_CMD_PPS) {
252252
p_response = &responses[RESP_INDEX_PPS];
253253
} else {
@@ -425,7 +425,7 @@ void RunMod(void) {
425425
} else if (receivedCmd[1] == 0x70 && receivedCmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT_2 && len == 9) { // Received a SELECT (cascade 2)
426426
p_response = &responses[RESP_INDEX_SAKC2];
427427
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) { // Received a RATS request
428-
p_response = &responses[RESP_INDEX_RATS];
428+
p_response = &responses[RESP_INDEX_ATS];
429429
} else if (receivedCmd[0] == ISO14443A_CMD_PPS) {
430430
p_response = &responses[RESP_INDEX_PPS];
431431
} else {

0 commit comments

Comments
 (0)