Modern version of elf2vkp.
Find a file
2026-09-14 12:50:55 +03:00
.github/workflows chore: remove prerelease: true from ci.yml 2025-01-08 05:20:33 +03:00
cmake build files 2024-10-28 05:14:46 +03:00
debian fix: omit IHEX file names from patches 2026-08-26 22:58:08 +03:00
src fix: omit IHEX file names from patches 2026-08-26 22:58:08 +03:00
third_party first version 2024-10-28 05:00:20 +03:00
tools fix: enhance cmake config for all OS, remove OBS support 2025-01-08 00:57:11 +03:00
.gitignore feat: support different output formats 2025-01-08 00:09:57 +03:00
.gitmodules first version 2024-10-28 05:00:20 +03:00
CMakeLists.txt fix: small fixes 2025-01-08 02:27:54 +03:00
elf2vkp.rb fix: osx homebrew tap update in CI 2025-01-08 03:52:09 +03:00
LICENSE license 2024-10-28 05:00:36 +03:00
README.md Update README.md 2026-09-14 12:50:55 +03:00

ELF2VKP

This program:

  1. Converts each .elf or .ihex section into a V-Klay patch string.

  2. Add old patch data if a fullflash path is specified.

The main reason for the existence of this program is that the sources of the old elf2vkp.exe have been lost.

DOWNLOAD

  • Windows: download .exe in Releases.
  • ArchLinux: yay -S elf2vkp-git
  • OSX: brew install siemens-mobile-hacks/tap/elf2vkp
  • Ubuntu/Debian: download .deb in Releases.
  • Build from sources:
    git clone https://github.com/siemens-mobile-hacks/elf2vkp
    cd elf2vkp
    git submodule init
    git submodule update
    
    # Ubuntu/Debian
    fakeroot debian/rules binary
    
    # OSX, Linux, Unix, MinGW
    cmake -B build -DCMAKE_BUILD_TYPE=Release
    cmake --build build
    cmake --install build
    
    # Windows
    cmake -B build
    cmake --build build --config Release
    

USAGE

Usage: elf2vkp [--help] [--version] --input VAR --output VAR [--fullflash VAR] [--base VAR] [--header VAR]... [--header-from-file VAR] [--section-names] [--chunk-size VAR] [--format VAR] [--no-substract-base-addr] [--no-pragma] [--use-crlf]

Optional arguments:
  -h, --help                shows help message and exits
  -v, --version             prints version information and exits
  -i, --input               Path to patch.elf or patch.ihex [required]
  -o, --output              Path to patch.vkp [default: "-"]
  -f, --fullflash           Path to fullflash.bin [default: ""]
  -b, --base                Firmware base address or 'egold' [default: "A0000000"]
  -H, --header              Add patch header [default: {}] [may be repeated]
  --header-from-file        Add patch header (from file) [default: ""]
  --section-names           Show section names in .vkp
  --chunk-size              Maximum bytes per one line [default: 16]
  -F, --format              Patch output format: v-klay, armdebugger, sony-ericsson [default: "v-klay"]
  --no-substract-base-addr  Disable substracting base address from patch addr
  --no-pragma               Disable use of #pragma in the patch
  --use-crlf                Use windows \r\n instead of Unix \n

Output formats

Format Description
--format v-klay Default format.
--format armdebugger Shortcut for: --no-pragma
--format sony-ericsson Shortcut for: --no-substract-base-addr --no-pragma

Convert patch.elf to patch.vkp with old data

$ elf2vkp -i patch.elf -o patch.vkp -f EL71sw45.bin

Convert patch.elf to patch.vkp without old data

$ elf2vkp -i patch.elf -o patch.vkp

Convert patch.ihex to patch.vkp

$ elf2vkp -i patch.ihex -o patch.vkp -f fullflash.bin

Calculate the E-Gold firmware base from fullflash size

$ elf2vkp -i patch.ihex -o patch.vkp -f fullflash.bin --base egold

Convert patch.elf to patch.vkp (Sony Ericcson)

$ elf2vkp -F sony-ericsson -i patch.elf -o patch.vkp -f firmware.bin

AI-assisted contributions

We are not against AI. We are against vibe coding, AI slop, and attempts to offload engineering work to a model. This project prioritizes quality, not development speed or results at any cost.

  1. Do not use AI-generated text in human-to-human communication.

    Write comments, discussions, PR descriptions, and responses to reviewers yourself.

  2. Do not let AI submit PRs or commits.

    The author must always be a human who has personally reviewed the changes and takes responsibility for them.

  3. Do not submit code primarily designed or written by AI.

    Architecture, algorithms, code organization, and the final implementation must be decided by a human. AI may only be used as an auxiliary tool.

  4. You must understand all the code you submit.

    You must be able to explain every change, justify your decisions, and fix any problems yourself. If you do not understand the code, open a feature request instead of a PR.

  5. Code must be simple, clear, and tested.

    Follow KISS, the project's coding style, and its existing architecture. Do not introduce unnecessary abstractions, dependencies, or untested changes.

AI slop PRs will be closed without review.