diff options
| author | ov-4 <hausemasterstream@gmail.com> | 2026-01-08 06:27:45 +0000 |
|---|---|---|
| committer | ov-4 <hausemasterstream@gmail.com> | 2026-01-08 06:27:45 +0000 |
| commit | feebcb067d8061f165e08a351de66c78442aa118 (patch) | |
| tree | d7bba29f7bc9dba1b907834c396d49ff12cd20fd | |
| parent | a16a30af6285c559d94621d90d743df78bfaf960 (diff) | |
Bomb Lab initialization
| -rw-r--r-- | bomb.tar | bin | 0 -> 40960 bytes | |||
| -rw-r--r-- | bomb/README | 1 | ||||
| -rwxr-xr-x | bomb/bomb | bin | 0 -> 26406 bytes | |||
| -rw-r--r-- | bomb/bomb.c | 115 |
4 files changed, 116 insertions, 0 deletions
diff --git a/bomb.tar b/bomb.tar Binary files differnew file mode 100644 index 0000000..3d38d79 --- /dev/null +++ b/bomb.tar diff --git a/bomb/README b/bomb/README new file mode 100644 index 0000000..3a8ed77 --- /dev/null +++ b/bomb/README @@ -0,0 +1 @@ +This is an x86-64 bomb for self-study students. diff --git a/bomb/bomb b/bomb/bomb Binary files differnew file mode 100755 index 0000000..f59281d --- /dev/null +++ b/bomb/bomb diff --git a/bomb/bomb.c b/bomb/bomb.c new file mode 100644 index 0000000..5a39ab4 --- /dev/null +++ b/bomb/bomb.c @@ -0,0 +1,115 @@ +/*************************************************************************** + * Dr. Evil's Insidious Bomb, Version 1.1 + * Copyright 2011, Dr. Evil Incorporated. All rights reserved. + * + * LICENSE: + * + * Dr. Evil Incorporated (the PERPETRATOR) hereby grants you (the + * VICTIM) explicit permission to use this bomb (the BOMB). This is a + * time limited license, which expires on the death of the VICTIM. + * The PERPETRATOR takes no responsibility for damage, frustration, + * insanity, bug-eyes, carpal-tunnel syndrome, loss of sleep, or other + * harm to the VICTIM. Unless the PERPETRATOR wants to take credit, + * that is. The VICTIM may not distribute this bomb source code to + * any enemies of the PERPETRATOR. No VICTIM may debug, + * reverse-engineer, run "strings" on, decompile, decrypt, or use any + * other technique to gain knowledge of and defuse the BOMB. BOMB + * proof clothing may not be worn when handling this program. The + * PERPETRATOR will not apologize for the PERPETRATOR's poor sense of + * humor. This license is null and void where the BOMB is prohibited + * by law. + ***************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include "support.h" +#include "phases.h" + +/* + * Note to self: Remember to erase this file so my victims will have no + * idea what is going on, and so they will all blow up in a + * spectaculary fiendish explosion. -- Dr. Evil + */ + +FILE *infile; + +int main(int argc, char *argv[]) +{ + char *input; + + /* Note to self: remember to port this bomb to Windows and put a + * fantastic GUI on it. */ + + /* When run with no arguments, the bomb reads its input lines + * from standard input. */ + if (argc == 1) { + infile = stdin; + } + + /* When run with one argument <file>, the bomb reads from <file> + * until EOF, and then switches to standard input. Thus, as you + * defuse each phase, you can add its defusing string to <file> and + * avoid having to retype it. */ + else if (argc == 2) { + if (!(infile = fopen(argv[1], "r"))) { + printf("%s: Error: Couldn't open %s\n", argv[0], argv[1]); + exit(8); + } + } + + /* You can't call the bomb with more than 1 command line argument. */ + else { + printf("Usage: %s [<input_file>]\n", argv[0]); + exit(8); + } + + /* Do all sorts of secret stuff that makes the bomb harder to defuse. */ + initialize_bomb(); + + printf("Welcome to my fiendish little bomb. You have 6 phases with\n"); + printf("which to blow yourself up. Have a nice day!\n"); + + /* Hmm... Six phases must be more secure than one phase! */ + input = read_line(); /* Get input */ + phase_1(input); /* Run the phase */ + phase_defused(); /* Drat! They figured it out! + * Let me know how they did it. */ + printf("Phase 1 defused. How about the next one?\n"); + + /* The second phase is harder. No one will ever figure out + * how to defuse this... */ + input = read_line(); + phase_2(input); + phase_defused(); + printf("That's number 2. Keep going!\n"); + + /* I guess this is too easy so far. Some more complex code will + * confuse people. */ + input = read_line(); + phase_3(input); + phase_defused(); + printf("Halfway there!\n"); + + /* Oh yeah? Well, how good is your math? Try on this saucy problem! */ + input = read_line(); + phase_4(input); + phase_defused(); + printf("So you got that one. Try this one.\n"); + + /* Round and 'round in memory we go, where we stop, the bomb blows! */ + input = read_line(); + phase_5(input); + phase_defused(); + printf("Good work! On to the next...\n"); + + /* This phase will never be used, since no one will get past the + * earlier ones. But just in case, make this one extra hard. */ + input = read_line(); + phase_6(input); + phase_defused(); + + /* Wow, they got it! But isn't something... missing? Perhaps + * something they overlooked? Mua ha ha ha ha! */ + + return 0; +} |
