diff --git a/doc/e9compile.1 b/doc/e9compile.1 index eea0555..ef18a3a 100644 --- a/doc/e9compile.1 +++ b/doc/e9compile.1 @@ -1,4 +1,4 @@ -.TH E9COMPILE "1" "June 2022" "E9Compile" "E9Compile" +.TH E9COMPILE "1" "April 2023" "E9Compile" "E9Compile" .SH NAME E9Compile \- E9Tool instrumentation compiler .SH SYNOPSIS diff --git a/doc/e9patch.1 b/doc/e9patch.1 index 01be621..ac4e905 100644 --- a/doc/e9patch.1 +++ b/doc/e9patch.1 @@ -1,4 +1,4 @@ -.TH E9PATCH "1" "June 2022" "E9Patch" "E9Patch" +.TH E9PATCH "1" "April 2023" "E9Patch" "E9Patch" .SH NAME E9Patch \- a powerful static binary rewriting tool .SH SYNOPSIS diff --git a/doc/e9tool.1 b/doc/e9tool.1 index f49e8f7..375c6fd 100644 --- a/doc/e9tool.1 +++ b/doc/e9tool.1 @@ -1,4 +1,4 @@ -.TH E9TOOL "1" "June 2022" "E9Tool" "E9Tool" +.TH E9TOOL "1" "April 2023" "E9Tool" "E9Tool" .SH NAME E9Tool \- a powerful static binary rewriting tool .SH SYNOPSIS @@ -105,6 +105,11 @@ For more information, please refer to the following document: .IP "\fB\-\-backend\fR PROG" 4 Use PROG as the backend. The default is "e9patch". +.IP "\fB\-CFR\fr, \fB\-X\fR" 4 +Enables binary rewriting "with" control-flow recovery. This +usually makes the rewritten binary much faster, but may +introduce rewriting bugs if the built-in recovery analysis is +inaccurate. .IP "\fB\-\-compression\fR N, \fB\-c\fR N" 4 Set the compression level to be N, where N is a number within the range 0..9. The default is 9 for maximum compression. @@ -215,11 +220,6 @@ optional second column is 1 for call targets (functions), or 0 otherwise (the default is 0). .IP "\fB\-\-version\fR" 4 Print the version and exit. -.IP "\fB\-X\fR" 4 -Enables binary rewriting "with" control-flow recovery. This -usually makes the rewritten binary much faster, but may -introduce rewriting bugs if the built-in recovery analysis is -inaccurate. .SH "SEE ALSO" \fIe9patch\fR(1), \fIe9compile\fR(1), \fIe9afl\fR(1), \fIredfat\fR(1) .SH AUTHOR diff --git a/src/e9tool/e9misc.cpp b/src/e9tool/e9misc.cpp index 471232f..9f08102 100644 --- a/src/e9tool/e9misc.cpp +++ b/src/e9tool/e9misc.cpp @@ -226,6 +226,12 @@ void usage(FILE *stream, const char *progname) "\t--backend PROG\n" "\t\tUse PROG as the backend. The default is \"e9patch\".\n" "\n" + "\t-CFR, -X\n" + "\t\tEnables binary rewriting \"with\" control-flow recovery. This\n" + "\t\tusually makes the rewritten binary much faster, but may\n" + "\t\tintroduce rewriting bugs if the built-in recovery analysis is\n" + "\t\tinaccurate.\n" + "\n" "\t--compression N, -c N\n" "\t\tSet the compression level to be N, where N is a number within\n" "\t\tthe range 0..9. The default is 9 for maximum compression.\n" @@ -344,12 +350,6 @@ void usage(FILE *stream, const char *progname) "\n" "\t--version\n" "\t\tPrint the version and exit.\n" - "\n" - "\t-X\n" - "\t\tEnables binary rewriting \"with\" control-flow recovery. This\n" - "\t\tusually makes the rewritten binary much faster, but may\n" - "\t\tintroduce rewriting bugs if the built-in recovery analysis is\n" - "\t\tinaccurate.\n" "\n", progname); } diff --git a/src/e9tool/e9tool.cpp b/src/e9tool/e9tool.cpp index b511744..f6e66a6 100644 --- a/src/e9tool/e9tool.cpp +++ b/src/e9tool/e9tool.cpp @@ -653,6 +653,7 @@ static void checkCompatible(const ELF &elf, const ELF &target) enum Option { OPTION_BACKEND, + OPTION_CFR, OPTION_COMPRESSION, OPTION_DSYNC, OPTION_DTHRESHOLD, @@ -729,6 +730,7 @@ int main_2(int argc, char **argv) static const struct option long_options[] = { {"backend", req_arg, nullptr, OPTION_BACKEND}, + {"CFR", no_arg, nullptr, OPTION_CFR}, {"compression", req_arg, nullptr, OPTION_COMPRESSION}, {"Dsync", req_arg, nullptr, OPTION_DSYNC}, {"Dthreshold", req_arg, nullptr, OPTION_DTHRESHOLD}, @@ -787,6 +789,10 @@ int main_2(int argc, char **argv) case OPTION_BACKEND: option_backend = optarg; break; + case OPTION_CFR: + case 'X': + option_CFR = true; + break; case OPTION_COMPRESSION: case 'c': option_compression_level = (unsigned)parseIntOptArg( @@ -938,9 +944,6 @@ int main_2(int argc, char **argv) case OPTION_VERSION: puts("E9Tool " STRING(VERSION)); return EXIT_SUCCESS; - case 'X': - option_CFR = true; - break; default: error("failed to parse command-line options; try `--help' " "for more information");