003 File Manager
Current Path:
/usr/src/contrib/llvm-project/compiler-rt/lib/fuzzer
usr
/
src
/
contrib
/
llvm-project
/
compiler-rt
/
lib
/
fuzzer
/
📁
..
📄
FuzzerBuiltins.h
(1.25 KB)
📄
FuzzerBuiltinsMsvc.h
(2.33 KB)
📄
FuzzerCommand.h
(5.95 KB)
📄
FuzzerCorpus.h
(16.93 KB)
📄
FuzzerCrossOver.cpp
(1.85 KB)
📄
FuzzerDataFlowTrace.cpp
(9.93 KB)
📄
FuzzerDataFlowTrace.h
(3.98 KB)
📄
FuzzerDefs.h
(1.99 KB)
📄
FuzzerDictionary.h
(3.32 KB)
📄
FuzzerDriver.cpp
(28.35 KB)
📄
FuzzerExtFunctions.def
(2.5 KB)
📄
FuzzerExtFunctions.h
(1.04 KB)
📄
FuzzerExtFunctionsDlsym.cpp
(1.63 KB)
📄
FuzzerExtFunctionsWeak.cpp
(1.9 KB)
📄
FuzzerExtFunctionsWindows.cpp
(2.79 KB)
📄
FuzzerExtraCounters.cpp
(1.55 KB)
📄
FuzzerFlags.def
(10.02 KB)
📄
FuzzerFork.cpp
(12.53 KB)
📄
FuzzerFork.h
(778 B)
📄
FuzzerIO.cpp
(4.47 KB)
📄
FuzzerIO.h
(3.31 KB)
📄
FuzzerIOPosix.cpp
(4.47 KB)
📄
FuzzerIOWindows.cpp
(11.59 KB)
📄
FuzzerInterface.h
(3.03 KB)
📄
FuzzerInternal.h
(5.33 KB)
📄
FuzzerLoop.cpp
(28.54 KB)
📄
FuzzerMain.cpp
(791 B)
📄
FuzzerMerge.cpp
(13.75 KB)
📄
FuzzerMerge.h
(3.31 KB)
📄
FuzzerMutate.cpp
(20.02 KB)
📄
FuzzerMutate.h
(6.57 KB)
📄
FuzzerOptions.h
(2.36 KB)
📄
FuzzerPlatform.h
(4.69 KB)
📄
FuzzerRandom.h
(1.21 KB)
📄
FuzzerSHA1.cpp
(5.56 KB)
📄
FuzzerSHA1.h
(978 B)
📄
FuzzerTracePC.cpp
(22.56 KB)
📄
FuzzerTracePC.h
(8.87 KB)
📄
FuzzerUtil.cpp
(6.75 KB)
📄
FuzzerUtil.h
(3.25 KB)
📄
FuzzerUtilDarwin.cpp
(5.87 KB)
📄
FuzzerUtilFuchsia.cpp
(20.16 KB)
📄
FuzzerUtilLinux.cpp
(1.12 KB)
📄
FuzzerUtilPosix.cpp
(5.07 KB)
📄
FuzzerUtilWindows.cpp
(5.93 KB)
📄
FuzzerValueBitMap.h
(2.24 KB)
📄
README.txt
(40 B)
Editing: FuzzerUtil.h
//===- FuzzerUtil.h - Internal header for the Fuzzer Utils ------*- C++ -* ===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // Util functions. //===----------------------------------------------------------------------===// #ifndef LLVM_FUZZER_UTIL_H #define LLVM_FUZZER_UTIL_H #include "FuzzerBuiltins.h" #include "FuzzerBuiltinsMsvc.h" #include "FuzzerCommand.h" #include "FuzzerDefs.h" namespace fuzzer { void PrintHexArray(const Unit &U, const char *PrintAfter = ""); void PrintHexArray(const uint8_t *Data, size_t Size, const char *PrintAfter = ""); void PrintASCII(const uint8_t *Data, size_t Size, const char *PrintAfter = ""); void PrintASCII(const Unit &U, const char *PrintAfter = ""); // Changes U to contain only ASCII (isprint+isspace) characters. // Returns true iff U has been changed. bool ToASCII(uint8_t *Data, size_t Size); bool IsASCII(const Unit &U); bool IsASCII(const uint8_t *Data, size_t Size); std::string Base64(const Unit &U); void PrintPC(const char *SymbolizedFMT, const char *FallbackFMT, uintptr_t PC); std::string DescribePC(const char *SymbolizedFMT, uintptr_t PC); void PrintStackTrace(); void PrintMemoryProfile(); unsigned NumberOfCpuCores(); // Platform specific functions. void SetSignalHandler(const FuzzingOptions& Options); void SleepSeconds(int Seconds); unsigned long GetPid(); size_t GetPeakRSSMb(); int ExecuteCommand(const Command &Cmd); bool ExecuteCommand(const Command &Cmd, std::string *CmdOutput); // Fuchsia does not have popen/pclose. FILE *OpenProcessPipe(const char *Command, const char *Mode); int CloseProcessPipe(FILE *F); const void *SearchMemory(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); std::string CloneArgsWithoutX(const Vector<std::string> &Args, const char *X1, const char *X2); inline std::string CloneArgsWithoutX(const Vector<std::string> &Args, const char *X) { return CloneArgsWithoutX(Args, X, X); } inline std::pair<std::string, std::string> SplitBefore(std::string X, std::string S) { auto Pos = S.find(X); if (Pos == std::string::npos) return std::make_pair(S, ""); return std::make_pair(S.substr(0, Pos), S.substr(Pos)); } void DiscardOutput(int Fd); std::string DisassembleCmd(const std::string &FileName); std::string SearchRegexCmd(const std::string &Regex); size_t SimpleFastHash(const uint8_t *Data, size_t Size); inline uint32_t Log(uint32_t X) { return 32 - Clz(X) - 1; } inline size_t PageSize() { return 4096; } inline uint8_t *RoundUpByPage(uint8_t *P) { uintptr_t X = reinterpret_cast<uintptr_t>(P); size_t Mask = PageSize() - 1; X = (X + Mask) & ~Mask; return reinterpret_cast<uint8_t *>(X); } inline uint8_t *RoundDownByPage(uint8_t *P) { uintptr_t X = reinterpret_cast<uintptr_t>(P); size_t Mask = PageSize() - 1; X = X & ~Mask; return reinterpret_cast<uint8_t *>(X); } } // namespace fuzzer #endif // LLVM_FUZZER_UTIL_H
Upload File
Create Folder