News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

real-time resource editing

Started by redskull, July 07, 2006, 01:03:08 AM

Previous topic - Next topic

redskull

I had some strings that I was going to store in the registry and edit/save them as necessary, but then I wondered about the possibility of storing them in a resource file and changing them at run-time.  Even though it's just data, it's still probably in the realm of EXE file editing which is bad ju-ju in these parts.  So I guess my question is if it's worth trying to implement it, or if the ends don't justify the means.  I don't mean to toe the legality lines, so delete as necessary.

alan
Strange women, lying in ponds, distributing swords, is no basis for a system of government

hutch--

Red,

Unless you have good reason to do otherwise, nothing is as flexible as a seperate INI file that you always write to the same directory as the executable. You normally test for it at startup of the EXE, write a default version if its not there and read its content into the EXE to retain the values you want. Putting stuff in the registry is a security issue that a trojan can scan the registry for and identify your app from it.

With a lot of messing around you can directly patch an EXE but with all 32 bit Windows versions, it cannot be done from the EXE that is to be patched. You can write a seperate patcher for it but the EXE will have to be closed while you are patching it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Casper

I have created an installation program.  One of the things I needed to deal with was to create an ini file but somehow protect it against tampering.  My solution was to bundle the ini file into the exe by adding it as an RCDATA resource and then the exe loads it into memory and parses it.  I did the same with a DLL.

Casper

redskull

thanks guys, an .ini file looks like the way to go  :U
Strange women, lying in ponds, distributing swords, is no basis for a system of government