Is is possible to store data in a .exe file? I want to store some text in exe (No database , No another File). Thanks for reply
Printable View
Is is possible to store data in a .exe file? I want to store some text in exe (No database , No another File). Thanks for reply
Will you want to edit the text at all?
Yes I want to use this text for read & edit.
I'm not sure, but i don't think this is possible. Or at least it would be very difficult.
You'd obviously get read/write issues, because you can't edit an exe when it's running. Also, i don't think you could simply say 'MemoryLocationInEXE = "A String". It would be a lot more difficult.
If the reason you want to do this is because you don't want anyone editing your files, then you could search this forum for an encryption algorythm, as there are many.
If the reason is to hide, then try saving the data to the registry.
It is not hard at all.. You can create your own data structures... e. g.
Code:Type mystruct_t
Name As string * 10
Age As Integer
Gender As Integer
End Type
Dim profile as mystruct_t
you can then seek to the end of the file and PUT this info. You can read it back out bo seeking to the end of the file but then subract the length of the structure.. e.g Len(profile), gets sizeof mystruct_t and then do a GET to get the data back out...
As far as manavo11's post... You can't hide data. You can only protect it from prying eyes... Besides that, there are many uses for storing data after the exe structures...
I didn't mean that it is invisible but that it is harder to find that a ini file in the same path as your exe... I recommend saving with encrtyption though whichever method you use...
I guess thats why microsoft put a Find function in regedit. Don't know the reg keys/values you say? Try a hexeditor.
Huh? :confused: I never said that they are invisible or you cannot find them. It is just harder that an ini file in the same path as your app... I'm confused :(Quote:
Originally posted by nkad
I guess thats why microsoft put a Find function in regedit. Don't know the reg keys/values you say?