• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    C
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Retrieves Bitcode from Mach-O binaries

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

More Repositories

1

FrameAccessor

Easy access to view's frame.
Objective-C
446
star
2

iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
C
355
star
3

FontasticIcons

ObjC wrapper for the iconic fonts.
Objective-C
299
star
4

ToyClangPlugin

Playing with Clang plugin system
C++
153
star
5

Vibro

Feel the network interaction
Objective-C
105
star
6

segment_dumper

Simple example of a Mach-O parser
C
103
star
7

xcconf

YAML-based configuration for ObjC projects
Objective-C
79
star
8

Fuzzer

Do not crash when your server lies
Objective-C
69
star
9

ModernStickies

Reverse Engineering Stickies.app
C
55
star
10

PrettyPasteboard

Converts plain JSON to a human readable format directly in pasteboard
Swift
39
star
11

Components

Systems are built from Components, not from Dependencies.
Makefile
26
star
12

cv

TeX
25
star
13

swift_llvm

How to use LLVM C API with Swift
Swift
24
star
14

sgl

SGL - Swift Generic Library. Highly inspired by C++ STL.
Swift
19
star
15

ToySwiftModule

Shows how to create and use pure Swift module
Swift
16
star
16

mutation-testing-poc

LLVM-based Mutation Testing System. Proof of concept
Objective-C
15
star
17

grape_doc

Ruby
13
star
18

LLVMTemplate

LLVM + Swift template Xcode project
Swift
12
star
19

SwiftKaleidoscope

Kaleidoscope language implemented in Swift.
Swift
8
star
20

mlir-tutorial

Terribly incorrect and incomplete AOT compiler for mRuby. Source code for the LLVM Social Berlin #20
C++
8
star
21

QuotePad

QuotePad that can be deployed on your server.
Ruby
7
star
22

QiOS

Set of Qt wrappers for native iOS stuff.
Objective-C
6
star
23

mbx

Supplementary material for my talk
LLVM
5
star
24

Tsuga

Set of helpers for pivotal/cedar
Objective-C
5
star
25

guard-calabash-ios

Guard gem for calabash-ios
Ruby
5
star
26

bm_lint

Playing with libclang
C
4
star
27

alexdenisov.github.io

Blog
HTML
4
star
28

mutation-lab

Some experiments related to https://github.com/mull-project/mull
C++
4
star
29

tdd_calc

Cedar/Calabash example for iOS.
Objective-C
3
star
30

LeafBridge

Madness!!1
Objective-C++
3
star
31

guard-frank

Guard gem for frank-cucumber
Ruby
3
star
32

ios_generate_settings

Generate settings manager Objective-C class from command ine
Ruby
3
star
33

Hasm

Assembler for http://www.nand2tetris.org
Objective-C
3
star
34

BindableTypes

Binding CocoaTouch controls to Foundation data types
Objective-C
2
star
35

dot_files

Vim Script
2
star
36

Cedar-installer

Useless from Aug 2012!!! Bash installation script for Cedar: BDD-style testing using Objective-C.
Shell
2
star
37

linux

Linux Kernel fork
C
1
star
38

articles

C
1
star