Replace lines in native.exe using C #

how can I catch all the lines from my own .exe file of Windows and replace them later with others using C #?

Background: I want to create a C # tool to extract and replace strings from a simple .exe file.

Is it possible somehow?

+3
source share
3 answers

What you need to start with is the PE / COFF parser. If your lines are stored in the resource section in PE, then this is pretty easy. For example, you can load exe into Visual Studio as a resource file and use the resource editor to change icons and strings, etc. In exe. If, on the other hand, strings are stored in a data section or directly in machine codes, you have a much more complex problem. Rewriting strings as they are, leaving them the same length, will probably work, but making them start moving things longer, ruining permutations and shifts. Rewriting an exe is really not a way to achieve what you want.

: PE/COFF - exe. , . LoadLibraryEx() LOAD_LIBRARY_AS_IMAGE_RESOURCE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE, exe, . LoadString(). API. , #.

+3
+1

, . ++. - , aman.tur.

, , . , ( ), , . , , . , .

, (, 4 , \0). , .

, .

0

Source: https://habr.com/ru/post/1709384/


All Articles