Changeset 72940 in vbox for trunk/include/iprt
- Timestamp:
- Jul 7, 2018 1:37:19 PM (7 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/fuzz.h
r72649 r72940 222 222 223 223 /** 224 * Reseeds the PRNG of the given fuzzing context. 225 * 226 * @returns IPRT status code. 227 * @param hFuzzCtx The fuzzing context handle. 228 * @param uSeed The new seed. 229 */ 230 RTDECL(int) RTFuzzCtxReseed(RTFUZZCTX hFuzzCtx, uint64_t uSeed); 231 232 /** 224 233 * Generates a new input from the given fuzzing context and returns it. 225 234 * … … 230 239 RTDECL(int) RTFuzzCtxInputGenerate(RTFUZZCTX hFuzzCtx, PRTFUZZINPUT phFuzzInput); 231 240 241 /** 242 * Mutates a raw buffer. 243 * 244 * @returns IPRT status code. 245 * @param hFuzzCtx The fuzzing context handle. 246 * @param pvBuf Pointer to the buffer to mutate. 247 * @param cbBuf Size of the buffer iny bytes to mutate. 248 * @param phFuzzInput Where to store the handle to the fuzzed input on success. 249 */ 250 RTDECL(int) RTFuzzCtxMutateBuffer(RTFUZZCTX hFuzzCtx, void *pvBuf, size_t cbBuf, 251 PRTFUZZINPUT phFuzzInput); 232 252 233 253 … … 296 316 RTDECL(int) RTFuzzInputRemoveFromCtxCorpus(RTFUZZINPUT hFuzzInput); 297 317 318 319 /** 320 * Fuzzed binary input channel. 321 */ 322 typedef enum RTFUZZOBSINPUTCHAN 323 { 324 /** Invalid. */ 325 RTFUZZOBSINPUTCHAN_INVALID = 0, 326 /** File input. */ 327 RTFUZZOBSINPUTCHAN_FILE, 328 /** Input over stdin. */ 329 RTFUZZOBSINPUTCHAN_STDIN, 330 /** The binary is a fuzzing aware client using the 331 * specified protocol over stdin/stdout. */ 332 RTFUZZOBSINPUTCHAN_FUZZING_AWARE_CLIENT, 333 /** TCP server. */ 334 RTFUZZOBSINPUTCHAN_TCP_SERVER, 335 /** TCP client. */ 336 RTFUZZOBSINPUTCHAN_TCP_CLIENT, 337 /** UDP server. */ 338 RTFUZZOBSINPUTCHAN_UDP_SERVER, 339 /** UDP client. */ 340 RTFUZZOBSINPUTCHAN_UDP_CLIENT, 341 /** 32bit hack. */ 342 RTFUZZOBSINPUTCHAN_32BIT_HACK = 0x7fffffff 343 } RTFUZZOBSINPUTCHAN; 298 344 299 345 /** … … 359 405 RTDECL(int) RTFuzzObsSetTmpDirectory(RTFUZZOBS hFuzzObs, const char *pszTmp); 360 406 361 362 407 /** 363 408 * Sets the directory to store results to. … … 369 414 RTDECL(int) RTFuzzObsSetResultDirectory(RTFUZZOBS hFuzzObs, const char *pszResults); 370 415 371 372 416 /** 373 417 * Sets the binary to run for each fuzzed input. … … 376 420 * @param hFuzzObs The fuzzing observer handle. 377 421 * @param pszBinary The binary path. 378 * @param fFlags Flags controlling execution of the binary, RTFUZZ_OBS_BINARY_F_XXX. 379 */ 380 RTDECL(int) RTFuzzObsSetTestBinary(RTFUZZOBS hFuzzObs, const char *pszBinary, uint32_t fFlags); 381 382 /** @name RTFUZZ_OBS_BINARY_F_XXX 383 * @{ */ 384 /** The tested binary requires a real file to read from and doesn't support stdin. */ 385 #define RTFUZZ_OBS_BINARY_F_INPUT_FILE RT_BIT_32(0) 386 /** @} */ 422 * @param enmInputChan The input channel to use. 423 */ 424 RTDECL(int) RTFuzzObsSetTestBinary(RTFUZZOBS hFuzzObs, const char *pszBinary, RTFUZZOBSINPUTCHAN enmInputChan); 387 425 388 426 /** … … 426 464 RTR3DECL(RTEXITCODE) RTFuzzCmdMaster(unsigned cArgs, char **papszArgs); 427 465 466 467 /** 468 * Client input consumption callback. 469 * 470 * @returns IPRT status code. 471 * @retval VINF_SUCCESS the fuzzed code accepted the input. 472 * @retval VERR_* the client rejected the input while parsing it. 473 * @param pvBuf The buffer containing the input data. 474 * @param cbBuf Size of the buffer in bytes. 475 * @param pvUser Opaque user data. 476 */ 477 typedef DECLCALLBACK(int) FNFUZZCLIENTCONSUME(const void *pvBuf, size_t cbBuf, void *pvUser); 478 /** Pointer to a client consumption callback. */ 479 typedef FNFUZZCLIENTCONSUME *PFNFUZZCLIENTCONSUME; 480 481 /** 482 * A fuzzing client program for more efficient fuzzing. 483 * 484 * @returns Program exit code. 485 * 486 * @param cArgs The number of arguments. 487 * @param papszArgs The argument vector. (Note that this may be 488 * reordered, so the memory must be writable.) 489 * @param pfnConsume Input data consumption callback. 490 * @param pvUser Opaque user data to pass to the callback. 491 */ 492 RTR3DECL(RTEXITCODE) RTFuzzCmdFuzzingClient(unsigned cArgs, char **papszArgs, PFNFUZZCLIENTCONSUME pfnConsume, void *pvUser); 428 493 /** @} */ 429 494 -
trunk/include/iprt/mangling.h
r72778 r72940 1023 1023 # define RTFuzzCtxCreateFromStateFile RT_MANGLER(RTFuzzCtxCreateFromStateFile) 1024 1024 # define RTFuzzCtxInputGenerate RT_MANGLER(RTFuzzCtxInputGenerate) 1025 # define RTFuzzCtxMutateBuffer RT_MANGLER(RTFuzzCtxMutateBuffer) 1025 1026 # define RTFuzzCtxRelease RT_MANGLER(RTFuzzCtxRelease) 1027 # define RTFuzzCtxReseed RT_MANGLER(RTFuzzCtxReseed) 1026 1028 # define RTFuzzCtxRetain RT_MANGLER(RTFuzzCtxRetain) 1027 1029 # define RTFuzzCtxStateExport RT_MANGLER(RTFuzzCtxStateExport)
Note:
See TracChangeset
for help on using the changeset viewer.