Link to home
Start Free TrialLog in
Avatar of Bohne
Bohne

asked on

How to change an ID number in an exe file without recompiling it

Hi,

it was not easy to find an appropriate title for my question. I'll try to explain my problem as clear as possible.
I have to write a small application, which does set a special bit in the memory of a hardware device. I already have the application which sets the bit, BUT this bit may not be set in every device. Only devices with a special hardware ID may have set this bit.
The problem is, that the hardware IDs which may have set this bit are not known at compliling time. The valid hardware ID has to be set in the application later.
This bit is for some kind of security reason. Therefore it is important that the hardware ID can not be chosen by anyone, so that the bit can not be set in any device (no *.ini file).
This change in the application must be possible on every computer, even if there is no compiler installed.

Is there some possibility of having a small standalone compiler or something like this? Any other ideas?

I hope I made myself clear enough... Otherwise just ask.

Thank you very much
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

I think best approach is to save ID as a resource (like a bitmap or icon inside your app), so you can change it without recompiling.
Is your app a Windows GUI application?
Avatar of Bohne
Bohne

ASKER

yes it's a MFC GUI application in Visual Studio C++. How do I get this resource into my application? And is it secure, can nobody else change this resource?
>>And is it secure, can nobody else change this resource?
There doesn't exist a secure method by itself, anybody can change your app and you can't avoid it in any way, but you can encrypt your data so if other user try to change it, you can detect it with some kind of CRC or hash algorithm.
Avatar of Bohne

ASKER

So how do I change this resource? Can I write a small second application which changes the resource?
Avatar of Bohne

ASKER

I have now stored the ID in the String Table resource of my application. So I can change this string (e.g. with Resource Hacker) and everything works. But how do I change this string with a self programmed tool (which should be much more simple than Resource Hacker)? Are there any examples on changing a resource of an exe file in Visual Studio C++?
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial