I have a Delphi application that I cannot recompile.
In the process of moving the database to a new SQL Server version, I want to change the database password so it's no longer blank. The problem is that the application has the database credentials embedded in the .exe.
Is there any way that I can change the password?
Server name and database name are configurable.
If the connection string was saved in the TADOConnection
component in design mode, Your best choice is to use Resource editor such as Resource Hacker.
The forms or data modules DFM are found in the RCData
section. just change the connection string and use "Compile script".
This will save your changes back to the EXE file without the worry of corrupting the EXE.
I assume your EXE is not packed (PE packer) or digitally signed.
Below is a screenshot of part of a D7 .Exe of mine showing the relevant part of its Ado ConnectionString.
I used an antique file viewer (from the example apps accompanying an old TurboPower library) to take the screenshot. I just loaded the file into it, entered "persist" as the search string and skipped a couple of TPersistent instances to locate it.
Of course, you could use any old hex file-editor to do similar and change it, provided the .Exe isn't compressed or protected against tampering by checksums, etc.
You'll probably need to experiment a bit, & compare with another app which has a non-blank password so that you can come up with some new credentials that'll fit into the space available in the .Exe's disk image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With