Giter VIP home page Giter VIP logo

Comments (7)

bharadwajy avatar bharadwajy commented on July 28, 2024 1

I think it is certainly possible to modify the tool to read raw binary along with any additional information - such as function boundaries specified in a pre-defined format.

You can consider adding

  1. a couple of inter-dependent new command-line options - say --raw-binary <binary-filename> and --function-map <funcmap-filename>
  2. an implementation - say DisassembleRawBits(char * BinaryFilename, char *FuncMapFilename) - that consumes the raw binary and function map file provided to create the MCInstRaiser::mcInstMap using MCInstRaiser::addMCInstOrData(uint64_t index, MCInstOrData mcInst). This can be called instead of DisassembleObject(File *, bool) in llvm-mctoll.cpp.

Once the instruction map of a function is constructed, the rest of the tool's existing infrastructure can be leveraged unchanged.

Hope that helps.

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on July 28, 2024

Raising object files is not supported. The tool is designed with an intent to raise only executables (which includes shared libraries).

from llvm-mctoll.

aaronsm avatar aaronsm commented on July 28, 2024

Instead of crashing, a possible improvement is for mctoll to check that the elf binary is executable and if not issue an appropriate message and exit. We probably also want a command line option to override this and force the raising.

from llvm-mctoll.

aaronsm avatar aaronsm commented on July 28, 2024

if (Elf.getEType() != ELF::ET_EXEC && Elf.getEType() != ELF::ET_DYN)
report_fatal_error("Only ELF executables and shared libraries are supported. Use -f to force raising anyway.");

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on July 28, 2024

Commit 8e5e96c adds code to gracefully exit an attempt raise relocatable ELF binaries (.o files).

The use case / need to raise .o files has to be clearly identified. If there is indeed a justifiable use case, support to raise .o files should be added. Once that support is added, there should be no need for user to force it using an additional flag.

from llvm-mctoll.

pabx06 avatar pabx06 commented on July 28, 2024

hi. i am trying to integrate llvm-mctoll as a plugin into ghidra
is there by any chance a way to mod it to accept some raw binary (ie: not an elf file) a ram dump of arm micro-controller.
i have the complete disassembly control flow instruction function boundary ie: where are function offsets and data offsets are. even data struct...

from llvm-mctoll.

pabx06 avatar pabx06 commented on July 28, 2024

I patched llvm-objcopy to support elf32-bigarm. Kinda strange objcopy don't handle it while backend do emit bigendian at least for powerpc...

Then used it to build an elf file with .text & .data .
set their flags and address hopefully ok.

However still trouble the McCool complains
15984130539575839882343057801348
This arch has not yet supported raising

I am wondering if the tool raiser has support for arm 32bit mode and 16bit thumb mode. Or it only support Aarch64...

I used a qemu emulator front-end to auto unpack the rom image to the ram and dump it.

from llvm-mctoll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.