J
J
JewrySoft2020-06-17 07:06:25
C++ / C#
JewrySoft, 2020-06-17 07:06:25

How to add bytes to one array?

I am writing a joiner, or in simple words - a file gluer.

byte[] bytes = File.ReadAllBytes(metroTextBox1.Text);
            byte[] bytes2 = File.ReadAllBytes(metroTextBox2.Text);

            File.Create("build.exe").Close();
            File.WriteAllBytes("build.exe", bytes);
            File.WriteAllBytes("build.exe", bytes2);

            MessageBox.Show("File successfully joined!", "Simple Joiner", MessageBoxButtons.OK);

Here is my design. It was necessary for me that from two textboxes (there are paths to files), bytes were written from files, and added to a large array. And then, I would create a file and write this array. Please help, I've wanted to do this for a long time, but it didn't work ((

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
HemulGM, 2020-06-17
@JewrySoft

To combine two exe (or more), you need to place the target exe in the resources of the destination exe and place them in RAM using the manual map method, then run them through CreateThread.
And simply by combining two files into one, you will either get a broken file or only the first exe will work.

D
Dr. Bacon, 2020-06-17
@bacon

It was explained to you in the last question that you can’t just merge two exe and get a new one that works.
Threat and everything is clear who you are, looked at the whole story.

F
freeExec, 2020-06-17
@freeExec

It's easier on the command line
copy build_one.exe+build_two.exe build.exe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question