honggfuzz  2.2
About: honggfuzz is a security oriented, feedback-driven, evolutionary, easy-to-use fuzzer with powerful analysis options.
  Fossies Dox: honggfuzz-2.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cmdline.c File Reference
#include "cmdline.h"
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/queue.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "display.h"
#include "libhfcommon/common.h"
#include "libhfcommon/files.h"
#include "libhfcommon/log.h"
#include "libhfcommon/util.h"
Include dependency graph for cmdline.c:

Go to the source code of this file.

Data Structures

struct  custom_option
 

Functions

static bool checkFor_FILE_PLACEHOLDER (const char *const *args)
 
static bool cmdlineCheckBinaryType (honggfuzz_t *hfuzz)
 
static void cmdlineHelp (const char *pname, struct custom_option *opts)
 
static void cmdlineUsage (const char *pname, struct custom_option *opts)
 
bool cmdlineAddEnv (honggfuzz_t *hfuzz, char *env)
 
tristate_t cmdlineParseTriState (const char *optname, const char *optarg)
 
bool cmdlineParseTrueFalse (const char *optname, const char *optarg)
 
rlim_t cmdlineParseRLimit (int res, const char *optarg, unsigned long mul)
 
static bool cmdlineVerify (honggfuzz_t *hfuzz)
 
bool cmdlineParse (int argc, char *argv[], honggfuzz_t *hfuzz)
 

Function Documentation

◆ checkFor_FILE_PLACEHOLDER()

static bool checkFor_FILE_PLACEHOLDER ( const char *const *  args)
static

Definition at line 55 of file cmdline.c.

References _HF_FILE_PLACEHOLDER.

Referenced by cmdlineVerify().

◆ cmdlineAddEnv()

bool cmdlineAddEnv ( honggfuzz_t hfuzz,
char *  env 
)

◆ cmdlineCheckBinaryType()

static bool cmdlineCheckBinaryType ( honggfuzz_t hfuzz)
static

◆ cmdlineHelp()

static void cmdlineHelp ( const char *  pname,
struct custom_option opts 
)
static

Definition at line 91 of file cmdline.c.

References _HF_FILE_PLACEHOLDER, descr, LOG_HELP, LOG_HELP_BOLD, custom_option::opt, and PROG_NAME.

Referenced by cmdlineUsage().

◆ cmdlineParse()

bool cmdlineParse ( int  argc,
char *  argv[],
honggfuzz_t hfuzz 
)

Definition at line 290 of file cmdline.c.

References _HF_DYNFILE_BRANCH_COUNT, _HF_DYNFILE_BTS_EDGE, _HF_DYNFILE_INSTR_COUNT, _HF_DYNFILE_IPT_BLOCK, _HF_DYNFILE_NONE, _HF_DYNFILE_SOFT, _HF_FILE_PLACEHOLDER, _HF_REPORT_FILE, _HF_STATE_UNSET, honggfuzz_t::arch_linux, honggfuzz_t::arch_netbsd, honggfuzz_t::argc, ARRAYSIZE, honggfuzz_t::asLimit, honggfuzz_t::blacklistFile, honggfuzz_t::cfg, honggfuzz_t::clearEnv, honggfuzz_t::cloneFlags, honggfuzz_t::cmdline, cmdlineAddEnv(), cmdlineParseTriState(), cmdlineParseTrueFalse(), cmdlineUsage(), cmdlineVerify(), honggfuzz_t::cmpFeedback, honggfuzz_t::coreLimit, honggfuzz_t::covDirNew, honggfuzz_t::crashDir, honggfuzz_t::dataLimit, DEBUG, honggfuzz_t::del_report, honggfuzz_t::dictionaryFile, honggfuzz_t::disableRandomization, honggfuzz_t::display, display_createTargetStr(), honggfuzz_t::dynamicCutOffAddr, honggfuzz_t::dynFileMethod, honggfuzz_t::enable, honggfuzz_t::enabled, honggfuzz_t::exe, honggfuzz_t::exitUponCrash, honggfuzz_t::exportFeedback, honggfuzz_t::externalCommand, honggfuzz_t::feedback, honggfuzz_t::feedbackMutateCommand, honggfuzz_t::fileExtn, files_exists(), honggfuzz_t::fuzzStdin, HF_MAYBE, HF_YES, hfuzz, honggfuzz_t::ignoreAddr, INFO, honggfuzz_t::inputDir, honggfuzz_t::io, honggfuzz_t::kernelOnly, LOG_E, logInitLogFile(), honggfuzz_t::maxFileSz, honggfuzz_t::minimize, honggfuzz_t::mutate, honggfuzz_t::mutationsMax, honggfuzz_t::mutationsPerRun, honggfuzz_t::netDriver, honggfuzz_t::nullifyStdio, honggfuzz_t::only_printable, honggfuzz_t::outputDir, honggfuzz_t::persistent, honggfuzz_t::postExternalCommand, honggfuzz_t::reportFile, honggfuzz_t::rssLimit, honggfuzz_t::runEndTime, honggfuzz_t::sanitizer, honggfuzz_t::saveUnique, honggfuzz_t::skipFeedbackOnTimeout, honggfuzz_t::socketFuzzer, honggfuzz_t::stackLimit, honggfuzz_t::symsBlFile, honggfuzz_t::symsWlFile, honggfuzz_t::threads, honggfuzz_t::timing, honggfuzz_t::tmOut, honggfuzz_t::tmoutVTALRM, honggfuzz_t::useNetNs, honggfuzz_t::useScreen, honggfuzz_t::useVerifier, util_isANumber(), util_timeNowUSecs(), WARNING, and honggfuzz_t::workDir.

Referenced by main().

◆ cmdlineParseRLimit()

rlim_t cmdlineParseRLimit ( int  res,
const char *  optarg,
unsigned long  mul 
)

Definition at line 206 of file cmdline.c.

References LOG_F, PLOG_F, util_isANumber(), and val.

◆ cmdlineParseTriState()

tristate_t cmdlineParseTriState ( const char *  optname,
const char *  optarg 
)

Definition at line 162 of file cmdline.c.

References LOG_F.

Referenced by cmdlineParse().

◆ cmdlineParseTrueFalse()

bool cmdlineParseTrueFalse ( const char *  optname,
const char *  optarg 
)

Definition at line 186 of file cmdline.c.

References LOG_F.

Referenced by cmdlineParse().

◆ cmdlineUsage()

static void cmdlineUsage ( const char *  pname,
struct custom_option opts 
)
static

Definition at line 132 of file cmdline.c.

References cmdlineHelp().

Referenced by cmdlineParse().

◆ cmdlineVerify()