Hack Forums
[C#] How do I Inject Settings Into An EXE File? - 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#] How do I Inject Settings Into An EXE File? (/showthread.php?tid=5948647)



How do I Inject Settings Into An EXE File? - VelvetCoding - Mar 8, 2019

I'm currently building a rat in C#, however I have ran into one major issue. How the hell can I inject settings into an already compiled exe file? I have seen many people saying don't use EOF. So now I'm sitting here clueless to how to fix this issue. Is there another method of doing this that I don't know?


RE: How do I Inject Settings Into An EXE File? - Vuln - Mar 8, 2019

There's several of ways to do that. But if you have access to the source then you could also modify a source file programmatically before compiling it on the fly. You can use CodeDOM for that.


RE: How do I Inject Settings Into An EXE File? - gigajew - Mar 8, 2019

This is one way: https://hackforums.net/showthread.php?tid=5944333


And yet another way is reflecting the module with dnlib and changing the variables. This is the most reliable way


RE: How do I Inject Settings Into An EXE File? - SoonTM - Mar 8, 2019

Check out dnlib (github.com/0xd4d/dnlib). You can easily modify compiled .net applications with it.

Heres an example: github.com/Rottweiler/AdvancedBuilder


RE: How do I Inject Settings Into An EXE File? - VelvetCoding - Mar 9, 2019

(Mar 8, 2019 11:50 PM)SoonTM Wrote:  Check out dnlib (Can't post links). You can easily modify compiled .net applications with it.

Heres an example: (Can't post links)

(Mar 8, 2019 04:23 PM)gigajew Wrote:  This is one way: (Can't post links)


And yet another way is reflecting the module with dnlib and changing the variables. This is the most reliable way

Thank you both for the suggestion. The issue is resolved. I didn't even know dnlib existed. I ended up developing a class with dnlib that changes the variables of the stub, you guys are legend!  🤝


RE: How do I Inject Settings Into An EXE File? - SoonTM - Mar 9, 2019

(Mar 9, 2019 03:30 PM)VelvetCoding Wrote:  Thank you both for the suggestion. The issue is resolved. I didn't even know dnlib existed. I ended up developing a class with dnlib that changes the variables of the stub, you guys are legend!  🤝

No problem. Good luck with your project. ✌