diff options
| author | Wiimm <wiimm@wiimm.de> | 2021-04-24 09:10:02 +0200 |
|---|---|---|
| committer | Wiimm <wiimm@wiimm.de> | 2021-04-24 09:10:02 +0200 |
| commit | f33ad95520f6c6bb8f192c8bcd1c17cf40ba6b6b (patch) | |
| tree | 60c229f3f17eb965fda2bfa19021559123af65b4 /project/src/ui | |
| parent | 4f14fc871ab525488d821e132f80da99841d5646 (diff) | |
SZS v2.25a
Diffstat (limited to 'project/src/ui')
| -rw-r--r-- | project/src/ui/tab-wstrt.inc | 52 | ||||
| -rw-r--r-- | project/src/ui/ui-wstrt.c | 263 | ||||
| -rw-r--r-- | project/src/ui/ui-wstrt.h | 21 | ||||
| -rw-r--r-- | project/src/ui/ui.def | 48 |
4 files changed, 297 insertions, 87 deletions
diff --git a/project/src/ui/tab-wstrt.inc b/project/src/ui/tab-wstrt.inc index 291c635..e6d0d22 100644 --- a/project/src/ui/tab-wstrt.inc +++ b/project/src/ui/tab-wstrt.inc @@ -111,6 +111,24 @@ " Select parts by --vaddr, --faddr and --sname." " Without selectors, the whole file is dumped." }, + { T_DEF_CMD, "PORT", "PORT", + "wstrt PORT param...", + "The command expects a list of keywords or hex numbers." + " Keywords are @PAL@ (default), @USA@, @JAP@, @KOR@, or any abbreviation of them." + " They select the region for the next numeric input values." + " The hex numbers are interpreted as addresses." + " If possible, they are ported to all other regions." + " The result is printed as colorized table." + "\n" + " This address porting is EXPERIMENTAL!" }, + + { T_DEF_CMD, "WHERE", "WHERE", + "wstrt WHERE address...", + "A list of addresses in hex format is expected as input." + " The segments in which the specified addresses" + " are located is calculated for each region." + " The result is output as a human and machine readable table." }, + { H_DEF_CMD, "HTTPS", "_HTTPS", "wstrt _HTTPS file...", "Collect data about https-requests and print a total summary" @@ -627,6 +645,13 @@ { T_OPT_C, "SECTIONS", "sections", 0, 0 /* copy of wszst */ }, + { T_OPT_CP, "ORDER", "order", + "pujk", + "The parameter is scanend for the first appearance of letters P (for PAL)," + " U (USA), J (JAPAN) and K (KOREA) to define the order of the output." + " Case is ignored. Missing letters are added automatically." + " The default is @'PUJK'@." }, + { T_SEP_OPT, 0,0,0,0 }, //----- separator ----- { T_OPT_CP, "VADDR", "vaddr|va", @@ -775,8 +800,7 @@ " The effective number of bytes per line is format dependent" " (multiple of format size)." }, - - // + // //---------- wstrt GROUP DEST ---------- { T_GRP_BEG, "DEST", 0,0,0 }, @@ -941,6 +965,10 @@ " If set, a second table with the image map is printed." " If set twice, a third table with delta values is printed too." }, + //---------- COMMAND wstrt CDUMP ---------- + + { T_CMD_BEG, "CDUMP", 0,0,0 }, + //---------- COMMAND wstrt HEXDUMP ---------- { T_CMD_BEG, "HEXDUMP", 0,0,0 }, @@ -951,9 +979,25 @@ { T_SEP_OPT, 0,0,0,0 }, { T_COPY_GRP, "HEXDUMP", 0,0,0 }, - //---------- COMMAND wstrt CDUMP ---------- + //---------- COMMAND wstrt PORT ---------- - { T_CMD_BEG, "CDUMP", 0,0,0 }, + { T_CMD_BEG, "PORT", 0,0,0 }, + { T_COPT, "ORDER", 0,0,0 }, + { T_COPT, "NO_HEADER", 0,0, + "Suppress the table header and footer and output exactly 1 line for" + " each specified address. This makes the output more machine-readable." }, + { T_COPT, "BRIEF", 0,0, + " Same as {--no-header}." }, + + //---------- COMMAND wstrt WHERE ---------- + + { T_CMD_BEG, "WHERE", 0,0,0 }, + { T_COPT, "ORDER", 0,0,0 }, + { T_COPT, "NO_HEADER", 0,0, + "Suppress the table header and footer and output exactly 1 line for" + " each specified address. This makes the output more machine-readable." }, + { T_COPT, "BRIEF", 0,0, + " Same as {--no-header}." }, //---------- COMMAND wstrt HTTPS ---------- diff --git a/project/src/ui/ui-wstrt.c b/project/src/ui/ui-wstrt.c index 8b83b7c..e317089 100644 --- a/project/src/ui/ui-wstrt.c +++ b/project/src/ui/ui-wstrt.c @@ -289,6 +289,14 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Print in machine readable sections and parameter lines." }, + { OPT_ORDER, false, false, false, false, false, 0, "order", + "pujk", + "The parameter is scanend for the first appearance of letters P (for" + " PAL), U (USA), J (JAPAN) and K (KOREA) to define the order of the" + " output. Case is ignored. Missing letters are added automatically." + " The default is 'PUJK'." + }, + { OPT_VADDR, false, false, false, false, true, 0, "vaddr", "RANGE", "Comma separated list of virtual addresses to select the hex-dump" @@ -459,7 +467,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " dependent (multiple of format size)." }, - {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 62 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 63 //----- global options ----- @@ -849,7 +857,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " directory." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 113 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 114 }; @@ -917,6 +925,32 @@ static const InfoOption_t option_cmd_DUMP_LONG = " If set twice, a third table with delta values is printed too." }; +static const InfoOption_t option_cmd_PORT_NO_HEADER = + { OPT_NO_HEADER, false, false, false, false, false, 'H', "no-header", + 0, + "Suppress the table header and footer and output exactly 1 line for" + " each specified address. This makes the output more machine-readable." + }; + +static const InfoOption_t option_cmd_PORT_BRIEF = + { OPT_BRIEF, false, false, false, false, false, 'B', "brief", + 0, + " Same as --no-header." + }; + +static const InfoOption_t option_cmd_WHERE_NO_HEADER = + { OPT_NO_HEADER, false, false, false, false, false, 'H', "no-header", + 0, + "Suppress the table header and footer and output exactly 1 line for" + " each specified address. This makes the output more machine-readable." + }; + +static const InfoOption_t option_cmd_WHERE_BRIEF = + { OPT_BRIEF, false, false, false, false, false, 'B', "brief", + 0, + " Same as --no-header." + }; + static const InfoOption_t option_cmd_HTTPS_LONG = { OPT_LONG, false, false, false, false, false, 'l', "long", 0, @@ -993,6 +1027,8 @@ static const KeywordTab_t CommandTab[] = { CMD_DUMP, "DUMP", 0, 0 }, { CMD_CDUMP, "_CDUMP", 0, 0 }, { CMD_HEXDUMP, "HEXDUMP", "XDUMP", 0 }, + { CMD_PORT, "PORT", 0, 0 }, + { CMD_WHERE, "WHERE", 0, 0 }, { CMD_HTTPS, "_HTTPS", 0, 0 }, { CMD_EXTRACT, "EXTRACT", "X", 0 }, { CMD_TRACKS, "TRACKS", 0, 0 }, @@ -1138,6 +1174,7 @@ static const struct option OptionLong[] = { "cs", 1, 0, GO_CREATE_SECT }, { "wpf", 1, 0, GO_WPF }, { "sections", 0, 0, GO_SECTIONS }, + { "order", 1, 0, GO_ORDER }, { "vaddr", 1, 0, GO_VADDR }, { "va", 1, 0, GO_VADDR }, { "faddr", 1, 0, GO_FADDR }, @@ -1287,38 +1324,39 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x0b8 */ OPT_CREATE_SECT, /* 0x0b9 */ OPT_WPF, /* 0x0ba */ OPT_SECTIONS, - /* 0x0bb */ OPT_VADDR, - /* 0x0bc */ OPT_FADDR, - /* 0x0bd */ OPT_SNAME, - /* 0x0be */ OPT_INT1, - /* 0x0bf */ OPT_INT2, - /* 0x0c0 */ OPT_INT3, - /* 0x0c1 */ OPT_INT4, - /* 0x0c2 */ OPT_INT5, - /* 0x0c3 */ OPT_INT6, - /* 0x0c4 */ OPT_INT7, - /* 0x0c5 */ OPT_INT8, - /* 0x0c6 */ OPT_FLOAT, - /* 0x0c7 */ OPT_DOUBLE, - /* 0x0c8 */ OPT_LE, - /* 0x0c9 */ OPT_BE, - /* 0x0ca */ OPT_ZEROS, - /* 0x0cb */ OPT_HEX, - /* 0x0cc */ OPT_DEC, - /* 0x0cd */ OPT_C_SYNTAX, - /* 0x0ce */ OPT_ADDR, - /* 0x0cf */ OPT_ALIGN, - /* 0x0d0 */ OPT_TRIGGER, - /* 0x0d1 */ OPT_NO_ADDR, - /* 0x0d2 */ OPT_NO_NUMBERS, - /* 0x0d3 */ OPT_NO_TEXT, - /* 0x0d4 */ OPT_FORMAT, - /* 0x0d5 */ OPT_NO_NULL, - /* 0x0d6 */ OPT_NARROW, - /* 0x0d7 */ OPT_SMALL, - /* 0x0d8 */ OPT_WIDE, - /* 0x0d9 */ OPT_BYTES, - /* 0x0da */ 0,0,0,0, 0,0, + /* 0x0bb */ OPT_ORDER, + /* 0x0bc */ OPT_VADDR, + /* 0x0bd */ OPT_FADDR, + /* 0x0be */ OPT_SNAME, + /* 0x0bf */ OPT_INT1, + /* 0x0c0 */ OPT_INT2, + /* 0x0c1 */ OPT_INT3, + /* 0x0c2 */ OPT_INT4, + /* 0x0c3 */ OPT_INT5, + /* 0x0c4 */ OPT_INT6, + /* 0x0c5 */ OPT_INT7, + /* 0x0c6 */ OPT_INT8, + /* 0x0c7 */ OPT_FLOAT, + /* 0x0c8 */ OPT_DOUBLE, + /* 0x0c9 */ OPT_LE, + /* 0x0ca */ OPT_BE, + /* 0x0cb */ OPT_ZEROS, + /* 0x0cc */ OPT_HEX, + /* 0x0cd */ OPT_DEC, + /* 0x0ce */ OPT_C_SYNTAX, + /* 0x0cf */ OPT_ADDR, + /* 0x0d0 */ OPT_ALIGN, + /* 0x0d1 */ OPT_TRIGGER, + /* 0x0d2 */ OPT_NO_ADDR, + /* 0x0d3 */ OPT_NO_NUMBERS, + /* 0x0d4 */ OPT_NO_TEXT, + /* 0x0d5 */ OPT_FORMAT, + /* 0x0d6 */ OPT_NO_NULL, + /* 0x0d7 */ OPT_NARROW, + /* 0x0d8 */ OPT_SMALL, + /* 0x0d9 */ OPT_WIDE, + /* 0x0da */ OPT_BYTES, + /* 0x0db */ 0,0,0,0, 0, /* 0x0e0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0f0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x100 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -1332,158 +1370,172 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[62] = // cmd #1 +static u8 option_allowed_cmd_VERSION[63] = // cmd #1 { 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_HELP[62] = // cmd #2 +static u8 option_allowed_cmd_HELP[63] = // cmd #2 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1 + 1,1,1 }; -static u8 option_allowed_cmd_CONFIG[62] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[63] = // cmd #3 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_ARGTEST[62] = // cmd #4 +static u8 option_allowed_cmd_ARGTEST[63] = // cmd #4 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1 + 1,1,1 }; -static u8 option_allowed_cmd_TEST[62] = // cmd #5 +static u8 option_allowed_cmd_TEST[63] = // cmd #5 { 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1 + 1,1,1 }; -static u8 option_allowed_cmd_COLORS[62] = // cmd #6 +static u8 option_allowed_cmd_COLORS[63] = // cmd #6 { 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_ERROR[62] = // cmd #7 +static u8 option_allowed_cmd_ERROR[63] = // cmd #7 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_FILETYPE[62] = // cmd #8 +static u8 option_allowed_cmd_FILETYPE[63] = // cmd #8 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_FILEATTRIB[62] = // cmd #9 +static u8 option_allowed_cmd_FILEATTRIB[63] = // cmd #9 { 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_RAWDUMP[62] = // cmd #10 +static u8 option_allowed_cmd_RAWDUMP[63] = // cmd #10 { 0,0,0,0,0, 0,1,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_DUMP[62] = // cmd #11 +static u8 option_allowed_cmd_DUMP[63] = // cmd #11 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_CDUMP[62] = // cmd #12 +static u8 option_allowed_cmd_CDUMP[63] = // cmd #12 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_HEXDUMP[62] = // cmd #13 +static u8 option_allowed_cmd_HEXDUMP[63] = // cmd #13 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, - 1,1 + 0,0,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, + 1,1,1 +}; + +static u8 option_allowed_cmd_PORT[63] = // cmd #14 +{ + 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0 +}; + +static u8 option_allowed_cmd_WHERE[63] = // cmd #15 +{ + 0,0,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, + 0,0,0 }; -static u8 option_allowed_cmd_HTTPS[62] = // cmd #14 +static u8 option_allowed_cmd_HTTPS[63] = // cmd #16 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_EXTRACT[62] = // cmd #15 +static u8 option_allowed_cmd_EXTRACT[63] = // cmd #17 { 0,0,0,0,0, 0,1,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_TRACKS[62] = // cmd #16 +static u8 option_allowed_cmd_TRACKS[63] = // cmd #18 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_ARENAS[62] = // cmd #17 +static u8 option_allowed_cmd_ARENAS[63] = // cmd #19 { 0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_FILES[62] = // cmd #18 +static u8 option_allowed_cmd_FILES[63] = // cmd #20 { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_FIND[62] = // cmd #19 +static u8 option_allowed_cmd_FIND[63] = // cmd #21 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_POINTS[62] = // cmd #20 +static u8 option_allowed_cmd_POINTS[63] = // cmd #22 { 0,1,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_ANALYZE[62] = // cmd #21 +static u8 option_allowed_cmd_ANALYZE[63] = // cmd #23 { 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; -static u8 option_allowed_cmd_PATCH[62] = // cmd #22 +static u8 option_allowed_cmd_PATCH[63] = // cmd #24 { 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, - 0,0 + 0,0,0 }; @@ -1677,6 +1729,24 @@ static const InfoOption_t * option_tab_cmd_HEXDUMP[] = 0 }; +static const InfoOption_t * option_tab_cmd_PORT[] = +{ + OptionInfo + OPT_ORDER, + &option_cmd_PORT_NO_HEADER, + &option_cmd_PORT_BRIEF, + + 0 +}; + +static const InfoOption_t * option_tab_cmd_WHERE[] = +{ + OptionInfo + OPT_ORDER, + &option_cmd_WHERE_NO_HEADER, + &option_cmd_WHERE_BRIEF, + + 0 +}; + static const InfoOption_t * option_tab_cmd_HTTPS[] = { &option_cmd_HTTPS_LONG, @@ -2096,6 +2166,41 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = option_allowed_cmd_HEXDUMP }, + { CMD_PORT, + false, + false, + false, + "PORT", + 0, + "wstrt PORT param...", + "The command expects a list of keywords or hex numbers. Keywords are" + " PAL (default), USA, JAP, KOR, or any abbreviation of them. They" + " select the region for the next numeric input values. The hex numbers" + " are interpreted as addresses. If possible, they are ported to all" + " other regions. The result is printed as colorized table.\n" + " This address porting is EXPERIMENTAL!", + 0, + 3, + option_tab_cmd_PORT, + option_allowed_cmd_PORT + }, + + { CMD_WHERE, + false, + false, + false, + "WHERE", + 0, + "wstrt WHERE address...", + "A list of addresses in hex format is expected as input. The segments" + " in which the specified addresses are located is calculated for each" + " region. The result is output as a human and machine readable table.", + 0, + 3, + option_tab_cmd_WHERE, + option_allowed_cmd_WHERE + }, + { CMD_HTTPS, true, false, diff --git a/project/src/ui/ui-wstrt.h b/project/src/ui/ui-wstrt.h index 9c23bd8..4662318 100644 --- a/project/src/ui/ui-wstrt.h +++ b/project/src/ui/ui-wstrt.h @@ -86,6 +86,7 @@ typedef enum enumOptions OPT_CREATE_SECT, OPT_WPF, OPT_SECTIONS, + OPT_ORDER, OPT_VADDR, OPT_FADDR, OPT_SNAME, @@ -118,7 +119,7 @@ typedef enum enumOptions OPT_WIDE, OPT_BYTES, - OPT__N_SPECIFIC, // == 62 + OPT__N_SPECIFIC, // == 63 //----- global options ----- @@ -174,7 +175,7 @@ typedef enum enumOptions OPT_CLEAN_DOL, OPT_CT_DIR, - OPT__N_TOTAL // == 113 + OPT__N_TOTAL // == 114 } enumOptions; @@ -219,6 +220,7 @@ typedef enum enumOptions // OB_CREATE_SECT = 1llu << OPT_CREATE_SECT, // OB_WPF = 1llu << OPT_WPF, // OB_SECTIONS = 1llu << OPT_SECTIONS, +// OB_ORDER = 1llu << OPT_ORDER, // OB_VADDR = 1llu << OPT_VADDR, // OB_FADDR = 1llu << OPT_FADDR, // OB_SNAME = 1llu << OPT_SNAME, @@ -323,12 +325,20 @@ typedef enum enumOptions // // OB_CMD_DUMP = OB_LONG, // +// OB_CMD_CDUMP = 0, +// // OB_CMD_HEXDUMP = OB_VADDR // | OB_FADDR // | OB_SNAME // | OB_GRP_HEXDUMP, // -// OB_CMD_CDUMP = 0, +// OB_CMD_PORT = OB_ORDER +// | OB_NO_HEADER +// | OB_BRIEF, +// +// OB_CMD_WHERE = OB_ORDER +// | OB_NO_HEADER +// | OB_BRIEF, // // OB_CMD_HTTPS = OB_LONG, // @@ -400,6 +410,8 @@ typedef enum enumCommands CMD_DUMP, CMD_CDUMP, CMD_HEXDUMP, + CMD_PORT, + CMD_WHERE, CMD_HTTPS, CMD_EXTRACT, @@ -412,7 +424,7 @@ typedef enum enumCommands CMD_ANALYZE, CMD_PATCH, - CMD__N // == 23 + CMD__N // == 25 } enumCommands; @@ -509,6 +521,7 @@ typedef enum enumGetOpt GO_CREATE_SECT, GO_WPF, GO_SECTIONS, + GO_ORDER, GO_VADDR, GO_FADDR, GO_SNAME, diff --git a/project/src/ui/ui.def b/project/src/ui/ui.def index 0c8671f..0570f46 100644 --- a/project/src/ui/ui.def +++ b/project/src/ui/ui.def @@ -22332,6 +22332,21 @@ " Select parts by --vaddr, --faddr and --sname. Without selectors, the" \ " whole file is dumped." ) +#:def_cmd( "PORT", "PORT", \ + "wstrt PORT param...", \ + "The command expects a list of keywords or hex numbers. Keywords are" \ + " @PAL@ (default), @USA@, @JAP@, @KOR@, or any abbreviation of them." \ + " They select the region for the next numeric input values. The hex" \ + " numbers are interpreted as addresses. If possible, they are ported" \ + " to all other regions. The result is printed as colorized table.\n" \ + " This address porting is EXPERIMENTAL!" ) + +#:def_cmd( "WHERE", "WHERE", \ + "wstrt WHERE address...", \ + "A list of addresses in hex format is expected as input. The segments" \ + " in which the specified addresses are located is calculated for each" \ + " region. The result is output as a human and machine readable table." ) + #:def_cmd( "EXTRACT", "EXTRACT|X", \ "wstrt EXTRACT dol...", \ "Extract the sections of a DOL file into a directory. StaticR.rel" \ @@ -22789,6 +22804,13 @@ "", \ "Print in machine readable sections and parameter lines." ) +#:def_opt( "ORDER", "order", "CP", \ + "pujk", \ + "The parameter is scanend for the first appearance of letters P (for" \ + " PAL), U (USA), J (JAPAN) and K (KOREA) to define the order of the" \ + " output. Case is ignored. Missing letters are added automatically." \ + " The default is @'PUJK'@." ) + #:def_opt( "VADDR", "vaddr|va", "CP", \ "RANGE", \ "Comma separated list of virtual addresses to select the hex-dump" \ @@ -23146,6 +23168,32 @@ "", \ "" ) +#:def_cmd_opt( "PORT", "ORDER", \ + "", \ + "" ) + +#:def_cmd_opt( "PORT", "NO_HEADER", \ + "", \ + "Suppress the table header and footer and output exactly 1 line for" \ + " each specified address. This makes the output more machine-readable." ) + +#:def_cmd_opt( "PORT", "BRIEF", \ + "", \ + " Same as {--no-header}." ) + +#:def_cmd_opt( "WHERE", "ORDER", \ + "", \ + "" ) + +#:def_cmd_opt( "WHERE", "NO_HEADER", \ + "", \ + "Suppress the table header and footer and output exactly 1 line for" \ + " each specified address. This makes the output more machine-readable." ) + +#:def_cmd_opt( "WHERE", "BRIEF", \ + "", \ + " Same as {--no-header}." ) + #:def_cmd_opt( "HTTPS", "LONG", \ "", \ " Print output a C source" ) |
