mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-21 05:43:23 -07:00
Fix reveng
This commit is contained in:
parent
fe81b47811
commit
f46c366321
7 changed files with 68 additions and 39 deletions
|
@ -89,7 +89,7 @@ int reveng_main(int argc, char *argv[]) {
|
|||
model_t pset = model, *candmods, *mptr;
|
||||
char *string;
|
||||
|
||||
//myname = argv[0];
|
||||
myname = argv[0];
|
||||
|
||||
/* stdin must be binary */
|
||||
#ifdef _WIN32
|
||||
|
@ -97,7 +97,9 @@ int reveng_main(int argc, char *argv[]) {
|
|||
#endif /* _WIN32 */
|
||||
|
||||
SETBMP();
|
||||
|
||||
|
||||
pos=0;
|
||||
optind=1;
|
||||
do {
|
||||
c=getopt(argc, argv, "?A:BDFLMP:SVXa:bcdefhi:k:lm:p:q:rstuvw:x:yz");
|
||||
switch(c) {
|
||||
|
@ -487,7 +489,8 @@ void
|
|||
uerror(const char *msg) {
|
||||
/* Callback function to report fatal errors */
|
||||
fprintf(stderr, "%s: %s\n", myname, msg);
|
||||
exit(EXIT_FAILURE);
|
||||
return;
|
||||
//exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -545,7 +548,8 @@ oread(const char *name) {
|
|||
return(stdin);
|
||||
if(!(handle = fopen(name, "rb"))) {
|
||||
fprintf(stderr, "%s: cannot open '%s' for reading\n", myname, name);
|
||||
exit(EXIT_FAILURE);
|
||||
return 0;
|
||||
//exit(EXIT_FAILURE);
|
||||
}
|
||||
return(handle);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,10 @@
|
|||
* specific.
|
||||
*/
|
||||
|
||||
/* #define PRESETS 1 */
|
||||
#ifdef _WIN32
|
||||
#define PRESETS 1 //
|
||||
#endif
|
||||
|
||||
|
||||
/* Macros defining the size of a bmp_t.
|
||||
* Their values only matter if PRESETS and/or BMPMACRO are defined, in
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
char *optarg;
|
||||
int optind = 1, opterr, optopt;
|
||||
|
||||
int pos = 0;
|
||||
int getopt(int argc, char *argv[], const char *optstring)
|
||||
{
|
||||
static int pos = 0;
|
||||
//static int pos = 0;
|
||||
char *str;
|
||||
|
||||
if (pos == 0) {
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
*/
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt;
|
||||
extern int optind, opterr, optopt, pos;
|
||||
int getopt(int argc, char *argv[], const char *optstring);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue