RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.65k stars 981 forks source link

hf 15 raw commands - change to response timeout selection (write alike timing) #2246

Closed Chris-P-Young closed 6 months ago

Chris-P-Young commented 6 months ago

Description of issue The ISO15693 spec defines two different timings for tag response. These are read response and "write alike". The response time for "write alike" is much longer and is provided for situations where the tag needs to process a write command before responding.

The hf 15 raw command is provided by the PM3 client to issue ISO15693 raw commands. This is implemented on the ARM MCU via the DirectTag15693Command in iso15693.c Currently this function evaluates which response timeout to use by parsing the command string passed to it. A switch/case statement checks the command string against a list of command values and chooses either reader timing or "write alike" timing depending on which command is matched. If the command is not recognised, reader timing is selected by default. If the command requires "write alike" timing, but is not listed in the switch/case block then reader timing will be used and the command will likely miss the reply back from the tag.

This is not a good solution for a "raw command mode" because it depends heavily on the code recognising the command to chose the correct response timing model. We need to be able to write any byte sequence to the tag.

This issue is referenced in Issue #2244 and a poor fix to add two ICODE SLIX-L custom commands is added in PR #2245. However, a clean fix is required.

Requested Action The switch/case code block in function DirectTag15693Command (iso15693.c ) should be removed and replaced with code that handles the response timeout selection in a way that does not depend on recognising the command the user is trying to send.

Proposal Add an extra command option flag for hf 15 raw. This would control if "reader" or "write alike" response timing is used to control the DirectTag15693Command response. Default option could be "reader" timing if the option flag is not specified.

Unfortunately, my coding skills are probably not up to providing a clean implementation, so I leave this to the experts.

iceman1001 commented 6 months ago

try https://github.com/RfidResearchGroup/proxmark3/commit/8d0b41a911ca308eac990cc6bdb21d3fd073ef1c and see if this works better.