RfidResearchGroup / proxmark3

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

$HOME and windows 10 command line. #392

Closed mwalker33 closed 5 years ago

mwalker33 commented 5 years ago

Describe the bug Minor bug on windows 10, there is no environment variable HOME, so when running the client on a windows command line "proxmark3.exe "

Result: Could not retrieve $HOME from the environment [!!] No history will be recorded

If you set the HOME environment variable, it will fail to create the folder Could not create user directory \Users\mwalker/.proxmark3/

a "mkdir \Users\mwalker/.proxmark3/" from the command line also fails. Changing the slash to backslash works.

[!!] No history will be recorded

Expected behavior Maybe default to proxmark3.exe folder if no $HOME is found (my preferred) ?

Desktop (please complete the following information):

[=] You can cancel this operation by pressing the pm3 button ..

[+] LF antenna: 37.25 V - 125.00 kHz [+] LF antenna: 28.75 V - 134.00 kHz [+] LF optimal: 37.11 V - 123.71 kHz [+] LF antenna is OK

[+] HF antenna: 48.44 V - 13.56 MHz [+] HF antenna is OK

[+] Displaying LF tuning graph. Divisor 89 is 134kHz, 95 is 125kHz.

Additional context Minor issue: Tested commands seem to work ok. It found the mfc_default_keys.dic in the client folder OK.

doegox commented 5 years ago

Are you using ProxSpace3.2 or is it a manual setup? (I think it works under PS3.2) If it's a manual setup, could you share instructions how to reproduce your setup? Thanks.

mwalker33 commented 5 years ago

If I run it under ProxSpace it works ok/as expected.

The issue is if you run direct from the command-line, no ProxSpace Up until now, I have used ProxSpace to build, but run direct (and have been referencing other folders outside of proxspace e.g. d:\pm3\traces or to use custom dic files.

If I create the HOME environment variable (under windows) and create the .proxmark3 folder then it will work and save the files into that folder.

So 2 extra steps for direct windows running

  1. set HOME=c:\users\mwalker
  2. mkdir %HOME%.proxmark3 then run proxmark3.exe com4 All seems to work.

Since that will be lost on that cmd.exe session close, Windows users would need to create a batch file to re-map the HOME or add it to the windows setup. (step 3)

So to have it fail back to the client folder (if compiled for windows), would then allow either way to work.

Note: this is not a high priority for me, just noticed it and the history function is very useful :) But my work-around works for me.

Thanks

Gator96100 commented 5 years ago

This is currently also the case for my pre-compiled builds. It does happen on Windows 7 as well.

doegox commented 5 years ago

Please test latest commits, does it work?

mwalker33 commented 5 years ago

The fix for this issue looks to be fixed. I downloaded the latest, but did get a compile error (unrelated to this issue). make clean make all

[-] CC cmdlfparadox.c cmdlfparadox.c:114:12: error: 'CmdParadoxSim' defined but not used [-Werror=unused-function] static int CmdParadoxSim(const char *Cmd) { ^~~~~ cc1.exe: all warnings being treated as errors make[1]: [Makefile:426: obj/cmdlfparadox.o] Error 1 make: [Makefile:98: client/all] Error 2

[-] CC cmdlfparadox.c cmdlfparadox.c:26:12: error: 'usage_lf_paradox_sim' defined but not used [-Werror=unused-function] static int usage_lf_paradox_sim(void) { ^~~~~~~~ cc1.exe: all warnings being treated as errors make[1]: [Makefile:426: obj/cmdlfparadox.o] Error 1 make: [Makefile:98: client/all] Error 2

When I commented out the two functions it compiled ok.

for reference: [=] Using UART port com12 [=] Communicating with PM3 over USB-CDC

[ Proxmark3 RFID instrument ]

[ CLIENT ] client: RRG/Iceman compiled with MinGW-w64 8.2.0 OS:Windows (64b) ARCH:x86_64

[ PROXMARK RDV4 ] external flash: present smartcard reader: present

[ PROXMARK RDV4 Extras ] FPC USART for BT add-on support: absent

[ ARM ] bootrom: RRG/Iceman/master/b16f2fda-dirty-unclean 2019-07-24 08:25:08 os: RRG/Iceman/master/release (git) compiled with GCC 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]

[ FPGA ] LF image built for 2s30vq100 on 2019-07-31 at 15:57:16 HF image built for 2s30vq100 on 2018-09-03 at 21:40:23

[ Hardware ] --= uC: AT91SAM7S512 Rev A --= Embedded Processor: ARM7TDMI --= Nonvolatile Program Memory Size: 512K bytes, Used: 270264 bytes (52%) Free: 254024 bytes (48%) --= Second Nonvolatile Program Memory Size: None --= Internal SRAM Size: 64K bytes --= Architecture Identifier: AT91SAM7Sxx Series --= Nonvolatile Program Memory Type: Embedded Flash Memory

iceman1001 commented 5 years ago

yup, that other compilation error is fix too