Results 1 to 19 of 19

Thread: any simple code for create ,add or edit or delete from resouce in runtime?

  1. #1

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    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?

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,915

    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).
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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.

  5. #5
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,296

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    Just use save setting/getsetting like normal humans
    Last edited by dz32; Feb 12th, 2022 at 04:01 PM.

  6. #6

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    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.

  7. #7

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    Quote Originally Posted by dz32 View Post
    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 !!!
    Last edited by Black_Storm; Feb 12th, 2022 at 04:37 PM.

  8. #8
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,296

    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

  9. #9

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    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?
    Last edited by Black_Storm; Feb 12th, 2022 at 04:58 PM.

  10. #10
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    Quote Originally Posted by Black_Storm View Post
    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.

  11. #11

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    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?!!
    Last edited by Black_Storm; Feb 12th, 2022 at 05:16 PM.

  12. #12

  13. #13
    Addicted Member jg.sa's Avatar
    Join Date
    Nov 2017
    Location
    South Australia ( SA )
    Posts
    200

    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 View Post
    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

  14. #14
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,915

    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?
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  15. #15
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    437

    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.

  16. #16
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,192

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    Quote Originally Posted by Argus19 View Post
    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>

  17. #17

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    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?

  18. #18
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    437

    Re: any simple code for create ,add or edit or delete from resouce in runtime?

    Quote Originally Posted by wqweto View Post
    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.

  19. #19

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    591

    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
    Last edited by Black_Storm; Feb 20th, 2022 at 03:12 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width