PostHeaderIcon Restore IC Program: Deciding What State the Part Is In First

Most requests to restore IC program from a locked microcontroller arrive as a symptom, not a specification. The customer knows the device once ran its own firmware and now refuses to cooperate, but not whether the code is still readable, merely locked against writing, hidden behind an erase-on-unlock trigger, or stored in an external memory device instead of the MCU. That missing fact decides which technique applies, what the job costs, and whether the only physical sample survives.

Classify Before You Choose a Technique

The first task is observation, not attack. A part that answers a read over JTAG, SWD or USB differs from one whose array refuses every electrical access. Attach a debugger, attempt a read, and note whether the answer is data, an error, or silence. See established chip-breaking methods and categories of microcontroller protection.

The four observable states, and the cheapest route out of each:

Observed state What the part still exposes Route Does the data survive
A normal interface answers and returns code The full array over JTAG, SWD, serial or USB Straight dump and verify Yes, entirely
Code reads but a lock, fuse or option byte blocks writing The full array, read-only Read first, then a controller command to release the write lock Yes, if the read happens before anything is changed
The array refuses to read and lowering protection would trigger an erase Nothing electrical; the die itself Decapsulation and die-level imaging of the array Yes, if the sample is not touched electrically
The program was never in the microcontroller Nothing on the MCU; the external memory device holds it Desolder the external EEPROM or flash and read the device Yes, but only the memory device is read

Only the third state demands physical work, and the fourth removes the MCU from the problem. State one is rarely technical: the route is a plain dump and the risk is administrative, since the code was always readable and nobody wrote it down.

State Two: Readable but Write-Blocked

Here the array reads normally, yet a configuration word, lock bit or option byte blocks writes. The route is a controller command, but the order is fixed: dump first, then release the lock. Readout protection bypass planning must account for the flash security bit one-way door: on many families that bit can be set in software yet cleared only by a command which also erases the array, so unlocking is a destructive act, not a convenience.

State Three: Protection That Erases on Downgrade

On several families the protection ladder runs the wrong way: dropping readout protection from a higher level to a lower one triggers an automatic full erase of the program area. The array then refuses to read electrically, so the non-destructive route is die-level work. Decapsulation removes the mould compound and exposes the die, where microprobing or imaging reads the cells. Nothing electrical touches the part, so the image survives. See readout protection on STM32F038K6 for erase-on-downgrade behaviour.

Para chips altamente protegidos, o desencapsulamento envolve a abertura física do CI para acessar o chip de silício. Usando microprobes, os especialistas podem despejar os dados hexagonais diretamente das células de memória. Este método é frequentemente usado em engenharia reversa para recuperar firmware de MCUs obsoletos ou bloqueados. Alguns chips podem ser atacados usando análise de energia ou ataques de temporização para descriptografar dados protegidos. Ao monitorar flutuações de energia ou tempos de execução, os pesquisadores podem decodificar o firmware criptografado sem precisar da chave original. Muitos microcontroladores têm portas de depuração ocultas (JTAG, SWD) que permitem acesso direto à memória flash. Se essas interfaces não forem desabilitadas, os invasores podem despejar o arquivo binário inteiro e restaurá-lo em outro chip. Se o MCU armazenar seu programa em uma EEPROM externa ou memória flash, o chip pode ser dessoldado e lido usando um programador. Este método é comum para replicar ou clonar firmware de dispositivos mais antigos. Para firmware criptografado, ataques de força bruta ou falhas de voltagem (injeção de falha) podem ser usados para contornar a segurança e extrair o código-fonte.

