Add EX530v v1.0 key, encode branch, and raise config size limit - #59
Open
guness wants to merge 1 commit into
Open
Add EX530v v1.0 key, encode branch, and raise config size limit#59guness wants to merge 1 commit into
guness wants to merge 1 commit into
Conversation
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
force-pushed
the
add-ex530v-v1-key
branch
from
July 26, 2026 18:26
57b989b to
6af21ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 FERecovered 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 presumably40 BB C7 6D CA 5B 1D FE, which DES treats identically.2. Encode branch for
EX530vWithout it,
xml -> binsilently falls through to thedefaultkey and produces a file the router will reject. Mirrors the existing XZ005-G6 branch, including forcing little-endian.3.
MAX_SIZE = 0x40000, replacing three hardcoded0x20000limitsThis 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_endiannesswith "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
Round-trip
conf.bin -> conf.xml -> conf.bin' -> conf.xml'produces byte-identical XML. The re-encoded.binis 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.