Coder Social home page Coder Social logo

bitcode_retriever's Introduction

Bitcode Retriever

Retrieves Bitcode from Mach-O binaries

About

Bitcode stores as an xar archive inside of a Mach-O binary.

This tool extracts the archive and puts it near the binary, so it can be easily discovered using xar and llvm-dis

Build

Clone the repo and run make, built binary lays inside of build directory

$ git clone [email protected]:AlexDenisov/bitcode_retriever.git
$ cd bitcode_retriever
$ make

Usage

Note: currently is does not work with static libraries, there is an opened issue #1, if you need this feature please a comment there, it will bump prioity of this project at my personal todo-list.

To use bitcode_retriever simple feed him your binary and it'll produce archive with bitcode.

It accepts both fat and non-fat binaries. For fat binaries it produces separate archive for each slice, e.g.:

$ bitcode_retriever fat_app
i386.xar
x86_64.xar
arm64.xar

for non-fat binaries it produces just one archive with the bitcode:

$ bitcode_retriever non_fat_app
i386.xar

To skip the xar archive and obtain the bitcode immediately, pass the -e argument.

$ bitcode_retriever -e fat_app
i386.1.bc
i386.2.bc
x86_64.1.bc
x86_64.2.bc

The project provides a sample binaries, you can play a bit with them:

$ make subject
$ cd build
$ ./bitcode_retriever i386.o
# or
$ ./bitcode_retriever fat.o

The xar archive stores set of files with bitcode:

$ xar -xf i386.o
$ ls
i386.o 1 2

You can dump LLVM IR from each file (1, 2) using llvm-dis

$ llvm-dis 1
$ llvm-dis 2
$ ls
1 2 1.ll 2.ll

Bugs and issues

If you have any problems or found some bug - feel free to open an issue and/or send a pull request

bitcode_retriever's People

Contributors

alexdenisov avatar jdevlieghere avatar

Watchers

 avatar  avatar  avatar

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.