Para chips altamente protegidos, o desencapsulamento envolve a abertura física do CI para acessar o chip de silício. Usando microprobes, os especialistas podem despejar os dados hexagonais diretamente das células de memória. Este método é frequentemente usado em engenharia reversa para recuperar firmware de MCUs obsoletos ou bloqueados. Alguns chips podem ser atacados usando análise de energia ou ataques de temporização para descriptografar dados protegidos. Ao monitorar flutuações de energia ou tempos de execução, os pesquisadores podem decodificar o firmware criptografado sem precisar da chave original. Muitos microcontroladores têm portas de depuração ocultas (JTAG, SWD) que permitem acesso direto à memória flash. Se essas interfaces não forem desabilitadas, os invasores podem despejar o arquivo binário inteiro e restaurá-lo em outro chip. Se o MCU armazenar seu programa em uma EEPROM externa ou memória flash, o chip pode ser dessoldado e lido usando um programador. Este método é comum para replicar ou clonar firmware de dispositivos mais antigos. Para firmware criptografado, ataques de força bruta ou falhas de voltagem (injeção de falha) podem ser usados para contornar a segurança e extrair o código-fonte.

Đối với các chip được bảo vệ cao, quá trình tách vỏ liên quan đến việc mở IC vật lý để truy cập vào khuôn silicon. Sử dụng các đầu dò vi mô, các chuyên gia có thể đổ dữ liệu hex trực tiếp từ các ô nhớ. Phương pháp này thường được sử dụng trong kỹ thuật đảo ngược để khôi phục chương trình cơ sở từ các MCU đã lỗi thời hoặc bị khóa. Một số chip có thể bị tấn công bằng cách sử dụng phân tích công suất hoặc tấn công thời gian để giải mã dữ liệu được bảo mật. Bằng cách theo dõi các biến động công suất hoặc thời gian thực hiện, các nhà nghiên cứu có thể giải mã chương trình cơ sở được mã hóa mà không cần khóa gốc. Nhiều bộ vi điều khiển có các cổng gỡ lỗi ẩn (JTAG, SWD) cho phép truy cập trực tiếp vào bộ nhớ flash. Nếu các giao diện này không bị vô hiệu hóa, kẻ tấn công có thể dump toàn bộ tệp nhị phân và khôi phục nó vào một chip khác. Nếu MCU lưu trữ chương trình của mình trong EEPROM hoặc bộ nhớ flash bên ngoài, chip có thể được hàn lại và đọc bằng một bộ lập trình. Phương pháp này phổ biến để sao chép hoặc nhân bản chương trình cơ sở từ các thiết bị cũ hơn. Đối với chương trình cơ sở được mã hóa, có thể sử dụng các cuộc tấn công bằng vũ lực hoặc lỗi điện áp (tiêm lỗi) để bỏ qua bảo mật và trích xuất mã nguồn.

Đối với các chip được bảo vệ cao, quá trình tách vỏ liên quan đến việc mở IC vật lý để truy cập vào khuôn silicon. Sử dụng các đầu dò vi mô, các chuyên gia có thể đổ dữ liệu hex trực tiếp từ các ô nhớ. Phương pháp này thường được sử dụng trong kỹ thuật đảo ngược để khôi phục chương trình cơ sở từ các MCU đã lỗi thời hoặc bị khóa. Một số chip có thể bị tấn công bằng cách sử dụng phân tích công suất hoặc tấn công thời gian để giải mã dữ liệu được bảo mật. Bằng cách theo dõi các biến động công suất hoặc thời gian thực hiện, các nhà nghiên cứu có thể giải mã chương trình cơ sở được mã hóa mà không cần khóa gốc. Nhiều bộ vi điều khiển có các cổng gỡ lỗi ẩn (JTAG, SWD) cho phép truy cập trực tiếp vào bộ nhớ flash. Nếu các giao diện này không bị vô hiệu hóa, kẻ tấn công có thể dump toàn bộ tệp nhị phân và khôi phục nó vào một chip khác. Nếu MCU lưu trữ chương trình của mình trong EEPROM hoặc bộ nhớ flash bên ngoài, chip có thể được hàn lại và đọc bằng một bộ lập trình. Phương pháp này phổ biến để sao chép hoặc nhân bản chương trình cơ sở từ các thiết bị cũ hơn. Đối với chương trình cơ sở được mã hóa, có thể sử dụng các cuộc tấn công bằng vũ lực hoặc lỗi điện áp (tiêm lỗi) để bỏ qua bảo mật và trích xuất mã nguồn.

State Four: The Program Was Never in the MCU

