UnamSanctam / UnamDownloader

A Free Silent (Hidden) Open Source Downloader (Binder) - Includes Windows Defender Bypass - Build Native - Unam Downloader
MIT License
174 stars 56 forks source link

how to add your own DLL for use in the final Downloader #3

Closed Toxenskiy closed 2 years ago

Toxenskiy commented 3 years ago

?

UnamSanctam commented 3 years ago

A DLL? The downloader downloads a file and alternatively executes it if chosen. If you just want to add a DLL that some exe or something is going to use then just add the DLL file and then disable "Execute file".

Toxenskiy commented 3 years ago

no, I want to add a check function for something in the project and for this I need a dll and this check will be in the final downloader

UnamSanctam commented 3 years ago

You want to add a DLL to the downloader itself? If you want to do that in the native C build then you'll have to use definition files and add it in the way specified here https://github.com/TinyCC/tinycc/blob/dda95e9b0b30771369efe66b4a47e94cf0ca7dc0/win32/tcc-win32.txt#L64. If you want to add that to the .NET C# build then you'd have to add it like any other DLL file and then either ship the DLL file with the downloader or you'd have to merge it like any other program with ILMerge or something similar.

Toxenskiy commented 3 years ago

could you please share the source code of aio dream

UnamSanctam commented 3 years ago

https://github.com/Paskowsky/Dream-AIO

Toxenskiy commented 3 years ago

you can take link video / guide how to add dll

UnamSanctam commented 3 years ago

Depends on what DLL you want to add and to what type, also depends on how you want the DLL to be included.

Toxenskiy commented 3 years ago

c#

Toxenskiy commented 3 years ago

well, you somehow added mandark to miners before

Toxenskiy commented 3 years ago

?

UnamSanctam commented 3 years ago

If you want the DLL to be loaded inside the C# program then you can load it via Assembly.Load.

Toxenskiy commented 3 years ago

Well, how to add dld to the final file exe?

UnamSanctam commented 3 years ago

Depends on how you load it, normally DLL files are just shipped together with the exe in the same folder since that is how it's supposed to work. But you can either include the DLL bytes inside the exe in any way like as a resource or as maybe a byte array if you replace it before it's compiled, then when the program is started you can perform Assembly.Load on the bytes to call a function inside the DLL. Other than that you can also load the DLL like normal but merge it into the exe with something like ILMerge.

Toxenskiy commented 3 years ago

ok

Toxenskiy commented 3 years ago

do you have any code to load bytes and start build?

UnamSanctam commented 3 years ago

If you want to load the bytes directly into the code without using a resource then you'd have to find a good way to do that. The easiest way is to convert it to base64 and include that but that will increase the file size by a lot. If you want to you might be able to change the code bytes to hexadecimal and include that into a byte array, you could try https://stackoverflow.com/questions/311165/how-do-you-convert-a-byte-array-to-a-hexadecimal-string-and-vice-versa/24343727#24343727.

Toxenskiy commented 3 years ago

I have dll included in the resources, but I do not know how to use it simply

UnamSanctam commented 3 years ago

You can get it from the resources and use Assembly.Load on it like I do in the miner loader, https://github.com/UnamSanctam/SilentXMRMiner/blob/0b91bfd65959314c4ff36b209041e3bf26d2b7c2/SilentXMRMiner/Resources/Loader.cs#L77. Though keep in mind that Assembly.Load tends to get detected by antiviruses even if it's not malicious, or even just normal C# files as well tend to get detected to be honest.

Toxenskiy commented 3 years ago

I do not add a link to the dll in the program.cs writes that it is not declared

Toxenskiy commented 3 years ago

?

UnamSanctam commented 3 years ago

How are you importing and using the DLL?

Toxenskiy commented 3 years ago

Via a link to the visual studio.

UnamSanctam commented 3 years ago

If you just link it then you'd need to place the DLL in the same folder as the program. And even then it wouldn't get referenced inside the build you create but only the builder.

Toxenskiy commented 3 years ago

Well, how to make a link for a finished file?

UnamSanctam commented 3 years ago

Then you'd have to load the DLL like normal and then use something like ILMerge to merge the DLL with the final exe.

Toxenskiy commented 3 years ago

could not find the type or namespace name (missing a derivative or assembly reference) error. I added the dll to the reference and to the folder with the resulting file.

UnamSanctam commented 3 years ago

How did you add to refrences? If using codedom then you have to reference it in the built file: https://github.com/UnamSanctam/UnamDownloader/blob/49aa98cdc3da88aa2ecfd7e011d82fe2d3630a4c/UnamDownloader/Builder.cs#L55

Toxenskiy commented 3 years ago

Can you throw off a lesson on ilmerge?

UnamSanctam commented 3 years ago

You can try the command: ilmerge program.exe library.dll /out:mergedprogram.exe

Toxenskiy commented 3 years ago

ok

Toxenskiy commented 3 years ago

get download link ilmerge

UnamSanctam commented 3 years ago

Since ILMerge is deprecated and no longer developed it can be hard to find but here is the archived GitHub, https://github.com/dotnet/ILMerge. You'll probably have to download the code and build it yourself.

Toxenskiy commented 3 years ago

Where is the best place to upload files for download?

UnamSanctam commented 3 years ago

https://github.com/UnamSanctam/UnamDownloader/issues/2

Toxenskiy commented 3 years ago

anonfiles in many countries on the black list

UnamSanctam commented 3 years ago

Yeah anonfiles don't have permanent direct download links which is why I say that you shouldn't use it for the downloader.

Toxenskiy commented 3 years ago

ok