/** *Printoutusageinformationaboutdexfuzz,andthenexit.
*/ publicstaticvoid usage() {
Log.always("DexFuzz Usage:");
Log.always(" --input=<file> : Seed DEX file to be fuzzed");
Log.always(" (Can specify multiple times.)");
Log.always(" --inputs=<file> : Directory containing DEX files to be fuzzed.");
Log.always(" --output=<file> : Output DEX file to be produced");
Log.always("");
Log.always(" --execute : Execute the resulting fuzzed program");
Log.always(" --host : Execute on host");
Log.always(" --device=<device> : Execute on an ADB-connected-device, where <device> is");
Log.always(" the argument given to adb -s. Default execution mode.");
Log.always(" --execute-dir=<dir> : Push tests to this directory to execute them.");
Log.always(" (Default: /data/art-test)");
Log.always(" --android-root=<dir> : Set path where dalvikvm should look for binaries.");
Log.always(" Use this when pushing binaries to a custom location.");
Log.always(" --no-boot-image : Use this flag when boot.art is not available.");
Log.always(" --skip-host-verify : When executing, skip host-verification stage");
Log.always(" --execute-class=<c> : When executing, execute this class (default: Main)");
Log.always("");
Log.always(" --interpreter : Include the Interpreter in comparisons");
Log.always(" --optimizing : Include the Optimizing Compiler in comparisons");
Log.always("");
Log.always(" --arm : Include ARM backends in comparisons");
Log.always(" --arm64 : Include ARM64 backends in comparisons");
Log.always(" --allarm : Short for --arm --arm64");
Log.always(" --x86 : Include x86 backends in comparisons");
Log.always(" --x86-64 : Include x86-64 backends in comparisons");
Log.always("");
Log.always(" --dump-output : Dump outputs of executed programs");
Log.always(" --dump-verify : Dump outputs of verification");
Log.always(" --repeat=<n> : Fuzz N programs, executing each one.");
Log.always(" --short-timeouts : Shorten timeouts (faster; use if");
Log.always(" you want to focus on output divergences)");
Log.always(" --divergence-retry=<n> : Number of retries when checking if test is");
Log.always(" self-divergent. (Default: 10)");
Log.always(" --seed=<seed> : RNG seed to use");
Log.always(" --method-mutations=<n> : Maximum number of mutations to perform on each method.");
Log.always(" (Default: 3)");
Log.always(" --min-methods=<n> : Minimum number of methods to mutate. (Default: 2)");
Log.always(" --max-methods=<n> : Maximum number of methods to mutate. (Default: 10)");
Log.always(" --one-mutation : Short for --method-mutations=1 ");
Log.always(" --min-methods=1 --max-methods=1");
Log.always(" --likelihoods=<file> : A file containing a table of mutation likelihoods");
Log.always(" --mutate-limit : Mutate only methods whose names end with _MUTATE");
Log.always(" --skip-mutation : Do not actually mutate the input, just output it");
Log.always(" after parsing");
Log.always("");
Log.always(" --dump-mutations[=<file>] : Dump an editable set of mutations applied");
Log.always(" to <file> (default: mutations.dump)");
Log.always(" --load-mutations[=<file>] : Load and apply a set of mutations");
Log.always(" from <file> (default: mutations.dump)");
Log.always(" --log=<tag> : Set more verbose logging level: DEBUG, INFO, WARN");
Log.always(" --report=<file> : Use <file> to report results when using --repeat");
Log.always(" (Default: report.log)");
Log.always(" --report-unique : Print out information about unique programs generated");
Log.always(" --unique-db=<file> : Use <file> store results about unique programs");
Log.always(" (Default: unique_progs.db)");
Log.always(" --bisection-search : Run bisection search for divergences");
Log.always(" --quiet : Disables progress log");
Log.always("");
System.exit(0);
}
// choose between a --X=Y option (keyvalue) and a --X option (flag) if (arg.contains("=")) {
String[] split = arg.split("=");
handleKeyValueOption(split[0], split[1]);
} else {
handleFlagOption(arg);
}
}
return validateOptions();
}
/** *Checksifthecurrentoptionssettingsarevalid,calledafterreading *alloptions. *@returnIftheoptionsarevalidornot.
*/ privatestaticboolean validateOptions() { // Deal with option assumptions. if (inputFileList.isEmpty()) {
File seedFile = new File("fuzzingseed.dex"); if (seedFile.exists()) {
Log.always("Assuming --input=fuzzingseed.dex");
inputFileList.add("fuzzingseed.dex");
} else {
Log.errorAndQuit("No input given, and couldn't find fuzzingseed.dex!"); returnfalse;
}
}
if (outputFile.equals("")) {
Log.always("Assuming --output=fuzzingseed_fuzzed.dex");
outputFile = "fuzzingseed_fuzzed.dex";
}
if (mutationLikelihoods.isEmpty()) {
File likelihoodsFile = new File("likelihoods.txt"); if (likelihoodsFile.exists()) {
Log.always("Assuming --likelihoods=likelihoods.txt ");
setupMutationLikelihoodTable("likelihoods.txt");
} else {
Log.always("Using default likelihoods (see README for values)");
}
}
// Now check for hard failures. if (repeat < 1) {
Log.error("--repeat must be at least 1!"); returnfalse;
} if (divergenceRetry < 0) {
Log.error("--divergence-retry cannot be negative!"); returnfalse;
} if (usingProvidedSeed && repeat > 1) {
Log.error("Cannot use --repeat with --seed"); returnfalse;
} if (loadMutations && dumpMutations) {
Log.error("Cannot both load and dump mutations"); returnfalse;
} if (repeat == 1 && inputFileList.size() > 1) {
Log.error("Must use --repeat if you have provided more than one input"); returnfalse;
} if (methodMutations < 0) {
Log.error("Cannot use --method-mutations with a negative value."); returnfalse;
} if (minMethods < 0) {
Log.error("Cannot use --min-methods with a negative value."); returnfalse;
} if (maxMethods < 0) {
Log.error("Cannot use --max-methods with a negative value."); returnfalse;
} if (maxMethods < minMethods) {
Log.error("Cannot use --max-methods that's smaller than --min-methods"); returnfalse;
} if (executeOnHost && usingSpecificDevice) {
Log.error("Cannot use --host and --device!"); returnfalse;
} if (execute) { // When host-execution mode is specified, we don't need to select an architecture. if (!executeOnHost) { if (!(useArchArm
|| useArchArm64
|| useArchX86
|| useArchX86_64)) {
Log.error("No architecture to execute on was specified!"); returnfalse;
}
} else { // TODO: Select the correct architecture. For now, just assume x86.
useArchX86 = true;
} if ((useArchArm || useArchArm64) && (useArchX86 || useArchX86_64)) {
Log.error("Did you mean to specify ARM and x86?"); returnfalse;
} int backends = 0; if (useInterpreter) {
backends++;
} if (useOptimizing) {
backends++;
} if (useArchArm && useArchArm64) { // Could just be comparing optimizing-ARM versus optimizing-ARM64?
backends++;
} if (backends < 2) {
Log.error("Not enough backends specified! Try --optimizing --interpreter!"); returnfalse;
}
}
returntrue;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.