Changing data inside an image file (.img) without mounting.
I'm interested in knowing if it's possible to edit a single text file from within an image file. Here's my idea...
If I make an image of my drive with 'dd'. Then I edit an existing file (the one I want to edit in the .img file), save it, and make another image file with dd. Then by comparing the bytes from each file, find out exactly where I would need to edit the .img file.
That way if someone wants a copy, I can just run a program that injects, lets say, a serial number linked to that user hidden in the .img file.
I know I would have to edit the template to include spaces where the serial number will go, so that way I'm just changing existing bits, and not making the .img file bigger.
Is this possible, or do I actually have to look at programming a way to mount the .img file first before it gets edited every time?