From b4587985f6f3d9089a27b965535caa4c27ac086d Mon Sep 17 00:00:00 2001 From: icex2 Date: Thu, 1 Apr 2021 23:36:03 +0200 Subject: [PATCH] Support redacted options by adding a "is_secret_data" flag for options Use this to flag options as "secrets" allowing the debug log output to not print them to the console/logs. --- dist/conf/f2hook.conf | 2 +- dist/conf/fexhook.conf | 2 +- dist/conf/fsthook.conf | 2 +- dist/conf/nx2hook.conf | 2 +- dist/conf/nxahook.conf | 2 +- src/main/hook/exc/options.c | 16 ++++++++++++++++ src/main/hook/f2/options.c | 19 ++++++++++++++++++- src/main/hook/fex/options.c | 19 ++++++++++++++++++- src/main/hook/fst/options.c | 19 ++++++++++++++++++- src/main/hook/mk3/options.c | 21 +++++++++++++++++++++ src/main/hook/nx/options.c | 16 ++++++++++++++++ src/main/hook/nx2/options.c | 21 ++++++++++++++++++++- src/main/hook/nxa/options.c | 19 ++++++++++++++++++- src/main/hook/pri/options.c | 16 ++++++++++++++++ src/main/hook/pro/options.c | 17 +++++++++++++++++ src/main/hook/pro2/options.c | 13 +++++++++++++ src/main/hook/x2/options.c | 16 ++++++++++++++++ src/main/hook/zero/options.c | 16 ++++++++++++++++ src/main/util/options.c | 6 +----- src/main/util/options.h | 1 + 20 files changed, 230 insertions(+), 15 deletions(-) diff --git a/dist/conf/f2hook.conf b/dist/conf/f2hook.conf index b3b0740..444b9a7 100644 --- a/dist/conf/f2hook.conf +++ b/dist/conf/f2hook.conf @@ -29,7 +29,7 @@ patch_hook_main_loop.x11_input_handler= patch.net_profile.server= # [int]: Machine id for pumpnet -patch.net_profile.machine_id=0 +patch.net_profile.machine_id=0000000000000000 # [str]: Path to library implementing the piuio api for piuio emulation patch.piuio.emu_lib= diff --git a/dist/conf/fexhook.conf b/dist/conf/fexhook.conf index b3b0740..444b9a7 100644 --- a/dist/conf/fexhook.conf +++ b/dist/conf/fexhook.conf @@ -29,7 +29,7 @@ patch_hook_main_loop.x11_input_handler= patch.net_profile.server= # [int]: Machine id for pumpnet -patch.net_profile.machine_id=0 +patch.net_profile.machine_id=0000000000000000 # [str]: Path to library implementing the piuio api for piuio emulation patch.piuio.emu_lib= diff --git a/dist/conf/fsthook.conf b/dist/conf/fsthook.conf index b3b0740..444b9a7 100644 --- a/dist/conf/fsthook.conf +++ b/dist/conf/fsthook.conf @@ -29,7 +29,7 @@ patch_hook_main_loop.x11_input_handler= patch.net_profile.server= # [int]: Machine id for pumpnet -patch.net_profile.machine_id=0 +patch.net_profile.machine_id=0000000000000000 # [str]: Path to library implementing the piuio api for piuio emulation patch.piuio.emu_lib= diff --git a/dist/conf/nx2hook.conf b/dist/conf/nx2hook.conf index 72584d9..7df30cd 100644 --- a/dist/conf/nx2hook.conf +++ b/dist/conf/nx2hook.conf @@ -29,7 +29,7 @@ patch_hook_main_loop.x11_input_handler= patch.net_profile.server= # [int]: Machine id for pumpnet -patch.net_profile.machine_id=0 +patch.net_profile.machine_id=0000000000000000 # [bool (0/1/)]: Enable verbose log output for pumpnet related things, e.g. logging network traffic patch.net_profile.verbose_log_output=0 diff --git a/dist/conf/nxahook.conf b/dist/conf/nxahook.conf index b3b0740..444b9a7 100644 --- a/dist/conf/nxahook.conf +++ b/dist/conf/nxahook.conf @@ -29,7 +29,7 @@ patch_hook_main_loop.x11_input_handler= patch.net_profile.server= # [int]: Machine id for pumpnet -patch.net_profile.machine_id=0 +patch.net_profile.machine_id=0000000000000000 # [str]: Path to library implementing the piuio api for piuio emulation patch.piuio.emu_lib= diff --git a/src/main/hook/exc/options.c b/src/main/hook/exc/options.c index fb3b32e..a59e936 100644 --- a/src/main/hook/exc/options.c +++ b/src/main/hook/exc/options.c @@ -29,6 +29,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -39,6 +40,7 @@ static const struct util_options_def exchook_options_def[] = { " running because the hook lib has to apply memory patches.", .param = 'v', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "20040408", }, { @@ -46,6 +48,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -53,6 +56,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -60,6 +64,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -67,6 +72,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -74,6 +80,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -81,6 +88,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -90,6 +98,7 @@ static const struct util_options_def exchook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -98,6 +107,7 @@ static const struct util_options_def exchook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -106,6 +116,7 @@ static const struct util_options_def exchook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -113,6 +124,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -120,6 +132,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -127,6 +140,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -134,6 +148,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -141,6 +156,7 @@ static const struct util_options_def exchook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/f2/options.c b/src/main/hook/f2/options.c index b786439..a1d80fa 100644 --- a/src/main/hook/f2/options.c +++ b/src/main/hook/f2/options.c @@ -31,6 +31,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -38,6 +39,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -45,6 +47,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -52,6 +55,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -59,6 +63,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -66,6 +71,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -73,6 +79,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -81,6 +88,7 @@ const struct util_options_def f2hook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -89,6 +97,7 @@ const struct util_options_def f2hook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -97,6 +106,7 @@ const struct util_options_def f2hook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -104,7 +114,8 @@ const struct util_options_def f2hook_options_def[] = { .description = "Machine id for pumpnet", .param = 'm', .type = UTIL_OPTIONS_TYPE_STR, - .default_value.str = "0", + .is_secret_data = true, + .default_value.str = "0000000000000000", }, { .name = F2HOOK_OPTIONS_STR_PATCH_PIUIO_EMU_LIB, @@ -112,6 +123,7 @@ const struct util_options_def f2hook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -119,6 +131,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -126,6 +139,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -133,6 +147,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -140,6 +155,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -147,6 +163,7 @@ const struct util_options_def f2hook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/fex/options.c b/src/main/hook/fex/options.c index c59a4bb..70c5554 100644 --- a/src/main/hook/fex/options.c +++ b/src/main/hook/fex/options.c @@ -31,6 +31,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -38,6 +39,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -45,6 +47,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -52,6 +55,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -59,6 +63,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -66,6 +71,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -73,6 +79,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -82,6 +89,7 @@ const struct util_options_def fexhook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -90,6 +98,7 @@ const struct util_options_def fexhook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -98,6 +107,7 @@ const struct util_options_def fexhook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -105,7 +115,8 @@ const struct util_options_def fexhook_options_def[] = { .description = "Machine id for pumpnet", .param = 'm', .type = UTIL_OPTIONS_TYPE_STR, - .default_value.str = "0", + .is_secret_data = true, + .default_value.str = "0000000000000000", }, { .name = FEXHOOK_OPTIONS_STR_PATCH_PIUIO_EMU_LIB, @@ -113,6 +124,7 @@ const struct util_options_def fexhook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -120,6 +132,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -127,6 +140,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -134,6 +148,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -141,6 +156,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -148,6 +164,7 @@ const struct util_options_def fexhook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/fst/options.c b/src/main/hook/fst/options.c index 0fd35c2..182c070 100644 --- a/src/main/hook/fst/options.c +++ b/src/main/hook/fst/options.c @@ -31,6 +31,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -38,6 +39,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -45,6 +47,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -52,6 +55,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -59,6 +63,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -66,6 +71,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -73,6 +79,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -82,6 +89,7 @@ const struct util_options_def fsthook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -90,6 +98,7 @@ const struct util_options_def fsthook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -98,6 +107,7 @@ const struct util_options_def fsthook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -105,7 +115,8 @@ const struct util_options_def fsthook_options_def[] = { .description = "Machine id for pumpnet", .param = 'm', .type = UTIL_OPTIONS_TYPE_STR, - .default_value.str = "0", + .is_secret_data = true, + .default_value.str = "0000000000000000", }, { .name = FSTHOOK_OPTIONS_STR_PATCH_PIUIO_EMU_LIB, @@ -113,6 +124,7 @@ const struct util_options_def fsthook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -120,6 +132,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -127,6 +140,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -134,6 +148,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -141,6 +156,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -148,6 +164,7 @@ const struct util_options_def fsthook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/mk3/options.c b/src/main/hook/mk3/options.c index 0ee3a24..62beffd 100644 --- a/src/main/hook/mk3/options.c +++ b/src/main/hook/mk3/options.c @@ -34,6 +34,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -41,6 +42,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Sync offset in ms", .param = 'y', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 115, }, { @@ -48,6 +50,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Sync multiplier", .param = 'v', .type = UTIL_OPTIONS_TYPE_DOUBLE, + .is_secret_data = false, .default_value.d = 4.16666666666666696272613990004, }, { @@ -55,6 +58,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Volume of music playback", .param = 'm', .type = UTIL_OPTIONS_TYPE_DOUBLE, + .is_secret_data = false, .default_value.d = 1.0, }, { @@ -62,6 +66,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Volume of sound effects playback", .param = 'c', .type = UTIL_OPTIONS_TYPE_DOUBLE, + .is_secret_data = false, .default_value.d = 1.0, }, { @@ -72,6 +77,7 @@ static const struct util_options_def mk3hook_options_def[] = { "the game throws errors about not finding files", .param = 'x', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -79,6 +85,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Force game into window mode", .param = 'w', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -86,6 +93,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -93,6 +101,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -100,6 +109,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -107,6 +117,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -114,6 +125,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -123,6 +135,7 @@ static const struct util_options_def mk3hook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -131,6 +144,7 @@ static const struct util_options_def mk3hook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -139,6 +153,7 @@ static const struct util_options_def mk3hook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -146,6 +161,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -153,6 +169,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -162,6 +179,7 @@ static const struct util_options_def mk3hook_options_def[] = { "the standard fmodex.so", .param = 'r', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -169,6 +187,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -176,6 +195,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -183,6 +203,7 @@ static const struct util_options_def mk3hook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/nx/options.c b/src/main/hook/nx/options.c index fe7457a..1d5fa5c 100644 --- a/src/main/hook/nx/options.c +++ b/src/main/hook/nx/options.c @@ -30,6 +30,7 @@ static const struct util_options_def nxhook_options_def[] = { "new PIUNX.INI settings file permanently", .param = 'z', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -37,6 +38,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -44,6 +46,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -51,6 +54,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -58,6 +62,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -65,6 +70,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -72,6 +78,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -79,6 +86,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -87,6 +95,7 @@ static const struct util_options_def nxhook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -95,6 +104,7 @@ static const struct util_options_def nxhook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -103,6 +113,7 @@ static const struct util_options_def nxhook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -110,6 +121,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -117,6 +129,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -124,6 +137,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -131,6 +145,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -138,6 +153,7 @@ static const struct util_options_def nxhook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/nx2/options.c b/src/main/hook/nx2/options.c index 1c0ad8f..b817c73 100644 --- a/src/main/hook/nx2/options.c +++ b/src/main/hook/nx2/options.c @@ -35,6 +35,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -42,6 +43,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -49,6 +51,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -56,6 +59,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -63,6 +67,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -70,6 +75,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -77,6 +83,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -86,6 +93,7 @@ const struct util_options_def nx2hook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -94,6 +102,7 @@ const struct util_options_def nx2hook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -102,6 +111,7 @@ const struct util_options_def nx2hook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -109,7 +119,8 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Machine id for pumpnet", .param = 'm', .type = UTIL_OPTIONS_TYPE_STR, - .default_value.str = "0102030405060708", + .is_secret_data = true, + .default_value.str = "0000000000000000", }, { .name = NX2HOOK_OPTIONS_STR_PATCH_NET_PROFILE_VERBOSE_LOG_OUTPUT, @@ -117,6 +128,7 @@ const struct util_options_def nx2hook_options_def[] = { "e.g. logging network traffic", .param = 'v', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -126,6 +138,7 @@ const struct util_options_def nx2hook_options_def[] = { "bundle to enable https communication", .param = 'c', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -134,6 +147,7 @@ const struct util_options_def nx2hook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -141,6 +155,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -148,6 +163,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -155,6 +171,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -162,6 +179,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -169,6 +187,7 @@ const struct util_options_def nx2hook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/nxa/options.c b/src/main/hook/nxa/options.c index 017e04b..8d2368d 100644 --- a/src/main/hook/nxa/options.c +++ b/src/main/hook/nxa/options.c @@ -31,6 +31,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -38,6 +39,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -45,6 +47,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -52,6 +55,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -59,6 +63,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -66,6 +71,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -73,6 +79,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -82,6 +89,7 @@ const struct util_options_def nxahook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -90,6 +98,7 @@ const struct util_options_def nxahook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -98,6 +107,7 @@ const struct util_options_def nxahook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -105,7 +115,8 @@ const struct util_options_def nxahook_options_def[] = { .description = "Machine id for pumpnet", .param = 'm', .type = UTIL_OPTIONS_TYPE_STR, - .default_value.str = 0, + .is_secret_data = true, + .default_value.str = "0000000000000000", }, { .name = NXAHOOK_OPTIONS_STR_PATCH_PIUIO_EMU_LIB, @@ -113,6 +124,7 @@ const struct util_options_def nxahook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -120,6 +132,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -127,6 +140,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -134,6 +148,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -141,6 +156,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -148,6 +164,7 @@ const struct util_options_def nxahook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/pri/options.c b/src/main/hook/pri/options.c index 4643531..a34eb06 100644 --- a/src/main/hook/pri/options.c +++ b/src/main/hook/pri/options.c @@ -29,6 +29,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -36,6 +37,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -43,6 +45,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -50,6 +53,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -57,6 +61,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -64,6 +69,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -71,6 +77,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -80,6 +87,7 @@ const struct util_options_def prihook_options_def[] = { "service (PRI) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -88,6 +96,7 @@ const struct util_options_def prihook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -96,6 +105,7 @@ const struct util_options_def prihook_options_def[] = { "Address and port of pumpnet server (e.g. 127.0.0.1:1234)", .param = 'n', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -104,6 +114,7 @@ const struct util_options_def prihook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -111,6 +122,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -118,6 +130,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -125,6 +138,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -132,6 +146,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -139,6 +154,7 @@ const struct util_options_def prihook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/pro/options.c b/src/main/hook/pro/options.c index 950e6c9..5aef29d 100644 --- a/src/main/hook/pro/options.c +++ b/src/main/hook/pro/options.c @@ -32,6 +32,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Path to game data (game) folder", .param = 'd', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./game", }, { @@ -39,6 +40,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Path to game settings (data) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -46,6 +48,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -53,6 +56,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -60,6 +64,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -67,6 +72,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -74,6 +80,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -82,6 +89,7 @@ static const struct util_options_def prohook_options_def[] = { "Path to library implementing the piubtn api for piubtn emulation", .param = 'b', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -90,6 +98,7 @@ static const struct util_options_def prohook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -97,6 +106,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -106,6 +116,7 @@ static const struct util_options_def prohook_options_def[] = { "drive is plugged in", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -115,6 +126,7 @@ static const struct util_options_def prohook_options_def[] = { "drive is plugged in", .param = 'k', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -124,6 +136,7 @@ static const struct util_options_def prohook_options_def[] = { "sdX,sdY e.g. sde,sdf", .param = 't', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -132,6 +145,7 @@ static const struct util_options_def prohook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -140,6 +154,7 @@ static const struct util_options_def prohook_options_def[] = { "x11-input-handler api to capture X11 keyboard inputs", .param = 'r', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -147,6 +162,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -154,6 +170,7 @@ static const struct util_options_def prohook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/pro2/options.c b/src/main/hook/pro2/options.c index 8d8e9a5..6e355c1 100644 --- a/src/main/hook/pro2/options.c +++ b/src/main/hook/pro2/options.c @@ -25,6 +25,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Path to game data (game) folder", .param = 'd', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./game", }, { @@ -32,6 +33,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -39,6 +41,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -46,6 +49,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -53,6 +57,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -60,6 +65,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -68,6 +74,7 @@ const struct util_options_def pro2hook_options_def[] = { "Path to library implementing the piubtn api for piubtn emulation", .param = 'b', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -76,6 +83,7 @@ const struct util_options_def pro2hook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -83,6 +91,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -91,6 +100,7 @@ const struct util_options_def pro2hook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -99,6 +109,7 @@ const struct util_options_def pro2hook_options_def[] = { "x11-input-handler api to capture X11 keyboard inputs", .param = 'r', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -106,6 +117,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -113,6 +125,7 @@ const struct util_options_def pro2hook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/x2/options.c b/src/main/hook/x2/options.c index 35d3276..0057c89 100644 --- a/src/main/hook/x2/options.c +++ b/src/main/hook/x2/options.c @@ -30,6 +30,7 @@ static const struct util_options_def x2hook_options_def[] = { "new PIUEXCEED.INI settings file permanently", .param = 'z', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -37,6 +38,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -44,6 +46,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -51,6 +54,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -58,6 +62,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -65,6 +70,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -72,6 +78,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -79,6 +86,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -87,6 +95,7 @@ static const struct util_options_def x2hook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -95,6 +104,7 @@ static const struct util_options_def x2hook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -103,6 +113,7 @@ static const struct util_options_def x2hook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -110,6 +121,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -117,6 +129,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -124,6 +137,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -131,6 +145,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -138,6 +153,7 @@ static const struct util_options_def x2hook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/hook/zero/options.c b/src/main/hook/zero/options.c index f86aa1c..17c0ba4 100644 --- a/src/main/hook/zero/options.c +++ b/src/main/hook/zero/options.c @@ -30,6 +30,7 @@ static const struct util_options_def zerohook_options_def[] = { "new PIUZERO.INI settings file permanently", .param = 'z', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -37,6 +38,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Path to game settings (SETTINGS) folder", .param = 's', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "./save", }, { @@ -44,6 +46,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080", .param = 'z', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = 0, }, { @@ -51,6 +54,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable file call monitoring", .param = 'f', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -58,6 +62,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable file system related call monitoring", .param = 'g', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -65,6 +70,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable IO syscall monitoring", .param = 'i', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -72,6 +78,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable any file/IO open call monitoring", .param = 'j', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -79,6 +86,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable libusb call monitoring", .param = 'u', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -88,6 +96,7 @@ static const struct util_options_def zerohook_options_def[] = { "service (F2) and clear (F3)", .param = 'k', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -96,6 +105,7 @@ static const struct util_options_def zerohook_options_def[] = { "api to capture X11 keyboard inputs", .param = 'q', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -104,6 +114,7 @@ static const struct util_options_def zerohook_options_def[] = { "Path to library implementing the piuio api for piuio emulation", .param = 'p', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = NULL, }, { @@ -111,6 +122,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Enable game exit on Test + Service", .param = 'e', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.b = false, }, { @@ -118,6 +130,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Select the sound device to open on snd_pcm_open", .param = 'a', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "dmix", }, { @@ -125,6 +138,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Halt on sigsegv to attach a debugger to the process", .param = 'd', .type = UTIL_OPTIONS_TYPE_BOOL, + .is_secret_data = false, .default_value.str = false, }, { @@ -132,6 +146,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Print the log output to the specified file", .param = 'o', .type = UTIL_OPTIONS_TYPE_STR, + .is_secret_data = false, .default_value.str = "pumptools.log", }, { @@ -139,6 +154,7 @@ static const struct util_options_def zerohook_options_def[] = { .description = "Set the log level (0-4)", .param = 'l', .type = UTIL_OPTIONS_TYPE_INT, + .is_secret_data = false, .default_value.i = LOG_LEVEL_DEBUG, }, }; diff --git a/src/main/util/options.c b/src/main/util/options.c index 626a5b8..c6ee6c7 100644 --- a/src/main/util/options.c +++ b/src/main/util/options.c @@ -550,8 +550,6 @@ static bool util_options_init_from_file( pos_line_dup = util_str_dup(pos_lines); pos_key_val = strtok_r(pos_line_dup, "=", &ctx_key_val); - log_debug("Line: %s", pos_lines); - if (pos_key_val != NULL) { key = pos_key_val; val = &pos_key_val[strlen(key) + 1]; @@ -563,8 +561,6 @@ static bool util_options_init_from_file( return false; } - log_debug("Key: %s, Value: %s", key, val); - /* search for key */ for (uint32_t j = 0; j < options->entries; j++) { @@ -652,7 +648,7 @@ static bool util_options_init_from_file( options->defs->defs[j].param, options->defs->defs[j].name, options->defs->defs[j].type, - val ? val : "NULL"); + val ? (options->defs->defs[j].is_secret_data ? "[REDACTED-SECRET]" : val) : "NULL"); options->values[j].avail = true; break; diff --git a/src/main/util/options.h b/src/main/util/options.h index 24c3aee..52ef0e4 100644 --- a/src/main/util/options.h +++ b/src/main/util/options.h @@ -25,6 +25,7 @@ struct util_options_def { const char *description; const char param; enum util_options_type type; + bool is_secret_data; union { int i; double d;