Skip to content

Add EX530v v1.0 key, encode branch, and raise config size limit - #59

Open
guness wants to merge 1 commit into
sta-c0000:masterfrom
guness:add-ex530v-v1-key
Open

Add EX530v v1.0 key, encode branch, and raise config size limit#59
guness wants to merge 1 commit into
sta-c0000:masterfrom
guness:add-ex530v-v1-key

Conversation

@guness

@guness guness commented Jul 26, 2026

Copy link
Copy Markdown

Adds support for the TP-Link EX530v v1.0, an ISP-customized VDSL gateway (seen on Turkcell Superonline in Turkey). None of the six existing keys decrypt its conf.bin.

Tested against a real backup from an EX530v v1.0, firmware EX530v-v1.0_250415_2424.

Changes

1. New key ex530v-v1 = 40 BA C6 6C CA 5A 1C FE

Recovered by brute force rather than firmware extraction — TP-Link does not publish firmware for this ISP-locked model. The search was made tractable by the structure the existing ISP keys already share (byte6 == 0x1D, byte7 ∈ {FE,FD}, byte0 ∈ 0x40..0x47) plus the fact that DES ignores each key byte's LSB as a parity bit, which cuts the space 32×.

It is confirmed by the config's own MD5 self-check, and the decrypted XML contains <X_TP_DeviceModel val=EX530v(EU)/>. Note this is the parity-normalized form; TP-Link's original is presumably 40 BB C7 6D CA 5B 1D FE, which DES treats identically.

2. Encode branch for EX530v

Without it, xml -> bin silently falls through to the default key and produces a file the router will reject. Mirrors the existing XZ005-G6 branch, including forcing little-endian.

3. MAX_SIZE = 0x40000, replacing three hardcoded 0x20000 limits

This is the one change that affects other models, so flagging it explicitly. The EX530v's uncompressed XML is 138160 bytes (~135 KiB), over the old 0x20000 ceiling, so decoding failed twice: first in the input-size guard when re-encoding, then in check_size_endianness with "compressed size too large for a TP-Link config file!".

The limit also serves as the endianness heuristic, so raising it does weaken that slightly — it now only auto-flips when a byteswapped size exceeds 256 KiB rather than 128 KiB. In practice a wrong-endian read is off by orders of magnitude (this file reads as 2954560000 big-endian vs 138160 little-endian), so detection still works. Happy to bump it to a smaller value, or gate it per-model, if you'd prefer something more conservative.

Verification

$ ./tpconf_bin_xml.py -l conf.bin conf.xml
OK: appears your device uses little-endian.
OK: BIN file decrypted, MD5 hash verified, uncompressing…
Done.

Round-trip conf.bin -> conf.xml -> conf.bin' -> conf.xml' produces byte-identical XML. The re-encoded .bin is smaller than the original (21152 vs 21904 bytes) because this compressor packs tighter than the router's, which is expected and also true of the already-supported models.

Caveat: I have not restored a re-encoded file to the device, so the encode path is verified only by round-trip, not by the router accepting it.

Note for EX530v users

The device is little-endian, so decoding needs -l. README updated accordingly.

Adds the DES key for the TP-Link EX530v v1.0, an ISP-customized VDSL
gateway (seen on Turkcell Superonline, TR). None of the existing keys
decrypt its conf.bin.

Three changes were needed to make the model work end to end:

* 'ex530v-v1' key: 40 BA C6 6C CA 5A 1C FE
* An encode branch, so xml -> bin re-encrypts with the right key and
  forces little-endian, matching the existing XZ005-G6 branch.
* MAX_SIZE 0x40000, replacing the three hardcoded 0x20000 limits. The
  EX530v's uncompressed XML is 138160 bytes, so the old limit rejected
  it as "too large" in both the input-size guard and
  check_size_endianness.

The device is little-endian, so decoding needs -l.
@guness
guness force-pushed the add-ex530v-v1-key branch from 57b989b to 6af21ae Compare July 26, 2026 18:26
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.

1 participant