What is% 0 |% 0 and how does it work?

If you run a .bat or .cmd file with %0|%0 inside, your computer starts to use a lot of memory and restarts after a few minutes. Why is this code blocking your Windows? And what does this code do programmatically? Can this be considered a "mistake"?

+59
command-line windows
Nov 18 '12 at
source share
4 answers

This is the Windows version of the side fork .

%0 is the name of the executable executable. A batch file containing only this line:

 %0|%0 

He is going to recursively execute himself forever, quickly create many processes and slow down the system.

This is not an error in windows, it is just a very stupid thing in a batch file.

+112
Nov 18
source share

This is known as a fork. It continues to separate until there is no choice but to restart the system. http://en.wikipedia.org/wiki/Fork_bomb

+36
Mar 28 '13 at 21:54
source share

What it is:

%0|%0 is the bomb plug . It will spawn another process using a pipe | , which starts a copy of the same program asynchronously. This causes the processor and memory to slow down the system until it almost stops (or even a system crash).

How it works:

%0 refers to the command used to start the current program. For example, script.bat

Pipe symbol | draws the output or result of the first sequence of commands as input to the second sequence of commands. In the case of the fork bomb, there is no way out, so it just launches the second command sequence without input.

Extending the example, %0|%0 could mean script.bat|script.bat . This starts again, but also creates another process to restart the same program (without input).

+15
Dec 14 '16 at 0:02
source share

This is a logical bomb, it recreates itself and takes on all the resources of your processor. It overloads your computer with too many processes, and it causes it to shut down. If you create a batch file with this in it and run it, you can end it with taskmgr. You have to do it pretty fast, or your computer will be too slow to do anything.

+6
Nov 28 '14 at 17:26
source share



All Articles