VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/DcsCfg/DcsCfgMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'DcsCfg/DcsCfgMain.c')
-rw-r--r--DcsCfg/DcsCfgMain.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/DcsCfg/DcsCfgMain.c b/DcsCfg/DcsCfgMain.c
index ec92b25..daf0fb0 100644
--- a/DcsCfg/DcsCfgMain.c
+++ b/DcsCfg/DcsCfgMain.c
@@ -75,6 +75,7 @@ https://opensource.org/licenses/LGPL-3.0
#define OPT_SECREGION_MARK L"-srm"
#define OPT_SECREGION_WIPE L"-srw"
#define OPT_SECREGION_ADD L"-sra"
+#define OPT_SECREGION_DUMP L"-srdump"
#define OPT_WIPE L"-wipe"
#define OPT_OS_DECRYPT L"-osdecrypt"
#define OPT_OS_RESTORE_KEY L"-osrestorekey"
@@ -88,8 +89,10 @@ https://opensource.org/licenses/LGPL-3.0
#define OPT_TBL_NAME L"-tbn"
#define OPT_TBL_DELETE L"-tbd"
#define OPT_TBL_APPEND L"-tba"
+#define OPT_TBL_DUMP L"-tbdump"
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { OPT_TBL_DUMP, TypeValue },
{ OPT_TBL_FILE, TypeValue },
{ OPT_TBL_ZERO, TypeFlag },
{ OPT_TBL_LIST, TypeFlag },
@@ -137,6 +140,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{ OPT_SECREGION_MARK, TypeValue },
{ OPT_SECREGION_WIPE, TypeValue },
{ OPT_SECREGION_ADD, TypeValue },
+ { OPT_SECREGION_DUMP, TypeValue },
{ OPT_WIPE, TypeDoubleValue },
{ OPT_OS_DECRYPT, TypeFlag },
{ OPT_OS_RESTORE_KEY, TypeFlag },
@@ -264,6 +268,13 @@ DcsCfgMain(
res = TablesNew(opt1, opt2);
}
+ if (ShellCommandLineGetFlag(Package, OPT_TBL_DUMP))
+ {
+ CONST CHAR16* opt = NULL;
+ opt = ShellCommandLineGetValue(Package, OPT_TBL_DUMP);
+ res = TablesDump((CHAR16*)opt);
+ }
+
if (ShellCommandLineGetFlag(Package, OPT_TBL_LIST)) {
if (gDcsTables == NULL) TablesLoad();
OUT_PRINT(L"Size = %d, Zones=%d\n", gDcsTablesSize, (gDcsTablesSize + 128 * 1024 - 1) / (128 * 1024));
@@ -692,6 +703,17 @@ DcsCfgMain(
}
}
+ if (ShellCommandLineGetFlag(Package, OPT_SECREGION_DUMP)) {
+ if (ShellCommandLineGetFlag(Package, OPT_DISK_START)) {
+ CONST CHAR16* opt = NULL;
+ opt = ShellCommandLineGetValue(Package, OPT_SECREGION_DUMP);
+ SecRigionDump(gBIOHandles[BioIndexStart], (CHAR16*)opt);
+ } else {
+ ERR_PRINT(L"Select disk");
+ return EFI_INVALID_PARAMETER;
+ }
+ }
+
// Encrypt, decrypt, change password
if (ShellCommandLineGetFlag(Package, OPT_DISK_CHECK)) {
DisksAuthCheck();