aboutsummaryrefslogtreecommitdiffstats
path: root/tools/nv_data-sim-unlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/nv_data-sim-unlock.c')
-rw-r--r--tools/nv_data-sim-unlock.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/nv_data-sim-unlock.c b/tools/nv_data-sim-unlock.c
index 360789d..b6eae48 100644
--- a/tools/nv_data-sim-unlock.c
+++ b/tools/nv_data-sim-unlock.c
@@ -30,13 +30,16 @@
void usage(char *progname)
{
printf("Usage:\n");
- printf("\t%s FILE command <index> # %s\n",
+ printf("\t%s FILE command <index> # %s\n",
basename(progname),
"Get bruteforce command.");
- printf("\t%s list-supported # %s\n",
+ printf("\t%s FILE bruteforce <index> # %s\n",
+ basename(progname),
+ "Get bruteforce command.");
+ printf("\t%s list-supported # %s\n",
basename(progname),
"List supported devices/EFS.");
- printf("\t%s --help # %s\n",
+ printf("\t%s --help # %s\n",
basename(progname),
"Print this help.");
}
@@ -143,6 +146,11 @@ int cmd_command(char* nv_data_path, int field_nr)
return 0;
}
+int cmd_bruteforce()
+{
+ return 0;
+}
+
int main(int argc, char * const argv[])
{
if (argc == 4 && !strcmp(argv[2], "command")) {
@@ -161,6 +169,22 @@ int main(int argc, char * const argv[])
}
return cmd_command(argv[1], field_nr);
+ } else if (argc == 4 && !strcmp(argv[2], "bruteforce")) {
+ char *endptr;
+ int field_nr = 0;
+
+ field_nr = strtol(argv[3], &endptr, 10);
+ if (errno != 0) {
+ usage(argv[0]);
+ return EX_USAGE;
+ }
+
+ if (!(argv[3][0] != '\0' && *endptr == '\0')) {
+ usage(argv[0]);
+ return EX_USAGE;
+ }
+
+ return cmd_bruteforce(argv[1], field_nr);
} else if (argc == 2 && !strcmp(argv[1], "list-supported")) {
return cmd_list_supported();
} else if (argc == 2 && !strcmp(argv[1], "--help")) {