0

I have a code on the server-side(application) that links with the client-side(application). The user signs-up to download the exe(client-side application). There must be a unique way to identify the user(client app exe) with the info got from sign-up.

So, one of the information must be attached to exe file during the download.

One of the ways I found is using "Portable Executable".

Is it possible to add string data to exe and later retrieve it?

Is there any other possible way to make the exe user-specific? Or is it possible to add the user information along with the downloaded exe?

fury.slay
  • 1,202
  • 1
  • 15
  • 26

1 Answers1

1

Yes, it is potentially possible to modify the exe at runtime to put your own stream. You might put the User Specific information in an existing Resource prepared for this "update". This would be the easiest way to avoid to take care about changing other parameter like size, etc.. Another option would be to put the User Specific information in the overlay of the Exe.

mox
  • 6,084
  • 2
  • 23
  • 35
  • I got some idea from it. But, I must add the user information during download not at runtime, because after download the server cannot identify application running in the user system. So I need a way to identify it. – fury.slay Jul 10 '14 at 10:41
  • Sure, once the server detects a connection from a client and identified it, it can collect data and put appropriate info in the exe that the client wants to download. Am I understanding your scenario correctly? – mox Jul 10 '14 at 12:00
  • Exactly, how is it possible to add resource after creating exe? "You might put the User Specific information in an existing Resource prepared for this update" - I didnot understand this part of your answer. – fury.slay Jul 11 '14 at 04:00
  • a) there are different possibilities to add resource to an executable. The easiest way is to use the Microsoft Resource API http://msdn.microsoft.com/en-us/library/windows/desktop/ff468902(v=vs.85).aspx b) You might add a dummy (e.g. 1KBytes) resource to your executable - statically - and then - at runtime - fill this dummy resource with user specific data. This is, of course, just a suggestion. – mox Jul 16 '14 at 12:02
  • Just what i was looking for. But, I have no idea how to implement your suggestion. If you could elaborate or any site for reference, it would be great. – fury.slay Jul 21 '14 at 09:11
  • There are several samples available on Codeproject that use the Resource API mentioned above. You might have a look at http://www.codeproject.com/Articles/47708/Modify-Update-resources-of-an-Exe-DLL-on-the-fly – mox Jul 23 '14 at 09:03