If the code was never in the MCU, no work on the microcontroller will produce it. External EEPROM and external flash are separate packages, read with a programmer after desoldering or, in some cases, in circuit. This is external EEPROM firmware extraction at board level, and the cheapest state to resolve. See extracting MCU firmware for the same rule.

How to restore IC program by Matching Technique to State

Each technique serves a specific state. Debug-interface dumping answers states one and two, because JTAG and SWD read flash directly when not disabled. Decapsulation and microprobing serve state three. Removing an external memory device serves state four and nothing else. Side-channel analysis, which observes power consumption or execution timing, is a research tool of narrow applicability: it needs a device model and known plaintext, so it is no general answer. Fault injection, which perturbs supply, clock or light, and brute-force key search apply where protection is an algorithmic decision in the fetch path rather than a physical gate, and are the least predictable of the five. See dumping locked code from ATmega128V.

Restore IC Program from its embedded flash memory and eeprom memory has to change the status of Microcontroller from encrypted to un-encrypted, then readout code from MCU memory with universal programmer

Restore IC Program from its embedded flash memory and eeprom memory has to change the status of Microcontroller from encrypted to un-encrypted, then readout code from MCU memory with universal programmer

What a Restored Program Actually Is

Expect a verified image and, at best, a reconstructed project. Compilation discards comments, local names and the source tree, so a recovered binary supports functional reconstruction, not recovery of the original code. A successful read should be read back and compared against itself, and the handover should state which memory regions were covered and which were not. See reverse engineering of embedded IC memory for that discipline.

Для высокозащищенных чипов декапсуляция подразумевает физическое открытие ИС для доступа к кремниевому кристаллу. Используя микрозонды, эксперты могут выгружать шестнадцатеричные данные непосредственно из ячеек памяти. Этот метод часто используется при обратном проектировании для восстановления прошивки устаревших или заблокированных микроконтроллеров. Некоторые чипы можно атаковать с помощью анализа питания или атак по времени для расшифровки защищенных данных. Отслеживая колебания питания или время выполнения, исследователи могут расшифровать зашифрованную прошивку без необходимости использования оригинального ключа. Многие микроконтроллеры имеют скрытые отладочные порты (JTAG, SWD), которые обеспечивают прямой доступ к флэш-памяти. Если эти интерфейсы не отключены, злоумышленники могут сбросить весь двоичный файл и восстановить его на другой чип. Если микроконтроллер хранит свою программу во внешней EEPROM или флэш-памяти, чип можно выпаять и прочитать с помощью программатора. Этот метод распространен для копирования или клонирования прошивок со старых устройств. Для зашифрованной прошивки можно использовать атаки методом подбора или сбой напряжения (внедрение неисправностей), чтобы обойти защиту и извлечь исходный код.

Для высокозащищенных чипов декапсуляция подразумевает физическое открытие ИС для доступа к кремниевому кристаллу. Используя микрозонды, эксперты могут выгружать шестнадцатеричные данные непосредственно из ячеек памяти. Этот метод часто используется при обратном проектировании для восстановления прошивки устаревших или заблокированных микроконтроллеров. Некоторые чипы можно атаковать с помощью анализа питания или атак по времени для расшифровки защищенных данных. Отслеживая колебания питания или время выполнения, исследователи могут расшифровать зашифрованную прошивку без необходимости использования оригинального ключа. Многие микроконтроллеры имеют скрытые отладочные порты (JTAG, SWD), которые обеспечивают прямой доступ к флэш-памяти. Если эти интерфейсы не отключены, злоумышленники могут сбросить весь двоичный файл и восстановить его на другой чип. Если микроконтроллер хранит свою программу во внешней EEPROM или флэш-памяти, чип можно выпаять и прочитать с помощью программатора. Этот метод распространен для копирования или клонирования прошивок со старых устройств. Для зашифрованной прошивки можно использовать атаки методом подбора или сбой напряжения (внедрение неисправностей), чтобы обойти защиту и извлечь исходный код.

Most requests to restore IC program fall into one of these four states, and the state is usually visible within minutes of attaching a programmer to the board. Our laboratory handles firmware extraction, decapsulation and reverse engineering for parts whose protection is closed, and quotes the route once the part has been assessed.

Comments are closed.