Please explain what a generic binary image is. I never heard of it.

It's doubtful that anyone is going to write your code. For one thing, you're short of about lebenty-jillion actual facts. When you've researched enough to actually present your question, you will be about ready to design the task and write some code, for which you can receive help. There is always the alternative of hiring it done on some job site, but you'll still have to specifiy the job accurately.