Commit graph

88 commits

Author SHA1 Message Date
iceman1001
4b92118f1f clear trace log before starting to run hf iclass tear 2025-05-25 11:29:43 +02:00
iceman1001
cef07dedf6 code style, code clean up of redundant functions, comments, its many minor fixes across the platform. Sorry for not making 20 commits 2025-02-21 15:38:33 +01:00
Shawn Hoffman
aa286b4a16 fix bigbuf allocators (tracing + malloc) overwriting each other
* BigBuf.c: use s_ prefix for statics
* BigBuf_Clear_ext already calls clear_trace, so remove extra calls
* add some sanity checking of allocator args
* dont compare PDC_RNCR to false
2025-01-24 15:56:45 -08:00
douniwan5788
ea9da498a7 refactor: change BigBuf to const 2024-09-21 23:35:36 +08:00
iceman1001
4e540053e9 style 2024-04-07 11:38:51 +02:00
iceman1001
3ea2cb0eda faster return 2024-04-03 17:14:44 +02:00
iceman1001
700d558432 move hitag2 crypto parts to the common folder in order to be able to use it on the client side. Some textual and minor adaptations across the bord 2024-03-27 09:32:00 +01:00
iceman1001
6c1ebc3398 cleaning up redundant functions. the extra checks in bigbuff might affect simulation 2024-01-24 23:41:48 +01:00
iceman1001
2be0bd14ee revert change of DMA size 2024-01-23 19:17:45 +01:00
nvx
da564aed3c Fix hf sniff
This was broken in commit 17ab86c52 as the forced rounding up of
the size to 4-byte alignment in BigBuf_malloc made the size check
possibly larger than the buffer size as the check was always +3 on
the requested size rather than the rounded size. This was made
worse by BigBuf_max_traceLen not taking into account alignment
either and the alignmentn check in hfsnoop.c checking to 2 byte
alignment instead of 4 byte alignment.

The alignment size check now checks the size after alignment
rounding, and BigBuf_max_traceLen takes into account alignment
losses too reducing the need for BigBuf consumers to have to care
about alignment.
2024-01-24 00:10:05 +10:00
iceman1001
73843fd366 testing to extent DMA buffer to 768 bytes 2024-01-15 17:36:19 +01:00
iceman1001
21e54ba9b1 adjust 14b apdu which seems to trigger memory corruption device side 2024-01-01 21:49:32 +01:00
iceman1001
95d1d5646f an attempt to reduce some stack memory. No need for the debug printing to be 512 bytes. Now limited to 200 chars 2023-12-14 23:29:43 +01:00
iceman1001
17ab86c52c make sure limit match up with the multiple of 4 bytes alignment 2023-12-14 00:30:15 +01:00
Henry Gabryjelski
5e71621c69 const improvement for BigBuf.h 2023-08-08 20:52:21 -07:00
iceman1001
6ba002725f rmeoved some fct devices side regarding eml get/ set 2023-07-27 18:55:41 +02:00
iceman1001
8793f1c9c5 color 2023-07-26 23:33:05 +02:00
iceman1001
df49565c04 style 2022-03-23 17:49:09 +01:00
Philippe Teuwen
b703bb746b Adapting license headers, WIP 2022-01-06 02:20:38 +01:00
Philippe Teuwen
8a85702662 hitags: don't record SOF in trace and demodulate AC frame 2021-12-30 01:11:12 +01:00
Philippe Teuwen
323f70ff7a Add partial byte annotation in Hitag traces
Example:
[usb] pm3 --> trace load -f traces/lf_HitagS256_dump.trace
[+] loaded 287 bytes from binary file traces/lf_HitagS256_dump.trace
[+] Recorded Activity (TraceLen = 287 bytes)
[?] try `trace list -1 -t ...` to view trace.  Remember the `-1` param
[usb] pm3 --> trace list -1 -t hitags -c
[+] Recorded activity (trace len = 287 bytes)
[=] start = start of start frame end = end of frame. src = source of transfer
[=] Hitag1 / Hitag2 / HitagS - Timings in ETU (8us)

      Start |        End | Src | Data (! denotes parity error)
