S
S
sergeevpetro2018-03-06 00:00:21
C++ / C#
sergeevpetro, 2018-03-06 00:00:21

How to add data to one exe using another exe?

SUBJECT.
It is necessary to write data by one application to another application, and then so that the second application can read this data at startup.
Please provide examples in C#.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
F
freeExec, 2018-03-06
@sergeevpetro

Smoke manuals on the PE (Portable Executable) header , add a new data section to the file, profit.
But as already noted, any antivirus heuristic will give you a hand for this. Although if you create a reserved section there in advance of 1Mb or as much as you need there and just fill them with data, it will probably work.

C
cicatrix, 2018-03-06
@cicatrix

For Windows, saving data (when programs do not work simultaneously):
1. File system
2. Database
3. Registry (in Windows)
When working simultaneously (in Windows), you can use the following channels:
1. Named pipes (Named pipes)
2. Messages Windows (Messages)
3. TCP/IP socket
4. Shared memory

A
Anton, 2018-03-06
Reytarovsky @Antonchik

Write to a file, and when another application starts, read this file

E
eRKa, 2018-03-06
@kttotto

It is better not to add anything, but to have one resource shared by both programs. As an option - a common data file.
But if, nevertheless, there is a real need to pervert and if we talk about windows forms, then it has a resource file that stores its data in xml and which is usually used as a configuration file for launching an application, for example, for localizing an application. Now, if you can access this file from another application, you can read it and correct it as you need, link . There are plenty of examples in C# on how to read xml and how to write to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question