Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to decompile .bin from Microchip EEPROM

Jamesscaggs

Newbie
Joined
Jun 12, 2021
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
25
This is probably a dumb question but I’ll ask it anyway. I’ve dumped a bin file from a Microchip EEPROM and am wanting to decompile it using Ghidra. When I import the file it detects the raw binary format but I need to select the language and compiler but I am not sure which to select. I have the data sheet for the EEPROM chip

https://ww1.microchip.com/downloads/en/DeviceDoc/doc3256.pdf

The microcontroller is this PIC

https://www.mouser.com/ProductDetai...C33EP16GS202-E-SS?qs=3K5NeMAIBDnPhqw/6zknnQ==
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,944
Helped
4,370
Reputation
8,749
Reaction score
4,352
Trophy points
1,393
Activity points
132,017
Hi,

I doubt that there is executable code in an external EEPROM connected to a PIC.

Klaus
 

Jamesscaggs

Newbie
Joined
Jun 12, 2021
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
25
Hi,

I doubt that there is executable code in an external EEPROM connected to a PIC.

Klaus
I am wanting to compare two different eeprom files from two boards of the same type. I have the two files but I don't understand what the next step is.
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
15,021
Helped
4,894
Reputation
9,808
Reaction score
4,695
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
127,643
EEPROM is used for data storage, not program storage so there would be nothing Ghidra could recover. The program resides inside the PIC, the EEPROM is read or written by the program but only to store things like configuration or log files. The process of electrically reading and writing the EEPROM makes it virtually impossible to actually run a program inside it.

I think what you are trying to do is work out which addresses in the EEPROM hold specific information, to do that you can either use trial and error by making changes and then reading the EEPROM to see what difference is made, or you can attempt to decompile the code memory inside the PIC. I would caution you though that almost all commercial PIC code is protected electrically by setting a bit inside the IC. It doesn't prevent it being RE-programmed because erasing the device to clear the protection bit also wipes the program memory!

Also note that the addresses used to store data in the EEPROM are decided by the program so there is a risk that different program versions allocate them differently.

Brian.
 

danadakk

Advanced Member level 4
Joined
Mar 26, 2018
Messages
1,096
Helped
206
Reputation
424
Reaction score
223
Trophy points
63
Activity points
5,108
You can store program code in EE but to execute it would need to move it
to FLASH and then execute from there. Could be a boot loader function.

Depends on PIC, 16F maybe no, 18F I think yes....if capability exists to use
bootlaoders, eg. program its own FLASH....

Regards, Dana.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top