------------+------------+-----+-----------------------------------------
          0 |          0 | Rdr |18(5)
        117 |        117 | Tag |0f(4) 2c  ab  cc  b3  cf  32  bf [2f]
          0 |          0 | Rdr |00(5) 21  a5  b4  73 [8c]
        117 |        117 | Tag |0f(4) c9  00  00  aa [75]
          0 |          0 | Rdr |0c(4) 00 [ab]
        117 |        117 | Tag |0f(4) 21  a5  b4  73 [53]
          0 |          0 | Rdr |0c(4) 01 [b6]
        117 |        117 | Tag |0f(4) c9  00  00  aa [75]
          0 |          0 | Rdr |0c(4) 02 [91]
        117 |        117 | Tag |0f(4) 48  54  4f  4e [2c]
          0 |          0 | Rdr |0c(4) 03 [8c]
        117 |        117 | Tag |0f(4) 4d  49  4b  52 [1e]
          0 |          0 | Rdr |0c(4) 04 [df]
        117 |        117 | Tag |0f(4) 00  00  00  00 [a6]
          0 |          0 | Rdr |0c(4) 05 [c2]
        117 |        117 | Tag |0f(4) 00  00  00  00 [a6]
          0 |          0 | Rdr |0c(4) 06 [e5]
        117 |        117 | Tag |0f(4) 00  00  00  00 [a6]
          0 |          0 | Rdr |0c(4) 07 [f8]
        117 |        117 | Tag |0f(4) 57  5f  4f  4b [88]
          0 |          0 | Rdr |0c(4) 08 [43]
2021-12-29 23:48:16 +01:00
Philippe Teuwen
88308ea727 typos 2021-10-10 01:35:45 +02:00
Philippe Teuwen
5b54385347 rename globals 2021-08-21 23:08:26 +02:00
Philippe Teuwen
a330401769 change strategy for refs to linker symbols to get compatible again with old GCC (6.3), tested on GCC 11 too 2021-05-25 16:47:13 +02:00
Philippe Teuwen
13a9afa36d Uniformize source code ref and fix gcc 11.1 warning
Using "extern char linker_symbol[]" notation
cf https://sourceware.org/binutils/docs/ld/Source-Code-Reference.html
2021-05-13 23:12:15 +02:00
iceman1001
a6712295c7 textual - hw status on device side 2021-05-11 16:11:33 +02:00
Philippe Teuwen
e62dfa3bcd typos 2021-04-16 01:53:07 +02:00
Philippe Teuwen
f63cf02178 make style 2020-11-07 01:32:43 +01:00
iceman1001
cd20b208d0 bigbuf calloc ftc where the memory is set to zero before 2020-11-02 19:07:03 +01:00
Philippe Teuwen
c3c59e35cb make style 2020-09-30 14:27:19 +02:00
iceman1001
566d6dc4b7 boundry check for tosend buffer 2020-09-28 17:46:12 +02:00
iceman1001
730a233149 clear bigbuff also should reset tracelen 2020-08-17 09:12:28 +02:00
Philippe Teuwen
4ed57c7c4d make style 2020-08-13 12:25:04 +02:00
iceman1001
3b90f5389a larger 2020-08-03 17:36:39 +02:00
iceman1001
df404a652a duration isnt 15bits, its 16. length is 15bits. 2020-07-21 10:49:29 +02:00
iceman1001
3354f0d9d3 unified static dma buffer as bigbuf_malloc, less pressure on stack size 2020-07-15 15:16:35 +02:00
iceman1001
d2a66cecba style 2020-07-14 15:44:38 +02:00
iceman1001
830ecd6e13 debugs 2020-07-13 22:05:11 +02:00
iceman1001
a6c240fe3b tosend into bigbuff 2020-07-13 17:56:19 +02:00
iceman1001
e7127514db change debug 2020-07-13 12:26:26 +02:00
iceman1001
27c4d994ac remove some debugstatments, use hdr.frame instead 2020-07-13 12:20:12 +02:00
iceman1001
a25a5322dd fpga: added iCLASS on deviceside 2020-07-10 16:37:56 +02:00
iceman1001
ed5471a895 fpga 2020-07-09 19:40:54 +02:00
Philippe Teuwen
f69739da79 make style 2020-06-19 18:34:47 +02:00
iceman1001
3832cf26fd color 2020-06-11 19:20:59 +02:00
slurdge
c89fc81fcf Make BigBuf take dynamically the available space with a fixed (4K) stack 2020-06-10 12:41:18 +02:00
Philippe Teuwen
be42995f8a Less fantasy in the LogTrace usages regarding timestamps 2020-05-19 20:19:44 +02:00
Philippe Teuwen
37ae102e38 LogTrace error msg 2020-05-19 19:09:25 +02:00
Philippe Teuwen
23d754c85f fix max duration in LogTrace 2020-05-19 02:48:03 +02:00
Philippe Teuwen
a999243a45 use tracelog struct in arm too 2020-05-19 02:39:39 +02:00