![]() |
|
[C#] Open Executable, Modify Text, Save It [C#] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Open Executable, Modify Text, Save It [C#] (/showthread.php?tid=5944333) |
Open Executable, Modify Text, Save It [C#] - FarosMoloko - Feb 23, 2019 I am currently doing this:
In C#, I'm doing this: ![]() In terms of saving the exe, it works, but it doesn't modify the text inside using the regex. It's the same EXE as the one I import. I've checked "newContents" and the string itself has replaced the old text. Thanks! 🤝 RE: Open Executable, Modify Text, Save It [C#] - HFDone - Feb 23, 2019 readalltext > replace > writealltext RE: Open Executable, Modify Text, Save It [C#] - FarosMoloko - Feb 23, 2019 (Feb 23, 2019 03:00 PM)HFDone Wrote: readalltext > replace > writealltext Tried this at the start but this doesn't work. It makes the file size x2 and corrupts the exe. RE: Open Executable, Modify Text, Save It [C#] - gigajew - Feb 23, 2019 It's because of your encoding conversion going on behind the scenes. Here's a solution: RE: Open Executable, Modify Text, Save It [C#] - HFDone - Feb 23, 2019 you cant replace the text with larger string b4 you compile it put string length that you need to replace delete the file b4 you save the replaced file RE: Open Executable, Modify Text, Save It [C#] - FarosMoloko - Feb 23, 2019 (Feb 23, 2019 03:34 PM)gigajew Wrote: It's because of your encoding conversion going on behind the scenes. Here's a solution: Cheers mate. Sent you $15 🤝
RE: Open Executable, Modify Text, Save It [C#] - gigajew - Feb 23, 2019 Thanks that's very much appreciated RE: Open Executable, Modify Text, Save It [C#] - Effexion - Feb 23, 2019 (Feb 23, 2019 05:13 PM)FarosMoloko Wrote: Cheers mate. That was really good of you, man. I am glad you got a solution too. RE: Open Executable, Modify Text, Save It [C#] - gigajew - Feb 24, 2019 Here's a more reliable method of checking the encoding of the file (using it's BOM header if it has one) |