mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-04-11 15:00:27 +08:00
Print client info also when offline
This commit is contained in:
parent
9bb66bf037
commit
d240367c2a
2 changed files with 58 additions and 57 deletions
client/src
|
@ -967,9 +967,10 @@ void pm3_version(bool verbose, bool oneliner) {
|
|||
# define PM3HOSTARCH " ARCH:unknown"
|
||||
#endif
|
||||
|
||||
char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image
|
||||
|
||||
if (oneliner) {
|
||||
// For "proxmark3 -v", simple printf, avoid logging
|
||||
char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image
|
||||
FormatVersionInformation(temp, sizeof(temp), "Client: ", &g_version_information);
|
||||
PrintAndLogEx(NORMAL, "%s compiled with " PM3CLIENTCOMPILER __VERSION__ PM3HOSTOS PM3HOSTARCH "\n", temp);
|
||||
return;
|
||||
|
@ -978,19 +979,20 @@ void pm3_version(bool verbose, bool oneliner) {
|
|||
if (!verbose)
|
||||
return;
|
||||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_VERSION, NULL, 0);
|
||||
|
||||
if (WaitForResponseTimeout(CMD_VERSION, &resp, 1000)) {
|
||||
char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image
|
||||
PrintAndLogEx(NORMAL, "\n [ " _CYAN_("Proxmark3 RFID instrument") " ]");
|
||||
PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("CLIENT") " ]");
|
||||
FormatVersionInformation(temp, sizeof(temp), " client: ", &g_version_information);
|
||||
PrintAndLogEx(NORMAL, "%s", temp);
|
||||
PrintAndLogEx(NORMAL, " compiled with " PM3CLIENTCOMPILER __VERSION__ PM3HOSTOS PM3HOSTARCH);
|
||||
|
||||
if (g_session.pm3_present) {
|
||||
PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("PROXMARK3") " ]");
|
||||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_VERSION, NULL, 0);
|
||||
|
||||
if (WaitForResponseTimeout(CMD_VERSION, &resp, 1000)) {
|
||||
if (IfPm3Rdv4Fw()) {
|
||||
|
||||
bool is_genuine_rdv4 = false;
|
||||
|
@ -1036,5 +1038,6 @@ void pm3_version(bool verbose, bool oneliner) {
|
|||
|
||||
lookupChipID(payload->id, payload->section_size);
|
||||
}
|
||||
}
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
}
|
||||
|
|
|
@ -250,13 +250,11 @@ main_loop(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
|
|||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||
char script_cmd_buf[256] = {0x00}; // iceman, needs lua script the same file_path_buffer as the rest
|
||||
|
||||
if (g_session.pm3_present) {
|
||||
// cache Version information now:
|
||||
if (execCommand || script_cmds_file || stdinOnPipe)
|
||||
pm3_version(false, false);
|
||||
else
|
||||
pm3_version(true, false);
|
||||
}
|
||||
|
||||
if (script_cmds_file) {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue