liblk
is a simple and tiny python library for manipulating LK (Little Kernel) images. It's flexible and has an easy-to-use API.
The library requires Python 3.8 or higher.
sudo apt install python3-pip # If you don't have pip installed.
pip3 install --upgrade git+https://github.com/R0rt1z2/liblk
The folder examples contains a set of examples that aim to show how to use the library and highlight its features.
from liblk import LkImage
# Load an LK image
lk_image = LkImage("path/to/lk.img")
# Get list of partitions
partitions = lk_image.get_partition_list()
for partition_name in partitions:
partition = lk_image.get_partition_by_name(partition_name)
print(f"Partition: {partition_name}, Size: {len(partition.data)} bytes")
# Apply a binary patch
lk_image.apply_patch("30b583b002ab", "00207047")
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.