add/delete/edit strings or files at runtime inside exe without res/section and show ?
hi guys
i explain in this image to what i want to do:
so i have a exe and nothing more,i want can add or edit or delete strings or small files or huge size files inside my exe at runtime and use them at runtime
I have asked similar questions in other threads like as :
Thread: How to protect exe file on ".RES"
Thread: any simple code for create ,add or edit or delete from resouce in runtime?
Thread: [VB6] - Store data to EXE.
Thread: Any way to read and write records to "access bank" or sqllite by memory?
and etc ...
i explained enough here too :
Re: Any way to read and write records to "access bank" or sqllite by memory?
Re: How to protect exe file on ".RES"
i created this thread because my problem not solved yet
important things :
1-add/edit/delete files at runtime without use resouece or (secion if dont neccessary by suggestion of [mr The trick])
2-show/play/load/unload/register/unregister etc... that files inside of exe without extract on disk.
formats :
-normal or (small size) files
-huge files like as videos more than 300 or 400 mb for each video or mp3 audios
-ocx/dlls
-fonts
-images like as png/svg/apng/etc and icons
-etc ...
my source till now is based on CEmbeddedFiles from mr the trick and encryption is based on aes encryption or xceed encyption for hug file sizes.
now problem is :
[not solved yet] - how add/delete/modify strings if i want use CEmbeddedFiles
[not solved yet] - how play that videos or mp3 audios without need save on disk after extract from inside exe
[not solved yet] - how show that images
[not solved yet] - how load and use that fonts inside my project
[not solved yet] - how load dlls or ocx from inside my exe.
so i am here wait for help of others and start with CEmbeddedFiles,first step is
how add/delete/modify strings if i want use CEmbeddedFiles of the trick
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Quote:
how add/delete/modify strings if i want use CEmbeddedFiles
Just as if you add a simple text file.
Quote:
how play that videos or mp3 audios without need save on disk after extract from inside exe
To play a mp3 file you could use PlaySound or ACM. To play an AVI you could use VFW/DirectShow. To play MP4 you could use DirectShow/MF.
Quote:
how show that images
There are several approaches GDI+/WIC/etc.
Quote:
how load and use that fonts inside my project
AddFontMemResourceEx
Quote:
how load dlls or ocx from inside my exe.
How a DLL should work in this case? For example if a DLL calls GetModuleFileName what this function should return?
You select the wrong concept. You shouldn't hide the files inside EXE and shouldn't overwrite such big amount of data each time. If you need a non-persistent storage you could use a database like COM storage or others. If you need to protect your data - use encryption. If you need to protect your DLLs - use protectors (don't use, nobody want to steal your executables).
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Is there a specific reason why you want to turn your exe into a data file as well as an executable? Exe files are not meant to be used like this, and although there are ways to do it you are going to encounter all sorts of weird issues.
For starters you will need to ensure whoever uses your exe has read write access to the location of the file and the exe itself. This is a potential security risk.
The constantly changing exe is likely to trigger av warnings and issues with firewalls of the application needed access due to checksums changing.
Could you not just have a normal exe file and a single file with all your resources in. Use something like a zip file, this would allow multiple files to be modified individually.
I am struggling to see what you perceive as the benefits of your idea when compared to all of the issues and potential problems.
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Quote:
Originally Posted by
PlausiblyDamp
Is there a specific reason why you want to turn your exe into a data file as well as an executable? Exe files are not meant to be used like this, and although there are ways to do it you are going to encounter all sorts of weird issues.
For starters you will need to ensure whoever uses your exe has read write access to the location of the file and the exe itself. This is a potential security risk.
The constantly changing exe is likely to trigger av warnings and issues with firewalls of the application needed access due to checksums changing.
Could you not just have a normal exe file and a single file with all your resources in. Use something like a zip file, this would allow multiple files to be modified individually.
I am struggling to see what you perceive as the benefits of your idea when compared to all of the issues and potential problems.
yes There are several years that I work for private and public companies and one of this private companies want create new project about learning , i created some products before for that company like as i show in #1.so i used many activex like as codejock/chilkat,xceed,vlc,... for zip/play/encrypt/ui/network/etc (some of theme was been not free) and protectors /compressors(pe,engima,VMProtect,upx,...),i used some classess for work with hugefiles/fonts/images/memory and etc ... for some works
this time company want for first step to i jst create a single exe with no any seperate data and Also reduce the use of ActiveX/additional files and support keep/change/use contents.
as i show in image in #1 I became careless about add exe because av warnings and reduce the use of ActiveX.
after i compiled i should be send it to testers in company.They usually test program on a newly installed windows (xp,7,10) with the minimum requirements and used some softwares for monitoring files/registry for check any create/modify/delete data like as temporary files,So if I have to save a file to a location on the disk, I have to minimize the amount of editing and deletion.Because the amount of these operations can be seen and examined for them.
next step is protect that exe.
So I have been researching this topic in the forums for some time and I have sent threads related to this topic, and despite the variety of examples in the first step, I have to choose the best way, so I chose this to start using CEmbeddedFiles of the trick for base of add different files and different sizes (i talked about huge size too in that realted threads) inside exe without need to use the resources section
i see answer of the trick in #2 about use :
Quote:
Originally Posted by
The trick
- PlaySound or ACM
- GDI+/WIC/etc
- AddFontMemResourceEx
- DirectShow/MF
- VFW/DirectShow
- etc ...
i know i should be use theme inside my project ,I have a few examples of some of these generalities and some that I need help combining with this CEmbeddedFiles class.
Quote:
nobody want to steal your executables
Do you respond on behalf of others?!!! "nobody" except nobody and this is not mine executables only,its for company too so sorry if "nobody want to steal " nobody can't get enough of your warranty and guarantee.encrypt is next step.
at begin work with CEmbeddedFiles first problem as i said before more than 2 times i need can add/modify/delete strings too and say why = i dont want create files like as text files for save strings because of this proccesses :
if i want add new string:
- i should be create new text file on disk
- put data and save on disk
- add to exe and delete from disk and save again that exe
when i want edit strings :
- i should be extract that file on disk again and delete it from inside exe so need save that exe again after delete from inside
- edit and save text file on disk.
- save exe again overwite exe
but if i can add this string option into class so process will be change to :
- extract string /maybe without need delete that string extracted from exe (replace is better)
- change string and replace that string or if not possible ok delete from inside exe/save again exe/add string and save again exe
I do not prioritize the use of text files instead of strings find find a slotion to maybe possible change that class for add option for string too but If it is not successful, there is no choice and i should use a text file,i asked before for add this option
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Easiest way to get there would be to pass the data to another .exe, shut down the main one, have that exe modify the main one, then restart the main one and exit the editor (if you're continuing, can just exit).
If you do it that way, you can just store everything in a traditional resource file, which are relatively easy to edit in an existing exe (we do it around here all the time for manifests and icons, but resources can store anything).
Trying to exceed 2GB will be painful, and exceeding 4GB won't be possible because of OS limits on executable sizes.
PS: A lot of these questions you're asking seem to revolve around trying to stop people from 'stealing' data from your program. Once you taken basic steps to discourage casual copying/registration bypass, you've gone about as far as worthwhile. Simply putting things inside your exe isn't going to offer an advantage over an encrypted external file or registry key. Even ultra high end DRM system like Denuvo are just protecting the code/keys that access external assets. You're going to wind up creating problems for your paying customers while doing nothing to stop people from cracking your program.
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Quote:
Originally Posted by
Black_Storm
yes There are several years that I work for private and public companies and one of this private companies want create new project about learning , i created some products before for that company like as i show in #1.so i used many activex like as codejock/chilkat,xceed,vlc,... for zip/play/encrypt/ui/network/etc (some of theme was been not free) and protectors /compressors(pe,engima,VMProtect,upx,...),i used some classess for work with hugefiles/fonts/images/memory and etc ... for some works
this time company want for first step to i jst create a single exe with no any seperate data and Also reduce the use of ActiveX/additional files and support keep/change/use contents.
I think there is a big difference between what a company wants and what is practical. Them wanting a single file is fair enough, especially if all the assets contained in the .exe are to be treated as read only. If they want a single .exe, absolutely no other files, and to have the assets potentially being changed every time the .exe is run then they are asking for something that is incredibly difficult to offer, is pretty much using .exe files in a way they were never designed to be used, going against a lot of good security practices (e.g. allowing write access to executables, expecting .exe files to change), and ultimately making the job a lot harder than it needs to be. In fact is it even possible to update the exe while it is running or would you need a second .exe to modify the first one? If that is the case you are already having to provide two files anyway.
Quote:
Originally Posted by
Black_Storm
as i show in image in #1 I became careless about add exe because av warnings and reduce the use of ActiveX.
after i compiled i should be send it to testers in company.They usually test program on a newly installed windows (xp,7,10) with the minimum requirements and used some softwares for monitoring files/registry for check any create/modify/delete data like as temporary files,So if I have to save a file to a location on the disk, I have to minimize the amount of editing and deletion.Because the amount of these operations can be seen and examined for them.
There is a difference here between installing the app on a new machine (ActiveX etc.) and any other data files though. My VB6 is very rusty so I am not sure about things like regfree etc. but you might be able to deploy your app without an installer. Although an installer would make sense if it was an option. Does not wanting to use multiple .dlls and .ocxs also mean you don't want separate data files?
Quote:
Originally Posted by
Black_Storm
at begin work with CEmbeddedFiles first problem as i said before more than 2 times i need can add/modify/delete strings too and say why = i dont want create files like as text files for save strings because of this proccesses :
if i want add new string:
- i should be create new text file on disk
- put data and save on disk
- add to exe and delete from disk and save again that exe
when i want edit strings :
- i should be extract that file on disk again and delete it from inside exe so need save that exe again after delete from inside
- edit and save text file on disk.
- save exe again overwite exe
but if i can add this string option into class so process will be change to :
- extract string /maybe without need delete that string extracted from exe (replace is better)
- change string and replace that string or if not possible ok delete from inside exe/save again exe/add string and save again exe
I do not prioritize the use of text files instead of strings find find a slotion to maybe possible change that class for add option for string too but If it is not successful, there is no choice and i should use a text file,i asked before for add this option
Is it really that big a deal to just have a couple of additional data files with your app? Or to create them on first run with default contents? Constantly modifying the .exe itself in this way seems overly complex. Especially if you are also wanting to encrypt data, and using large files as well.
If you want to minimize the amount of files then you could have the single .exe file and a single datafile (make it a .zip file, rename the extension if you want to conceal the file type), store the actual data inside this file. That way you could either use an encrypted zip file, or store encrypted data into the zip file. However this would allow you to put the .exe in a read only location, the data file in a standard user writable location, and it supports multiple files internally (even multiple folders), you could probably read directly from / write directly to this zip file without extracting the individual entries to disk as well.
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
As I said before, there are plenty of examples that store and extract information into an additional file next to the program, and I mentioned earlier that this is different.
If I want to give an example like you, I can only have a zipper with a password and save the files in it, and I have done this many times before, or have an installer that registers everything it needs to install and so on. These things do not need to be asked if they are supposed to be similar, and they all work this way, or I can read and display all the information with a simple internet connection, and there is no need for a large volume to store information.
In the case of difficulty, yes, it is not supposed to be easy.
Aes encryption worked on windows 7 and win 10 but notworkd on winxp!!! how fix that?
I have been following the process of encrypting large files in this thread for a few days, and 70% of the work is done, but the rest is left without decryption on disk and playback, and this is one of the steps I need, and that thread It is related to these steps.
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Do you already have a video player which can play directly from a memory data stream?
Re: add/delete/edit strings or files at runtime inside exe without res/section and sh
Quote:
Originally Posted by
Arnoutdv
Do you already have a video player which can play directly from a memory data stream?
maybe some online players support,i used jwplayers many years ago because support rtmp,rtsp,live stream and maybe support blob videos,blob urls, and etc ... but i dont want use online connection.maybe vlc (as i show in some works in #1) can support because its support live stream too because i worked with that many yrs ago too idk yet because i have not any experience to work with decryption buffers and play.
https://wiki.videolan.org/Stream_to_...mem)_tutorial/
This is one of the questions I mentioned earlier that I can now play a video with the help of tricks without having to create a file, but I do not want to get into these issues, but only with coding and memory content, stream , Encryption and decryption and the like continue
and if u know or can help about it,send a sampe code or project ...
I also found a problem in the CEmbeddedFiles class that when I want to import only a files size for example 300 megabytes, it gives an over flow memory error. but i asked before any problem with huge size files!!!