Lilu Documentation

repository·master·Indexed 26 days ago

https://github.com/acidanthera/lilu

Lilu is an open-source macOS kernel extension providing a unified plugin API for patching kernel extensions (kexts), processes, and frameworks/libraries. The documentation covers installation of Lilu.kext, plugin development, and configuration via boot arguments for debugging, patching, and hardware emulation. Additionally, the repository includes Capstone disassembly engine integration, featuring build instructions for Xcode and bindings for Python, Java, OCaml, PowerShell, and VB6.

Tokens
4K
Snippets
11
Records
39
Agent score
87%

What's inside Lilu

  1. Use Capstone Disassembly Engine bindings in VB6

    master

    This project provides a shim (vbCapstone.dll) that allows Visual Basic 6 (VB6) to access the Capstone disassembly engine via a stdcall API.

    Key Capabilities

    • Supports basic disassembly for all processor architectures implemented by Capstone.
    • Provides full instruction details specifically for the x86 processor family within the VB code.

    Implementation Details

    • The vbCapstone.dll is written in C and acts as a bridge to the Capstone API.
    • The sample was originally built against Capstone 3.0 rc4. If the underlying Capstone structures change, the bindings may require adjustment.
    • The C project expects the <capstone.h> header to be located in ./../../include/ relative to the binding directory.
  2. Install Lilu and its plugins

    master

    Lilu is a kernel extension that provides a platform for patching kexts, libraries, and programs. To use it, you must install the Lilu.kext along with any plugin kexts that depend on it.

    • Prebuilt Binaries: Available on the releases page.
    • Plugin Development: To compile a plugin, copy the debug version of Lilu.kext into the plugin's directory.
  3. Build Capstone as a static or dynamic library using Xcode

    master

    The Capstone.xcodeproj project provides targets for building Capstone for macOS/iOS environments. The two primary targets for integration are:

    • CapstoneStatic: Produces libcapstone.a (a static library).
    • CapstoneDynamic: Produces libcapstone.dylib (a shared library).

    By default, the project is configured to use system implementations of malloc, calloc, realloc, free, and vsnprintf. To change this behavior, modify the Preprocessor Macros build setting at the specific target level (either CapstoneStatic or CapstoneDynamic) that you intend to use.

  4. Inhibit Capstone native core build during installation

    master

    By default, installing the Python bindings triggers a build of the Capstone native core. If you already have a globally installed copy of libcapstone and wish to prevent a new build, set the LIBCAPSTONE_PATH environment variable.

    Setting this variable to any value (including the path to a directory containing a specific version of libcapstone) will inhibit the build process.

  5. Install Capstone from source distribution

    master

    To install Capstone directly from the source distribution without using pip, run the setup script from the directory containing setup.py.

    Requirements:

    • An environment capable of compiling C code.
    • Windows users: You must install Visual Studio and use the "Developer Command Prompt" to perform the installation.
    python setup.py install
  6. Overview of Capstone Disassembly Framework

    master

    Capstone is a high-performance disassembly engine designed for binary analysis and reversing. It provides an architecture-neutral API and detailed instruction decomposition, including semantics like implicit register reads and writes.

    Key features include:

    • Multi-architecture support: ARM, ARM64 (ARMv8), Mips, PPC, Sparc, SystemZ, XCore, and X86 (including X86_64).
    • Platform support: Windows, Mac OSX, iOS, Android, Linux, *BSD, Solaris, etc.
    • Design: Thread-safe, implemented in pure C, and suitable for embedding into firmware or OS kernels.
    • Security focus: Capstone is capable of handling various X86 malware tricks, making it suitable for malware analysis.
  7. Explore Capstone Java API usage examples

    master

    The capstone/bindings/java directory contains reference implementations for using the Capstone API via Java:

    • Test.java: Demonstrates the basic API usage for extracting fundamental instruction information, including the address, mnemonic, and operand string.
    • Test_<arch>.java: Demonstrates how to retrieve architecture-specific information for various supported architectures.
  8. Install dependencies for Capstone Java bindings

    master

    To compile and run the Capstone Java test code, you must install OpenJDK and Java Native Access (JNA). On Ubuntu-based systems, use the following commands:

    1. Install OpenJDK (e.g., version 6): sudo apt-get install openjdk-6-jre-headless openjdk-6-jdk

    2. Install Java Native Access: sudo apt-get install libjna-java

    sudo apt-get install openjdk-6-jre-headless openjdk-6-jdk
    sudo apt-get install libjna-java