They open your binary in a "disassembler" (IDA or so), run the program until it it does the password request - then they look for a simple "jump equal" or "jump not equal" instruction (je/jne) and switch them.The binary would then accept every WRONG password but not the right one.
If you talked about a encrypted data file (so content of the file is "scrambled" with your password) then you cannot "hack" the program to auto-decrypt it. The user enters a password and the app decrypts the data ... it either does it blindly to not give a clue ("whatever is decrypted is then used") or it has some data in the package which it then must be able to "read" (else the password was not correct).The binary would not contain a password to "compare" - so you cannot extract stuff.
it sounds easy, but is it so easy in reality ?
what if the password is not stored in the executable but is also encrypted in the binary file, and the executable only contains the algorithm to encrypt/decrypt the password (and the datas) ?
As soon as you store the password in a file or so, there will be a way to read the password.
of course there will be a way to read it, but if the password is obfuscated with a custom algorithm, the person who tries to use it to open the program won't know what is the normal password (not obfuscated)and i don't see how somebody can extract a custom algorithm from an executable...
So as soon as your application processes something the hacker does not have to enter ("manually entered password") they will be able to read it out.