Is it possible to store files in an executable?

Asked

Viewed 195 times

2

I need to store a file, no matter its extension (it’s mainly an Executable) within another executable.

It’s just, I’m compiling with Codedom an executable that inside it there is a file "special" and encrypted, when executing the executable all magic is done. But the problem with this magic is the way I’m saving bytes of the magic archive m within the executable x.

I want to put the bytes in the file m inside the archive x literally.

I did the following, in the pre-Compiler, I made a method static which already automatically returns the file bytes m, but to have done so, it was necessary to insert byte per byte within the code, I did a huge scam to do this, but it worked. For example, I wrote a program of Hello World in C# and took the bytes of this file and compiled inside another executable, like a container of files.

When I decompiled the output executable, I got a huge list of encrypted bytes, and I’m not sure that’s good practice. Follow the image of how it looked:

inserir a descrição da imagem aqui

It’s kind of a constant thing, no?

Summary of the question

I wonder, if there is any way to implement bytes of a file without using literal values, or not declaring a variable to store huge amounts of bytes, as I did in the example above.

If you can’t do that, those lists have limits on how many bytes I can put in them?

To get an idea, that method returned about 200MB.

  • Interesting fact: Why do you want to ship a file inside a executable? What problem are you trying to solve with this?

  • I am creating a way to place an encrypted executable inside the executable container, when running the file, the original executable is decrypted and runs. It’s a decompile bypass strategy.

  • But for this there is the technique of obfuscation. Does not meet?

  • Not exactly. Because I need to create an instance of Assembly container.

1 answer

1

  • I don’t want to exactly make a file Packer, but store only the bytes of one, but in a way that doesn’t need to create literal code for it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.