Skip to content

Conversation

@kormax
Copy link
Contributor

@kormax kormax commented Nov 29, 2025

A lot of code in cmdhffelica.c was doing one of the following:

  1. Calling AddCrc to the frame data, while also setting FELICA_APPEND_CRC which causes CRC to be appended by the ARM side.
  2. Provisioning an empty byte for length, even though ARM side calculates and adds it automatically in felica_sendraw. This issue also compounded if extra CRC was sent due to 1).

This PR does the following to fix the issue:

  1. Removes wrong invocations (which are all of them) of AddCrc in client code, instead using FELICA_ADD_CRC.
  2. Add a band-aid inside of clear_and_send_command to check if first byte of the payload looks like length, removing it if it is.

The fix was tested with the following commands (with client and ARM built on macOS using clang):

  • hf felica litedump
  • hf felica info
  • hf felica reader
  • hf felica dump
  • hf felica scsvcode

@github-actions
Copy link

You are welcome to add an entry to the CHANGELOG.md as well

@kormax kormax force-pushed the felica-frame-len-crc-bandaid-fix branch from d521763 to 8c8bf54 Compare November 29, 2025 11:56
@kormax kormax marked this pull request as ready for review November 29, 2025 12:09
@iceman1001 iceman1001 merged commit 9b59204 into RfidResearchGroup:master Nov 29, 2025
9 of 12 checks passed
@iceman1001
Copy link
Collaborator

Nice!

We need to push the crc and len additions to device side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants