Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Change application resources on run time


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Nov 16, 2017 1:38 PM Last Post By: Remy Lebeau (Te...
Martin Masci

Posts: 29
Registered: 4/3/04
Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 8:23 AM
I have a windows application (I think develop with Visual C++) and I want change resources (menu, strings, ...) when it run.
Is it possible (and how) create a Delphi application to do it?
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 10:24 AM   in response to: Martin Masci in response to: Martin Masci
Am 15.11.2017 um 17:23 schrieb Martin Masci:
I have a windows application (I think develop with Visual C++) and I want change resources (menu, strings, ...) when it run.
Is it possible (and how) create a Delphi application to do it?

Possible? Yes, with enough knowledge. Smartbear's TestComplete for
instance can do such things.

But it's not without danger, as it most likely means to write around in
the memory on that other process.

But why do you want to do this?
Maybe you can patch the exe file with a hex editor, if these new strings
are shorter than the old ones.

Greetings

Markus
Martin Masci

Posts: 29
Registered: 4/3/04
Re: Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 10:31 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Am 15.11.2017 um 17:23 schrieb Martin Masci:
I have a windows application (I think develop with Visual C++) and I want change resources (menu, strings, ...) when it run.
Is it possible (and how) create a Delphi application to do it?

Possible? Yes, with enough knowledge. Smartbear's TestComplete for
instance can do such things.

But it's not without danger, as it most likely means to write around in
the memory on that other process.

But why do you want to do this?
Maybe you can patch the exe file with a hex editor, if these new strings
are shorter than the old ones.

Greetings

Markus

I have a freeware application in chinese language and I want convert in english so I can use it. I just have try to replace strings and menu with a resources editor (I have try many of theme) but after save the file it cannot run. I think there is a check about original file.

I'm not an expert, do you have any advice on how to do it? I'd like to create (if possible) a delphi application about this.

Edited by: Martin Masci on Nov 15, 2017 10:49 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Change application resources on run time [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 11:56 AM   in response to: Martin Masci in response to: Martin Masci
Martin Masci wrote:

I have a freeware application in chinese language and I want convert
in english so I can use it.

Should be easy enough by editing its resources, or copying the Chinese
resource to a new resource and then replace its strings with English
versions.

Or, you could just contact the app author and ask for an English
version.

I just have try to replace strings and menu with a resources editor (I
have try many of theme) but after save the file it cannot run. I think
there is a check about original file.

It is possible. Some apps do self-check themselves for external
modifications (malware, viruses, user tampering, etc). The OS can even
do that check automatically for code-signed apps.

I'm not an expert, do you have any advice on how to do it?

Your best course of action is to talk to the app author.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 11:52 AM   in response to: Martin Masci in response to: Martin Masci
Martin Masci wrote:

I have a windows application (I think develop with Visual C++)
and I want change resources (menu, strings, ...) when it run.

You can't. The executable is locked while running, changes can't be
made to it. You Can update the resources (with the Win32 API
(Begin)UpdateResource() functions) only while the app is not running.

--
Remy Lebeau (TeamB)
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 16, 2017 12:21 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Am 15.11.2017 um 20:52 schrieb Remy Lebeau (TeamB):
Martin Masci wrote:

I have a windows application (I think develop with Visual C++)
and I want change resources (menu, strings, ...) when it run.

You can't. The executable is locked while running, changes can't be
made to it. You Can update the resources (with the Win32 API
(Begin)UpdateResource() functions) only while the app is not running.

Then I wonder how I managed to change the copyright string of MS Paint a
few years ago when I did my first steps with TestComplete...

It has object recognition, because it seems to be detecting the kind of
app like MFC, VCL etc. It provides a tree of all GUI objects it knows
along with their proerties and you can change most of them (at least
where it makes sense)

Greetings

Markus
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Change application resources on run time  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 16, 2017 1:38 PM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:

Then I wonder how I managed to change the copyright string of MS
Paint a few years ago when I did my first steps with TestComplete...

I can't answer that, since I don't know what TestComplete is, or how
you used it.

It has object recognition, because it seems to be detecting the kind
of app like MFC, VCL etc.

That is not too difficult to do. There are certain hueristics that can
be applied to an executable to guess what type of libraries it is
using. More so for Delphi executables, as it has a number of markers
that can easily be looked for.

It provides a tree of all GUI objects it knows along with their
proerties and you can change most of them (at least where it makes
sense)

That could be done any number of ways. If the UI elements are stored
in dialog resources, or DFM resources, those are easy to edit. Just
not while the executable is running, as resources are locked from
modifications.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02