Author Topic: self referencing programs with self modifying capabilities...  (Read 3022 times)

0 Members and 1 Guest are viewing this topic.

Offline Dragoncat

  • Newbie
  • Posts: 10
    • View Profile
Is it possible to create a program that has a string or value in it that it saves with the program itself that changes every time the program is run?? as in it saves it IN THE PROGRAM ITSELF after the executable part of the code, and then can change it every time it is run, I have some ideas for using this kind of functionality, also the program should not ever actually run on over or whatever the part that it changes, and should be invisibly attached to the program itself, and not as a separate file... can this be done?... like I was thinking maybe have some data attached to the end / at the end of the program  after the program is compiled to an EXE that the program would then be able to look for and find, by scaning to the end of the program then rewinding by a certain number of bytes, as the data added would be a specific number of bytes long like say 32 bytes... can this be done??
« Last Edit: May 08, 2019, 11:51:54 am by Dragoncat »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: self referencing programs with self modifying capabilities...
« Reply #1 on: May 08, 2019, 11:53:46 am »
You might be able to append something onto the exe.

To get that, try this: http://qb64.org/wiki/Windows_Libraries "Directory Environment"

Well for Windows users anyway...
« Last Edit: May 08, 2019, 11:55:06 am by bplus »

Offline Dragoncat

  • Newbie
  • Posts: 10
    • View Profile
Re: self referencing programs with self modifying capabilities...
« Reply #2 on: May 08, 2019, 12:09:45 pm »
what if I read the executable in with another program, add the needed date to the program which is designed to look for it, and voila! that might work? IE edit the program with another program as if it was a just a file on the computer... then next time that program runs as in actually runs then it should be able to read those bytes you just added, but if you mess up on that adding part and accidentally run the program before you make the necessary modifications that could be very bad...also you should make the program to be sure it will end at it's end by using a system or end or exit command so it does not run the data that you added or will add at the end of the actual program..!!! failure to do so might be bad.