Skip to content

zyedidia/lfi-jni

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

First initialize the submodules:

git submodule update --init

Install LFI

Download the appropriate compiler from the LFI releases page: https://github.com/zyedidia/lfi/releases.

If you don't have the LFI tools installed separately, you'll want to put x86_64-lfi-clang/lfi-bin on your path. Otherwise, just put x86_64-lfi-clang/lfi-clang on your path.

The examples are currently set up to use the x86_64-lfi-clang compiler.

You'll also need to install liblfi if you don't have it already:

git clone https://github.com/zyedidia/lfi
cd lfi
meson setup build -Dliblfi-only=true
cd build
ninja
sudo meson install

Build LFI-bind

cd lfi-bind
go build

Build JDK

git clone https://github.com/zyedidia/jdk -b lfi-jdk-21 --depth 1
cd jdk
bash configure
cd build/linux-x86_64-server-release
make JOBS=$(nproc)

This should produce jdk/bin/java.

Try an example

cd hello
make run

In Hello.java you can change System.loadLibrary to use native_lfi or native_native to switch between LFI and native versions of the native library.

About

Examples for using JNI with LFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published