• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

Code to read and write to EPROM


Can someone help me with a snippet or code that will allow us to read and write data to an EPROM in either C or C++

3 Solutions
What type of EEPROM?

birenshuklaAuthor Commented:
EEPROM is Atmel 24C family.

Basically, we are going to use hte i square C protocol to program the EEPROM. It is a hardware device that attaches to a computer's USB that serves as a license key.
Jaime OlivaresSoftware ArchitectCommented:
Appears to be you are trying to crack a license dongle.
Besides this, code to read the EPROM will be useless because it is protected by USB logic, you will need to learn how to "talk" to the device through the USB driver. That's not a trivial task if you are not the device's designer.
Simple Misconfiguration =Network Vulnerability

In this technical webinar, AlgoSec will present several examples of common misconfigurations; including a basic device change, business application connectivity changes, and data center migrations. Learn best practices to protect your business from attack.

birenshuklaAuthor Commented:
We are designing the device. We are the manufacturer. I just want to know how to achieve this task of being able to read and write to the EEPROM on the device(which is USB) when the software wants to check to see if the client has the license hardware or not.
Jaime OlivaresSoftware ArchitectCommented:
well, in that case you have to choose a microcontroller to manage the memory, have you did it?
The secuence is:
You have to build a device with a USB enabled microcontroller or a standard microcontroller with an USB controller device, plus memory.
Write the software (or firmware) for the microcontroller.
Write the specific USB driver for windows
Write the code portion to talk to the device through the driver.


Check O-Reilly publications..


They have book on Embedded systems programming..Also.. check this.


Might give you some idea.

Dariusz DziaraProgrammerCommented:
"Write the software (or firmware) for the microcontroller."
1. Likely there will be support for I2C protocol in microcontroler (simple instructions like I2CSTART, I2CSTOP, I2CWRITEBYTE, I2CREADBYTE)
2. You wil have to handle USB endpoint to exchange data with windows driver

"Write the specific USB driver for windows"
Probabely there will be some generic windows driver for microcontroler (read data, write data). This will spare you writing your own dirver.
Jaime OlivaresSoftware ArchitectCommented:
If you really want to spare LOTS of time, I suggest you to buy this book:
USB Complete
By Jan Axelson

I have the book, it has the basics to design both sides of USB (PC and device).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now