Skip to content

Add MTK partition analysis tools and carrier unlock implementation#2

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/analyze-modify-hex-file
Draft

Add MTK partition analysis tools and carrier unlock implementation#2
Copilot wants to merge 7 commits intomainfrom
copilot/analyze-modify-hex-file

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 11, 2026

Implements comprehensive hexadecimal analysis and modification tools for MTK partition files, focusing on carrier/operator lock removal in persist-type partitions.

Tools Added

Tools/hex_analyzer.py

  • Magic number detection (MMMM/EEEE seccfg markers, Android boot headers)
  • String extraction with configurable minimum length
  • Entropy analysis and pattern detection
  • Binary file comparison with diff offset reporting
  • Report generation (stdout or file output)

Tools/persist_manager.py

  • ext4 filesystem mounting/unmounting via loop device
  • Automated carrier lock analysis in nvcfg/persist partitions
  • SIM lock removal by clearing /simlock/carrier file
  • Structure traversal and file enumeration

Carrier Lock Analysis

Located in two files:

  • Primary: nvcfg.bin:/simlock/carrier (92 bytes, ext4)
  • Secondary: proinfo.bin offset 0x218 (5 bytes + null, binary)

Original carrier file contains "amxmx" + 87 null bytes. Modified version uses 92 null bytes to indicate unlocked state.

Partition Analysis Results

All files from release v1 analyzed:

File Type Key Finding
seccfg.bin (8MB) V4 struct Lock state 0x01, hash at 0x1C
proinfo.bin (3MB) Binary Serial VEKRL52ZJD, carrier at 0x218
nvcfg.bin (32MB) ext4 Carrier lock in /simlock/carrier
persist.bin (48MB) ext4 Keybox, TEE logs, FTM data
nvdata.bin (64MB) ext4 331 NVRAM config files

Examples

# Analyze partition with hex dump and entropy
python Tools/hex_analyzer.py analyze nvcfg.bin

# Mount ext4 partition for inspection
python Tools/persist_manager.py mount nvcfg.bin /mnt/nvcfg

# Disable carrier lock (empty carrier file)
python Tools/persist_manager.py disable-simlock nvcfg.bin nvcfg_unlocked.bin

# Compare modified vs original
python Tools/hex_analyzer.py compare nvcfg.bin nvcfg_unlocked.bin

Documentation

  • examples/persist_analysis/ANALISIS_HEXADECIMAL.md - Exhaustive hex analysis of all partitions
  • examples/persist_analysis/ANALISIS_COMPLETO.md - Partition structures and modification procedures
  • Per-file analysis reports with magic numbers, strings, and entropy metrics

Security Considerations

Modified files use software-hashed data (nvcfg carrier field) which can be safely flashed. Hardware-encrypted files (seccfg hash) require device connection and proper tooling (mtk.py da seccfg unlock). Documentation includes warnings about keybox/attestation files that must never be modified.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/EduardoA3677/mtkclient/releases/tags/v1
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 11, 2026 19:52
Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Copilot AI changed the title [WIP] Analyze and modify hex for bootloader unlock Add hex analysis and partition modification tools for MTK devices Feb 11, 2026
Copilot AI requested a review from Eduardob3677 February 11, 2026 19:56
@Eduardob3677
Copy link
Copy Markdown
Owner

@copilot donde esta el seccfg modificado
subelo al repo

Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Feb 11, 2026

@copilot donde esta el seccfg modificado
subelo al repo

✅ Archivos seccfg subidos al repositorio en examples/seccfg_modification/:

  • seccfg_original.bin (8 MB) - Estado: LOCKED (0x01)
  • seccfg_unlocked.bin (8 MB) - Estado: UNLOCKED (0x03)
  • README.md - Documentación completa con advertencias

Cambios en commit 224b0c9:

  • Lock State: 0x01 → 0x03 (UNLOCKED)
  • Critical Lock: 0x00 → 0x01 (UNLOCKED)

⚠️ Importante: Estos archivos son para análisis únicamente. El hash NO está encriptado con claves de hardware. Para desbloqueo real usa: python mtk.py da seccfg unlock con el dispositivo conectado.

Copilot AI and others added 2 commits February 11, 2026 20:33
Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Co-authored-by: Eduardob3677 <212653915+Eduardob3677@users.noreply.github.com>
Copilot AI changed the title Add hex analysis and partition modification tools for MTK devices Add MTK partition analysis tools and carrier unlock implementation Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants