proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

semi-offline cmds: better error handling

Open doegox opened this issue 5 years ago • 19 comments

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 avatar Jun 28 '19 06:06 doegox

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          

doegox avatar Jun 28 '19 06:06 doegox

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?

iceman1001 avatar Jun 28 '19 13:06 iceman1001

help was just to take a stupid example.

doegox avatar Jul 05 '19 14:07 doegox

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

iceman1001 avatar Jul 05 '19 18:07 iceman1001

can you elaborate ?

doegox avatar Jul 05 '19 22:07 doegox

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    

iceman1001 avatar Jul 06 '19 07:07 iceman1001

like replacing 1 by bf (for buffer) ?

doegox avatar Jul 08 '19 19:07 doegox

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.

iceman1001 avatar Jul 09 '19 04:07 iceman1001

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

doegox avatar Jul 09 '19 08:07 doegox

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

iceman1001 avatar Jul 09 '19 09:07 iceman1001

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 avatar Jul 09 '19 11:07 doegox

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...

doegox avatar Jul 09 '19 11:07 doegox

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 :)

iceman1001 avatar Jul 09 '19 12:07 iceman1001

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

doegox avatar Jul 09 '19 12:07 doegox

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

iceman1001 avatar Jul 09 '19 12:07 iceman1001

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

This one is fixed now

doegox avatar Oct 04 '19 07:10 doegox

which one did you fix?

iceman1001 avatar Oct 04 '19 08:10 iceman1001

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

doegox avatar Oct 04 '19 08:10 doegox

yeah, I found it :) Good one!

iceman1001 avatar Oct 04 '19 09:10 iceman1001