diff --git a/hcxpcapngtool.c b/hcxpcapngtool.c index c7007dbf4..3de9bb918 100644 --- a/hcxpcapngtool.c +++ b/hcxpcapngtool.c @@ -5669,24 +5669,17 @@ printcontentinfo(); return; } /*===========================================================================*/ -static bool processgpxfile(char *gpxinname) +static bool processtrackfile(char *trackinname) { -static FILE *fh_gpxin; -static struct stat statinfo; -static int *gpxstart; +static FILE *fh_trackin; -if(stat(gpxinname, &statinfo) != 0) return false; -if(statinfo.st_size == 0) return false; -if((gpxstart = calloc(1, statinfo.st_size)) == NULL) return false; -if((fh_gpxin = fopen(gpxinname, "r")) == NULL) +if((fh_trackin = fopen(trackinname, "r")) == NULL) { - free(gpxstart); - return false; + } -free(gpxstart); -fclose(fh_gpxin); +fclose(fh_trackin); return true; } /*===========================================================================*/ @@ -6060,7 +6053,9 @@ fprintf(stdout, "%s %s (C) %s ZeroBeat\n" "--eapmd5-john= : output EAP MD5 CHALLENGE (john chap)\n" "--eapleap= : output EAP LEAP and MSCHAPV2 CHALLENGE (hashcat -m 5500, john netntlm)\n" "--tacacs-plus= : output TACACS PLUS v1 (hashcat -m 16100, john tacacs-plus)\n" -// "--gpxin= : input GPX file\n" +// "--track= : input TRACK file (No,Latitude,Longitude,Altitude,Date,Time)\n" +// " gpsbabel -t -i GPS_IN_FORMAT -f GPS_IN_FILE -o unicsv -F TRACK_FILE\n" +// " gpsbabel -t -i GPS_IN_FORMAT -f GPS_IN_FILE -x track,move=TIME_ADJUST_TO_SYSTEM_CLOCKTIME -o unicsv -F TRACK_FILE\n" "--nmea= : output GPS data in NMEA 0183 format\n" " format: NMEA 0183 $GPGGA, $GPRMC, $GPWPL\n" " to convert it to gpx, use GPSBabel:\n" @@ -6172,7 +6167,7 @@ static char *essidproberequestoutname; static char *deviceinfooutname; static char *identityoutname; static char *usernameoutname; -static char *gpxinname; +static char *trackinname; static char *nmeaoutname; static char *csvoutname; static char *logoutname; @@ -6220,7 +6215,7 @@ static const struct option long_options[] = {"nonce-error-corrections", required_argument, NULL, HCX_NC}, {"ignore-ie", no_argument, NULL, HCX_IE}, {"max-essids", required_argument, NULL, HCX_ESSIDS}, - {"gpxin", required_argument, NULL, HCX_GPX_IN}, + {"track-in", required_argument, NULL, HCX_TRACK_IN}, {"nmea", required_argument, NULL, HCX_NMEA_OUT}, {"csv", required_argument, NULL, HCX_CSV_OUT}, {"raw-out", required_argument, NULL, HCX_RAW_OUT}, @@ -6265,7 +6260,7 @@ essidproberequestoutname = NULL; identityoutname = NULL; usernameoutname = NULL; deviceinfooutname = NULL; -gpxinname = NULL; +trackinname = NULL; nmeaoutname = NULL; csvoutname = NULL; logoutname = NULL; @@ -6380,8 +6375,8 @@ while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) deviceinfooutname = optarg; break; - case HCX_GPX_IN: - gpxinname = optarg; + case HCX_TRACK_IN: + trackinname = optarg; break; case HCX_NMEA_OUT: @@ -6756,9 +6751,9 @@ if(hccapoutnamedeprecated != NULL) } } -if(gpxinname != NULL) +if(trackinname != NULL) { - if(processgpxfile(gpxinname) == false) exitcode = EXIT_FAILURE; + if(processtrackfile(trackinname) == false) exitcode = EXIT_FAILURE; } for(index = optind; index < argc; index++) diff --git a/include/hcxpcapngtool.h b/include/hcxpcapngtool.h index 200713954..b076a75bd 100644 --- a/include/hcxpcapngtool.h +++ b/include/hcxpcapngtool.h @@ -20,7 +20,7 @@ #define HCX_PMKIDEAPOLJTR_OUT_DEPRECATED 20 #define HCX_PREFIX_OUT 21 #define HCX_ADD_TIMESTAMP 22 -#define HCX_GPX_IN 23 +#define HCX_TRACK_IN 23 #define HCX_PMKIDEAPOL_OUT 'o' #define HCX_ESSID_OUT 'E' #define HCX_ESSIDPROBEREQUEST_OUT 'R'