Skip to content

Commit a5c6741

Browse files
committed
Comment out the 'call program' occurences
1 parent 4686c56 commit a5c6741

File tree

5 files changed

+38
-19
lines changed

5 files changed

+38
-19
lines changed

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Self-replicating, self-modifying Assembly program that can evolve into every pos
77
## Compiling & Running
88

99
> **CAUTION:** Since this program executes random CPU instructions, it might run potentialy harmful machine code of any kind.
10-
> The program runs its offsprings in multiple subprocesses and creates an ever growing tree of processes. Because of this,
11-
> it eventually freezes any machine that runs it. The reason for that is; it consumes all of the CPU resources and free memory.
10+
> **NOTICE:** Program execution is disabled temporarily. To re-enable it, remove `;` before the `call program` occurences in `ldca.asm` file.
1211
1312
Go into the directory that matches your operating system and CPU architecture combination. For example: `cd linux_x86`
1413

@@ -21,14 +20,35 @@ Go into the `outs/` directory and run it:
2120
```bash
2221
cd outs/
2322
./0000000000000000000000000000000000000000000000000
23+
cd ..
2424
```
2525

26-
After letting the descendants of this program live for a while you should be able to kill those processes
27-
by sending `SIGINT` signal (by pressing <kbd>CTRL + C</kbd>) It might even require you to physically
28-
restart your machine since your machine must be frozen at this point.
26+
Now you should be seeing these three binaries:
2927

30-
Go back into the parent directory of `outs/` and run `make diff` This command will show you the hex dump difference
31-
between all the descendants and the initial program `0000000000000000000000000000000000000000000000000`
28+
```bash
29+
$ ls outs/
30+
0000000000000000000000000000000000000000000000000
31+
0000000000000000000000000000000000000000000000001
32+
0000000000000000000000000000000000000000000000002
33+
```
34+
35+
that means it's replicated and created 2 offsprings.
36+
37+
Now you can run these commands sequentially to achieve the results shown in the animation at the top:
38+
39+
```bash
40+
clear
41+
make clean
42+
make
43+
make strace
44+
make diff
45+
```
46+
47+
or simply run:
48+
49+
```bash
50+
./dev.sh
51+
```
3252

3353
## Development
3454

linux_x86/0000000000000000000000000000000000000000000000000.xxd

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
00000000: 7f45 4c46 0101 0100 0000 0000 0000 0000 .ELF............
2-
00000010: 0200 0300 0100 0000 d003 0100 3400 0000 ............4...
2+
00000010: 0200 0300 0100 0000 c603 0100 3400 0000 ............4...
33
00000020: 0000 0000 0000 0000 3400 2000 0100 0000 ........4. .....
44
00000030: 0000 0000 0100 0000 0000 0000 0000 0100 ................
5-
00000040: 0000 0100 e203 0000 e203 0000 0700 0000 ................
5+
00000040: 0000 0100 d803 0000 d803 0000 0700 0000 ................
66
00000050: 0010 0000 3030 3030 3030 3030 3030 3030 ....000000000000
77
00000060: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
88
00000070: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
@@ -54,10 +54,9 @@
5454
00000350: 0f31 31d2 b964 0000 00f7 f189 d083 c000 .11..d..........
5555
00000360: 83f8 500f 8c60 ffff ff83 f855 7c9b ebc8 ..P..`.....U|...
5656
00000370: c3e8 daff ffff b805 0000 00e8 36ff ffff ............6...
57-
00000380: b941 0000 00ba ff01 0000 cd80 8d15 e203 .A..............
57+
00000380: b941 0000 00ba ff01 0000 cd80 8d15 d803 .A..............
5858
00000390: 0000 9391 b100 b004 cd80 b806 0000 00cd ................
59-
000003a0: 80c3 b300 b001 cd80 c3e8 d9fc ffff e8be ................
60-
000003b0: ffff ffe8 b9ff ffff c380 3831 74eb e8c4 ..........81t...
61-
000003c0: fcff ffc3 58e8 efff ffff e8d3 ffff ffc3 ....X...........
62-
000003d0: 5958 4983 f900 7fec e8cc ffff ffe8 c0ff YXI.............
63-
000003e0: ffff ..
59+
000003a0: 80c3 b300 b001 cd80 c3e8 c3ff ffff e8be ................
60+
000003b0: ffff ffc3 8038 3174 f0c3 58e8 f4ff ffff .....81t..X.....
61+
000003c0: e8dd ffff ffc3 5958 4983 f900 7fec e8d6 ......YXI.......
62+
000003d0: ffff ffe8 caff ffff ........

linux_x86/ldca.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ exit: mov bl, 0 ; 0 = Exit code
166166
int 0x80 ; sys_exit(0)
167167
ret
168168

169-
with_replicate: call program
169+
with_replicate: ; call program
170170
call replicate ; replicate subroutine must not fail!
171171
call replicate ; replicate subroutine must not fail!
172172
ret
173173

174174
replicate_if: cmp byte [eax], 49 ; compare the first command-line argument to '1'
175175
jz with_replicate ; replicate if the argument is '1'
176-
call program
176+
; call program
177177
ret
178178

179179
args: pop eax ; this subroutines runs only if an argument is supplied

linux_x86/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
cd outs/
44

5-
for i in {0000000000000000000000000000000000000000000000000..0000000000000000000000000000000000000000000001000}; do
5+
for i in {0000000000000000000000000000000000000000000000000..0000000000000000000000000000000000000000000005000}; do
66
./$i
77
done

linux_x86/strace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
cd outs/
44

5-
for i in {0000000000000000000000000000000000000000000000000..0000000000000000000000000000000000000000000001000}; do
5+
for i in {0000000000000000000000000000000000000000000000000..0000000000000000000000000000000000000000000005000}; do
66
strace ./$i
77
done

0 commit comments

Comments
 (0)