Link to home
Start Free TrialLog in
Avatar of jhattingh
jhattingh

asked on

How do I allow my exe to modify it's own resource?

I basically want to be able to modify a resource in my executable as a way of copy-protecting my programs. When the program first runs, I want it to modify a resource, giving it the serial number of the user's C: drive.

Is this possible? I know how to retrieve serial number - I only want to know how to modify "self".

Avatar of jkr
jkr
Flag of Germany image

>>I want it to modify a resource

This is possible using e.g. 'UpdateReposurce()' (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/hh/winui/resource_2crp.asp) - see also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/hh/winui/resource_05yr.asp ('Adding, Deleting, and Replacing Resources'). However, there are some restrictions:

  Windows NT/2000 or later: Requires Windows NT 3.1 or later.
  Windows 95/98/Me: Unsupported.
Avatar of migel
migel

Hi!
Why resource ???
you can write serial id indirect into the EXE file just make sure where serial located in the exe and write nwe value to the founded offset
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America 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