JohnE
JohnE

Reputation: 165

Is there a way to edit a windows C++ exe file in linux

I've been searching online but haven't really found anything definitive.

Lets say I have a windows .exe file with resources (rc files) compiled in (C++ compiled).

Is it possible in Linux to crack open the exe, modify the rc file, then save it again?

I'm writing a program where each user who downloads it will need to run it with different parameters (similar to UltraVNC SC). Right now I am distributing an exe file, and also getting users to download a config file every time. I'd like to simplify this process so please if you have any ideas, do share.

Thanks a lot

Upvotes: 0

Views: 1348

Answers (2)

Dave Rager
Dave Rager

Reputation: 8160

You can do this but it's more work than it's worth if you've got the sources.

You could use a disassembler to find the resource (and it's binary offset within the file), then modify that resource with a binary editor. If you are hardcore, you could use bvi to do this. One thing to look out for, if you do edit the resource note that you cannot make the resource any larger or smaller than it is or you will break references for other resources.

That said, if you have the sources, just change the resource and rebuild and you won't have to worry about any of that.

If it's a configuration thing and you don't want to distribute a config file, standard practice seems to be to store your configuration in the registry and provide a nice UI under options or preferences to modify those configurations.

Upvotes: 2

Rob K
Rob K

Reputation: 8926

It's possible (anything's possible with enough effort) but that's horrible way to do what you're trying to achieve.

What you really want is an installer that will setup the program's configuration when the user installs it.

Upvotes: 2

Related Questions