1 #include "llvm-c/Disassembler.h"
2 #include "llvm-c/Target.h"
3 #include "llvm/MC/SubtargetFeature.h"
4 #include "llvm/Support/CommandLine.h"
5 #include "llvm/Support/raw_ostream.h"
10 LLVMInitializeAllTargetInfos();
11 LLVMInitializeAllTargetMCs();
12 LLVMInitializeAllDisassemblers();
17 LLVMDisasmContextRef Ctx;
18 std::vector<uint8_t> DataCopy(Data, Data + Size);
24 Ctx = LLVMCreateDisasmCPUFeatures(
"i386",
"",
"",
nullptr, 0,
nullptr,
nullptr);
25 if (LLVMSetDisasmOptions(Ctx, LLVMDisassembler_Option_AsmPrinterVariant) == 0) {
35 if (LLVMDisasmInstruction(Ctx,
p+1, Size-1, 0, AssemblyText, 80) > 0) {
38 LLVMDisasmDispose(Ctx);
int LLVMFuzzerReturnOneInput(const uint8_t *Data, size_t Size, char *AssemblyText)
assert(limit<=UINT32_MAX/2)