1

I just made a small and simple windows form. I uploaded the .exe to mediafire so anyone could download it, but when someone(or even myself) tries to download it: windows defender instantly deletes it, because it thinks it is a virus. Is this a problem with the code or does it has to do with something else?

Aiko
  • 153
  • 2
  • 16
  • 1
    This is probably because the executable is from the internet and is not digitally signed. Have you tried to download it from another website? Maybe downloaded executables from Mediafire aren't really well seen. Seems weird but, could be a reason. Best way is still to digitally sign your apps, but its quite expensive for a "test app" indeed. – Hugo Regibo Oct 05 '17 at 12:56
  • It could just be a false positive. Try uploading and testing your .EXE at a virus scanning website like virustotal.com to see how it checks out. – Gordon Bell Oct 05 '17 at 12:56
  • I couldn't even upload it to virustotal it says it's a virus and can't be uploaded. – Aiko Oct 05 '17 at 13:07
  • You seriously over-estimate users' willingness to download exe files from a file sharing site. Especially mediafire, that site probably has a malware rule all by itself. Those days are over and will never come back, consider writing apps for the Store. – Hans Passant Oct 05 '17 at 13:07
  • So you say I shouldn't upload it to any file sharing site and just make an mobile app? – Aiko Oct 05 '17 at 13:08
  • If you want random people to use your executable, most certainly. – Pac0 Oct 05 '17 at 17:16
  • *"Is this a problem with the code or does it has to do with something else?"* What does your code look like? – Manfred Radlwimmer Oct 06 '17 at 11:09

1 Answers1

2

Hash it to check it was not modified

Check with some digest algorithm like SHA-2 that the file you download from the site is actually the exact same that you uploaded.

If it is not the same, something fishy has happened to your file when on a trip to the internet. I wouldn't try to open it, and try to find another service to host your file.

Sign your executable with a certificate

Invest in some code signing certificate.

Some are free, and for beginning and test pourposes you can create it yourself and self-sign it, but it will still be frowned upon by anti-malwares and your system.

Other comments

Also, some code operations are considered "dangerous" by some antivirus, because theese operations are much more oftne found in exploits attempts than in real commercial code. I remember, when I was playing with simple console C++ code while learning, I did some unsafe operation with a simple string char[]. On my school computer, the result executable was automatically deleted with the McAfee guard within seconds of compilation...

Pac0
  • 21,465
  • 8
  • 65
  • 74