Posts Tagged ‘crack lattice cpld embed firmware’
Crack Lattice CPLD Embedded Firmware: Three Endings, One With Data
Ask ten people what cracking a CPLD means and most will describe removing the protection so the contents can be read. That description contains a hidden assumption: that removing the protection leaves the contents in place. On most devices it does not. The mechanism that enforces the protection is usually the same mechanism that holds the configuration, and clearing one clears the other.
So “crack” has three possible endings. Recognising which one a particular device will produce, before starting, is the whole skill. Getting it wrong wastes a sample that cannot be replaced.
Ending one: erased
The common case. Clearing the security state requires an erase, and the erase clears the configuration. The device comes out blank, functional, and worthless for the purpose. This is not a partial success or a step toward success; it is a completed erasure.
| Observable | Meaning |
|---|---|
| Readback returns all ones | Erased array, or read still inhibited |
| Device ID responds normally | Device is alive and functional |
| Blank-device programming works | The device is in a normal erased state |
| Configuration reads as empty | Confirmed erased |
The third row is the confirmation. A device that can be programmed with a new design is definitely erased, and that also proves the programming interface is intact — which is useful information even though the design is gone.
Ending two: destroyed
The second ending is a dead device. This happens when the clearing procedure is electrical and the device does not tolerate it, or when the physical route removes something that cannot be put back. A decapsulated device with the array exposed is not a device; it is a sample that has yielded data and will yield nothing else.
| Cause | Detectable before | Recoverable |
|---|---|---|
| Overvoltage during unlock | No, usually | No |
| Passivation removal damage | No | No |
| Bond pad lifted during probing | No | No |
| Thermal damage during decapsulation | No | No |
This ending is acceptable when the data was obtained first, and catastrophic when it was not. The order of operations is therefore not a detail: acquire, then decide whether to attempt a non-destructive unlock at all.
Ending three: data retained
The useful ending, and the rarest. It occurs when the protection mechanism is logically separate from the configuration storage, so the protection can be cleared without touching the array.
| Mechanism | Separate from array | Data survives unlock |
|---|---|---|
| Security bit in a distinct configuration block | Yes | Sometimes |
| Read inhibit enforced by a control register | Yes | Sometimes, until power cycle |
| Protection fused into the array itself | No | Never |
| Protection enforced by the programming state machine | Yes | Only within a session |
The third row is by far the most common on EEPROM-based CPLDs, which is why the naive version of this work fails so often. The fourth row describes a subset of devices where the inhibit is active only during a programming session and the array is readable during normal operation through a different path — an architectural choice that effectively provides no protection at all, and one that vendors eventually corrected.
Why the distinction cannot be assumed
The three endings look identical from the outside before the attempt: the device is protected either way. The only way to know which will happen is to know the specific architecture, which means knowing the family, the revision, and often the specific configuration block layout.
| Question to answer first | Determines |
|---|---|
| Is the security bit in the array or a separate block? | Whether ending three is possible |
| Does clearing require an erase? | Whether ending one is forced |
| Is the array readable in normal operation? | Whether a session path exists |
| Is the device still in production? | Whether a replacement sample exists |
The last row is not technical and matters more than the others when the sample is irreplaceable. If there is exactly one device and it holds the only copy of a design, the risk profile of a destructive attempt changes completely.
The alternative that avoids the question
Given that the logical route usually ends in an erasure, the routes that routinely work are physical: optical readout of the array, or electrical probing of internal nodes. Both obtain data without asking the device for permission, and both are non-destructive to the array even when destructive to the package.
The reason this is the standard route rather than the fallback is arithmetic. A logical attempt that ends in an erasure costs the sample and yields nothing. A physical attempt costs the package and usually yields the array. When the sample is unique, the second is the only rational first choice.
What “success” should mean in a report
A report that says “protection removed” is not a report. The three endings are distinguishable and should be named, because a customer reading “protection removed successfully” will assume ending three and will be wrong two times out of three.
| Report statement | Informative | Misleading |
|---|---|---|
| Protection cleared, array erased as a consequence | Yes | No |
| Device non-functional after procedure | Yes | No |
| Array contents recovered before package removal | Yes | No |
| Protection removed successfully | No | Yes |
The vocabulary is not pedantry. It is the difference between a customer who understands what they received and one who discovers it three months later during a redesign.
Where this connects
The physical route that most often succeeds is described in extracting Lattice CPLD source code, and the read itself in reading Lattice CPLD embedded firmware. Whether a logical route has any chance at all depends on where the security state lives, which is the subject of attacking CPLD encrypted code.
Services at this boundary
Work covers architecture assessment to predict which ending a device will produce, physical readout as the primary route where the sample is unique, session attempts only where the architecture makes them non-destructive, and reporting that names the outcome rather than the procedure. It does not cover claiming a successful crack when the array was erased, and it does not cover devices where no route exists at all.
The single useful promise is this: the outcome will be known before the sample is put at risk, or the sample will not be put at risk.