RfidResearchGroup / proxmark3

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

semi-offline cmds: better error handling #864

Open doegox opened 5 years ago

doegox commented 5 years ago

e.g. hf search / lf search are isAlwaysAvailable because they can work offline somehow. make sure they exit properly when used offline with some online usages

doegox commented 5 years ago

Even when quitting there is an attempt to send data to proxmark

client/proxmark3 -c "help"
[+] execute command from commandline: help 
[=] Running in OFFLINE mode. Check "client/proxmark3 -h" if it's not what you want.
pm3 --> help          
...
Sending bytes to proxmark failed - offline          
iceman1001 commented 5 years ago

thats a strange one. But for sure. There is the lf search 1 where 1 indicate to use offline or the data is in graphbuffer.

But why would help send anything to the device?

doegox commented 5 years ago

help was just to take a stupid example.

iceman1001 commented 5 years ago

I would like to see a general parameter for OFFLINE / ONLINE actions....

doegox commented 5 years ago

can you elaborate ?

iceman1001 commented 5 years ago

Here the parameter 1 denotate offline, or use data in graphbuffer

pm3 -> lf search 1

as seen here also under LF, the parameter 1 denotate T55x7 vs Q5

pm3->   lf em 410x_write 0F0368568B 1    
doegox commented 5 years ago

like replacing 1 by bf (for buffer) ?

iceman1001 commented 5 years ago

b bytes f filename bf.. --offline -o output filename --t55x7 --t5555 --graphbuff -gb

There is many alternativs when using long parameter names.

When in offline we could also assume "1" as in offline... but that would make it more complex when we are online and what to use data from buffer.

hrm, should have those commands in a cheatsheet, Alex dibs is most likely working on making his sheet into a PR for us.

doegox commented 5 years ago

what about moving the offline operations to data?

pm3-> data search
pm3-> lf search

there are already data rawdemod, data biphaserawdecode etc. and maybe for all the lf XX demod, do

pm3-> data demod [em410x|awid|cotag|...]

And lf will always be for online. Behind the hood, we can have some way e.g. for data demod em410x to call lf em 410x_demod on the graphbuff

iceman1001 commented 5 years ago

Interesting concept. Not sure about it at all. I tend to like the complete commands for lf em / lf awid etc.

doegox commented 5 years ago

Hmm https://github.com/RfidResearchGroup/proxmark3/issues/231 was again a nice example of user confusion... And I also got confused... actually lf em 410x_demod works only on graphbuff so my data demod was non sense. So maybe we could first list these functions working both on live & offline to have a clearer view of the situation...

LF:
lf t55xx trace [1]
lf t55xx info [1] [d <data> [q]]
lf t55xx detect [1] [p <password>]
lf t55xx p1detect [1] [p <password>]
lf search [h] <0|1> [u]
HF/LF:
trace list <protocol> [f][c| <0|1>

Is that it ?

doegox commented 5 years ago

The case of trace list is very confusing. There are also all the lf hitag list, hf 14a list etc which can't act offline at all. And e.g. hf 14a list is available offline but still requires the pm3...

iceman1001 commented 5 years ago

the 'hf list' is the old way which I kept since I think its easy to see / understand. It only links to trace list anyway. Those should be always available in commandtable, but that is one of the adjustments to the off/online stuff you did in the command tables. Not a biggy but needs to be done.

I don't know which commands is available in offline. However its a powerful possibility to share data and analyse without having the card. I guess you searched for [1] in client folder :)

doegox commented 5 years ago

Those should be always available in commandtable, but that is one of the adjustments to the off/online stuff you did in the command tables

Well it's not just about command visibility when offline, currently hf 14a list cannot work on the graphbuffer at all:

static int CmdHF14AList(const char *Cmd) {
    (void)Cmd; // Cmd is not used so far
    //PrintAndLogEx(NORMAL, "Deprecated command, use 'hf list 14a' instead");
    CmdTraceList("14a");
    return 0;
}

and probably same story for the other protocols

iceman1001 commented 5 years ago

Good catch. You are right. That is another side of this problem

doegox commented 4 years ago

Even when quitting there is an attempt to send data to proxmark

This one is fixed now

iceman1001 commented 4 years ago

which one did you fix?

doegox commented 4 years ago

"Sending bytes to proxmark failed - offline " on exit cf https://github.com/RfidResearchGroup/proxmark3/commit/8a7274ec344be44588e33c7c704d3afa1bed7e87

iceman1001 commented 4 years ago

yeah, I found it :) Good one!