-
any simple code for create ,add or edit or delete from resouce in runtime?
hi i want publish my exe but i need work with resource at runtime and can create resource or add edit delete something from resource
for example i want create a counter exe and without need save on disk like as files or registry or access to internet,i want can run my exe till 5 times so i need create a counter variable in my exe
any way to can create or add edit delete string or binary to my resource in runtime?
any other way or idea?
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
It can be done, and the shareware ResourceHacker program does it. But personally, I'd strongly recommend modifying your EXE after it's compiled. Just one reason ... this is something virus scanners specifically look for. Personally, whatever you think you need to modify, I think it'd be much better done in some external database somewhere (or some other storage external to your program).
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
I'm pretty sure that while being executed PE files are locked to prevent writing to them.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
And even if you do write to the resource you are still writing to disk just is a different place.
The bottom line is that if you want to save data for use the next time the program runs you have to save that data somewhere either locally or remotely and no matter where you save it it is going to be on a disk somewhere in some format if not then it is not saved.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Just use save setting/getsetting like normal humans
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
If I want to work on external files and also do not need to use the Internet, then the risk of my external file being edited or manipulated by hackers is far greater than wanting to edit the executable file and still the file Stay healthy.
I realize that to save information, you can save it with the help of the Internet or in a file, but I specifically asked the question that I can have only one executable file and no more.
I gave a simple example, but a more advanced example can be given
For example, how can a program be limited to a specific number of executions without the number of executions being stored in a separate file or in the registry or without the Internet? For example, I want my program not to run after 5 times, but hackers can not find the external file or scan the registry and the like.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Quote:
Originally Posted by
dz32
Just use save setting/getsetting like normal humans
are u talking about work with registry !!!!
normal humans can find or edit settings too from registry !!!
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Hackers can always bypass it, ask any game developer best you can do is make it hard
Writing a local file or registry doesn’t matter, just use encryption for the data. Saving it somewhere hidden like in your exe is no more safe once a hacker starts looking at your code
Your best solution will be to use a trial wrapper program that supports different trial times and license codes
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
run progtam for limitation is jst a example for work in resource because i created this thread to work and edit resources at runtime i did not created this thread to talk
about encode decode data or save in registry or external binary files , for example maybe i have others data in resources too and i need load it edited and saved it again
but if hackers want looking my code so can looking my code with external files too.
if any body have sample project send here,i want know possible edit internal resources in vb or not,if yes any sample code?
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Quote:
Originally Posted by
Black_Storm
run progtam for limitation is jst a example for work in resource because i created this thread to work and edit resources at runtime i did not created this thread to talk
about encode decode data or save in registry or binary files for example maybe i have others data in resources too and i need load it edited and saved it again
but if hackes want looking my code so can looking my code with external files too.
An exe that modifies itself on every run will need to be in a folder the end user has write permissions to, this is introducing a potential security risk to the system. Also an exe that modifies itself on every run risks tripping up any AV software installed, an .exe being changed is normally a pretty good sign something suspicious is going on.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
maybe need another modifer exe but created with vb and can access to resources in opened exe and edited and saved with replace to opened exe?
if yes any sample code to can modify another exe vb and access to resource part and edit it?!!
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
G'Day BS
I'm not certain you are using KISS here !!!
Quote:
Originally Posted by
Black_Storm
maybe need another modifer exe but created with vb and can access to resources in opened exe and edited and saved with replace to opened exe?
Only 1 more ???
Do you have a setup program ?
If 'Y' this design is never going to scale up
Just my 2C worth, oh and 40++ years exp. with M$ OSs starting with Dos 1p0
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
A second EXE to use as your database? WOW, you do run across some strange ideas!
And why don't we just go out of our way to flag virus scanners. *shakes head*
Heck, just last night I tried to email a batch file to myself, only to learn I wasn't allowed. So, let's make EXEs that are modified all the time?
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
In the last century, this method was used:
The cluster at the end of the hard disk was declared corrupted and the necessary information was written to it. Back then, Operating Systems allowed working with hard disk clusters. What is the situation now, I do not know.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Quote:
Originally Posted by
Argus19
What is the situation now, I do not know.
FAT32 is still available but there is exFAT too for larger HDDs.
The trick with bad/occupied final cluster was always problematic as direct disk access under Windows is available to admins only.
DOS was another beer altogether :-))
cheers,
</wqw>
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Quote:
Originally Posted by
The trick
thanks for this,i can resolve this thread but let me ask these 5 questions jst for know more before resolve :
1- i see UpdateResource or EndUpdateResource or BeginUpdateResource but how can add "delete resource method too" at runtime?
2- if i want add a binary file like as docs,mdb,mp3,pdf or etc ... how can do that?
3- any limitation size for add to resource? for example can i add a file with more than 10mb or 50mb or 100 mb too?
4- can i add more than 1 files to this resource?
5- can i add my data like as protected resource to can protect my resource too? because i can replace a res file in this exe with another res too but maybe any assembly trick or idk ?
any sample or help code to can find these answers?
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
Quote:
Originally Posted by
wqweto
FAT32 is still available but there is exFAT too for larger HDDs.
The trick with bad/occupied final cluster was always problematic as direct disk access under Windows is available to admins only.
DOS was another beer altogether :-))
I already remember it very vaguely.
-
Re: any simple code for create ,add or edit or delete from resouce in runtime?
i create this thread ,maybe i can solve it.
Thread: add/delete/edit strings or files at runtime inside exe without res/section and show ?
https://www.vbforums.com/showthread....30#post5556830