search for: createmcdisassembl

Displaying 13 results from an estimated 13 matches for "createmcdisassembl".

Did you mean: createmcdisassembler
2011 Dec 19
2
[LLVMdev] Disassembly arbitrary machine-code byte arrays
...C(); LLVMInitializeARMAsmParser(); LLVMInitializeARMDisassembler(); const llvm::Target Target; llvm::OwningPtr<const llvm::MCSubtargetInfo> STI(Target.createMCSubtargetInfo("", "", "")); llvm::OwningPtr<const llvm::MCDisassembler> disassembler(Target.createMCDisassembler(*STI)); llvm::OwningPtr<llvm::MemoryBuffer> Buffer; llvm::MemoryBuffer::getFile(llvm::StringRef("/path/to/file.bin"), Buffer); llvm::MCInst Inst; uint64_t Size = 0; disassembler->getInstruction(Inst, Size, *Buffer.take(), 0, llvm::nulls(), llvm::nulls()); // llvm::Stri...
2011 Dec 19
0
[LLVMdev] Disassembly arbitrary machine-code byte arrays
...C(); LLVMInitializeARMAsmParser(); LLVMInitializeARMDisassembler(); const llvm::Target Target; llvm::OwningPtr<const llvm::MCSubtargetInfo> STI(Target.createMCSubtargetInfo("", "", "")); llvm::OwningPtr<const llvm::MCDisassembler> disassembler(Target.createMCDisassembler(*STI)); llvm::OwningPtr<llvm::MemoryBuffer> Buffer; llvm::MemoryBuffer::getFile(llvm::StringRef("/path/to/file.bin"), Buffer); llvm::MCInst Inst; uint64_t Size = 0; disassembler->getInstruction(Inst, Size, *Buffer.take(), 0, llvm::nulls(), llvm::nulls()); // llvm::Stri...
2011 Dec 19
3
[LLVMdev] Disassembly arbitrary machine-code byte arrays
...> LLVMInitializeARMDisassembler(); > > const llvm::Target Target; > > llvm::OwningPtr<const llvm::MCSubtargetInfo> > STI(Target.createMCSubtargetInfo("", "", "")); > llvm::OwningPtr<const llvm::MCDisassembler> > disassembler(Target.createMCDisassembler(*STI)); > > llvm::OwningPtr<llvm::MemoryBuffer> Buffer; > llvm::MemoryBuffer::getFile(llvm::StringRef("/path/to/file.bin"), Buffer); > llvm::MCInst Inst; > uint64_t Size = 0; > > disassembler->getInstruction(Inst, Size, *Buffer.take(), 0, > llvm::nulls...
2018 Apr 03
0
Problems using LLVM as a disassembler.
...Example code below: TripleName = "x86_64-pc-linux-gnu"; // Get the target. std::string Error; DecodeAsmX86_64::TheTarget = llvm::TargetRegistry::lookupTarget(TripleName, Error); if (!TheTarget) return 1; ... // Set up disassembler. DisAsm = TheTarget->createMCDisassembler(*STI, *Ctx); if (!DisAsm) return 1; ... // S = DisAsm->getInstruction(*Inst, Size, Bytes_A, PC, // /*REMOVE*/ nulls(), nulls()); // Latest LLVM messes up with the PC set to anything other than zero S = DisAsm->getInstruction(*Inst, Size, Bytes_A, 0, /*REMOVE*/...
2011 Dec 20
0
[LLVMdev] Disassembly arbitrary machine-code byte arrays
...ssembler(); >> >> const llvm::Target Target; >> >> llvm::OwningPtr<const llvm::MCSubtargetInfo> >> STI(Target.createMCSubtargetInfo("", "", "")); >> llvm::OwningPtr<const llvm::MCDisassembler> >> disassembler(Target.createMCDisassembler(*STI)); >> >> llvm::OwningPtr<llvm::MemoryBuffer> Buffer; >> llvm::MemoryBuffer::getFile(llvm::StringRef("/path/to/file.bin"), Buffer); >> llvm::MCInst Inst; >> uint64_t Size = 0; >> >> disassembler->getInstruction(Inst, Size, *Buffer.t...
2014 Aug 06
4
[LLVMdev] Looking for ideas on how to make llvm-objdump handle both arm and thumb disassembly from the same object file
...disassembled it will see of the symbol has the N_ARM_THUMB_DEF bit set or not. And then switch disassemblers between the arm and thumb disassemblers. While this is a bit of a hack there are a limited set of Mach-O cpus otool(1) deals with. For llvm-objdump, it eventually just calls TheTarget->createMCDisassembler() and gets one disassembler for TheTarget it created. I talked to Jim a bit about sinking the logic of maintaining multiple disassemblers down into the core disassembler logic and using subtarget to select between them. Like the ARMAsmParser and I think the ARMInstPrinter work. But that seems...
2015 Sep 23
4
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). · If assembling createMCAsmParser · If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) § This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: · AddressSanitizer: Uses Triple::mips64...
2015 Sep 23
2
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). • If assembling createMCAsmParser • If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) • This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: • AddressSanitizer: Uses Triple::mips64...
2015 Sep 23
2
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). • If assembling createMCAsmParser • If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) • This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: • AddressSanitizer: Uses Triple::mips64...
2015 Sep 23
4
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). • If assembling createMCAsmParser • If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) • This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: • AddressSanitizer: Uses Triple::mips64...
2015 Sep 23
3
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). • If assembling createMCAsmParser • If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) • This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: • AddressSanitizer: Uses Triple::mips64...
2015 Sep 24
3
The Trouble with Triples
...has Triple::mips64/mips64el) and for mips-linux-gnu –mips64 (which should be ELF32 since it should target O32). • If assembling createMCAsmParser • If disassembling: o createMCRegInfo() (again) o createMCAsmInfo() (again) • This has the same issues as the first call. o createMCDisassembler() Clang does pretty much the same thing as this but additionally has to deal with using the correct default ABI for the given triple. I'll cover this kind of problem in 'CPU Defaults' below. Other places that get ABI information wrong: • AddressSanitizer: Uses Triple::mips64...
2015 Sep 22
2
The Trouble with Triples
>> Here's the line of thought that I'd like people to start with: >> * Triples don't describe the target. They look like they should, but they >> don't. They're really just arbitrary strings. > >Triples are used as a starting point, but no more. I disagree with this but for now let's assume it's true. The starting point is incorrect because