Closed Toxenskiy closed 2 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".
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
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.
could you please share the source code of aio dream
you can take link video / guide how to add dll
Depends on what DLL you want to add and to what type, also depends on how you want the DLL to be included.
c#
well, you somehow added mandark to miners before
?
If you want the DLL to be loaded inside the C# program then you can load it via Assembly.Load.
Well, how to add dld to the final file exe?
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.
ok
do you have any code to load bytes and start build?
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.
I have dll included in the resources, but I do not know how to use it simply
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.
I do not add a link to the dll in the program.cs writes that it is not declared
?
How are you importing and using the DLL?
Via a link to the visual studio.
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.
Well, how to make a link for a finished file?
Then you'd have to load the DLL like normal and then use something like ILMerge to merge the DLL with the final exe.
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.
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
Can you throw off a lesson on ilmerge?
You can try the command:
ilmerge program.exe library.dll /out:mergedprogram.exe
ok
get download link ilmerge
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.
Where is the best place to upload files for download?
anonfiles in many countries on the black list
Yeah anonfiles don't have permanent direct download links which is why I say that you shouldn't use it for the downloader.
ok
?