wcc v0.0.4 releases: The Witchcraft Compiler Collection
The Witchcraft Compiler Collection
Purpose
WCC is a collection of compilation tools to perform binary black magic on the GNU/Linux and other POSIX platforms.
Install
Requirement
# Required for add-apt-repository
sudo apt-get install python-software-properties software-properties-common# Add repo for clang
sudo add-apt-repository ppa:kxstudio-team/builds
sudo apt-get update# Install dependencies
sudo apt-get install binutils-dev clang libelf-dev libgsl0-dev libiberty-dev libreadline6 libreadline6-dev make uthash-dev# Install latest capstone and capstone-dev from “Ubuntu 14.04 – DEB packages” http://www.capstone-engine.org/download.html
wget http://www.capstone-engine.org/download/3.0.4/ubuntu-14.04/libcapstone3_3.0.4-0.1ubuntu1_amd64.deb
sudo dpkg -i libcapstone3_3.0.4-0.1ubuntu1_amd64.deb
wget http://www.capstone-engine.org/download/3.0.4/ubuntu-14.04/libcapstone-dev_3.0.4-0.1ubuntu1_amd64.deb
sudo dpkg -i libcapstone-dev_3.0.4-0.1ubuntu1_amd64.deb
Install
git clone https://github.com/endrazine/wcc.git
cd wcc
git submodule init
git submodule update
make
sudo make install
make documentation
Usage
The following commands constitute the core of the Witchcraft Compiler Collection.
-
- wld: The Witchcraft Linker.
wld takes an ELF executable as an input and modifies it to create a shared library.
wld command line options
- wld: The Witchcraft Linker.
Limits of wld
wld currently only works on ELF binaries. However, wld can process ELF executables irrelevant of their architecture or operating system. wld could for instance process Intel, ARM or SPARC executables from Android, Linux, BSD or UNIX operating systems and transform them into “non-relocatable shared libraries”. Feel free to refer to the documentation under the /doc directory for more ample details.
- wcc: The Witchcraft Compiler.
The wcc compiler takes binaries (ELF, PE, …) as an input and creates valid ELF binaries as an output. It can be used to create relocatable object files from executables or shared libraries.
wcc command line options
Limits of wcc
wcc will process any file supported by libbfd and produce ELF files that will contain the same mapping when relinked and executed. This includes PE or OSX COFF files in 32 or 64 bits. However, rebuilding relocations is currently supported only for Intel ELF x86_64 binaries. Transforming a PE into an ELF and invoking pure functions is for instance supported. - wsh: The Witchcraft shellThe witchcraft shell accepts ELF shared libraries, ELF ET_DYN executables, and Witchcraft Shell Scripts written in Punk-C as an input. It loads all the executables in its own address space and makes their API available for programming in its embedded interpreter. This provides for binaries functionalities similar to those provided via reflection on languages like Java.
Limits of wsh
wsh can only load shared libraries and ET_DYN dynamically linked ELF executables directly. This means ET_EXEC executables may need to be libified using wld before use in wsh. Binaries in other file formats might need to be turned into ELF files using wcc.
wsh command line options
Demo
Copyright (c) 2016 Jonathan Brossard