r/shittyprogramming • • Jun 11 '16

Next level antivirus software

http://stackoverflow.com/questions/37758482/can-i-get-sum-tips-on-making-an-antivirus-in-c-code-below
268 Upvotes

29 comments sorted by

48

u/tjugg Jun 11 '16

I know hes most likely a child and I this is wrong to laugh but.. Just check hes profile and other answers if you want to laugh. I think he might even actually just be trolling.

14

u/vimishor Jun 11 '16

Clearly this child has gone rogue and your mission, if you chose to accept it, is to serve him with a pthread_cancel. As usual, in case you get caught with a SEGFAULT, we will deny any implication.

8

u/Jaxkr Jun 11 '16

I wrote similar things when I was a kid. I wrote a "web spider" when I was 11 or 12 that literally just started on a website and requested every link then and downloaded their source (why). Then for each link it did the same.

Left it overnight and it downloaded like 35 GB of worthless data.

7

u/[deleted] Jun 11 '16

That's basically what web crawlers are basically supposed to do though.

3

u/Jaxkr Jun 11 '16

Yeah. But good ones don't click on everything because it'd grow too fast.

If one page has 15 links, and each of those have 15 links, and then those have 15 and so forth, after only 8 clicks away you'd have to to send 2562890625 requests.

1

u/ekolis Jun 15 '16

Did yours get into an endless loop?

4

u/Jaxkr Jun 15 '16

Probably. Didn't let it run two long. It didn't dl pages that it already had though.

7

u/myusernameisokay Jun 11 '16

I'd say he's a troll, his name is "CSharpPro" and his bio is "i love to program in c#. Im very knowledgeable in the .net framework. Post a question on c# and ill be on it!"

1

u/hukiki Jun 12 '16

Definitely troll

117

u/Jonno_FTW Jun 11 '16

You sure you didnt steal Avg's sources???

Amazing.

7

u/[deleted] Jun 11 '16

He's not wrong tho.

26

u/DrScabhands Jun 11 '16 edited Oct 21 '22

We’ve been trying to reach you about your car’s extended warranty

53

u/[deleted] Jun 11 '16

I'd start with the fact that this guy thinks C# and C++ source files are executable, and apparently doesn't know what C is

8

u/Poddster Jun 11 '16
  1. Move it to code review stack overflow

  2. Refactor the code block into a function and reduce the code size by a million as it's the same thing over and over again

25

u/[deleted] Jun 11 '16

File explorer.exe could be harmfull. Delete?

9

u/[deleted] Jun 11 '16

No one will explore this computer.

22

u/Websly Jun 11 '16

TotallyNotMalware.scr

13

u/Kilazur Jun 11 '16

RamMultiplier.txt.exe

5

u/scorcher24 Jun 11 '16

SteamAllGamesUnlocker.exe

13

u/Nulagrithom Jun 11 '16

Has to be a child.

11

u/louiswins Jun 11 '16

Username

CSharpPro

3

u/GMarthe Jun 11 '16

Hey guys, noob programmer here. Would any one try to explain to me what is so awful about this?

:-)

16

u/ase1590 Jun 11 '16 edited Jun 11 '16

I'm having difficulty telling if you're sarcastic or genuinely would like to know

Edit: in case you're curious, here's why this is bad:

What the programmer in the stackexchange did is basically make a program that looks for .exe's and says "this could be dangerous" when it presents the file. it has no way to tell if it's actually dangerous or not. this means that it could just show you explorer.exe, which is what allows your desktop to browse files on windows, as dangerous. So in its current form, its totally useless as a tool looking for threats.

Contrast this with how ClamAV, an open source virus scanner for email, works. I've extracted the contents of one of the daily updates form ClamAV's virus definition updates, and you can download and poke around it here. If you put any of those files inside the 7z archive into a text editor, you can see that the proper way to look for threats is to have some form of file hash to compare a threat against. (Look up MD5sum for an example of what hashing is. md5 is not used in this case, but is an example of hashing).

So for any remotely effective virus scanner, you will need to compare the hash of a file against the hash of a known threat to give a better idea of if the file is a threat or not. This means you either have to get that hash from someone else or actually have that virus on hand for analysis. More advanced antivirus solutions use heuristics to help attempt to detect new threats, which is basically a way for the antivirus to scan what commands a program is sending and attempt to tell if it's a risky system command.

5

u/miggyb Jun 11 '16

:-) is legit

:^) is cheeky

8

u/[deleted] Jun 11 '16

[removed] — view removed comment

1

u/Prawny Jun 11 '16

What's wrong with Avast?