├── anti ├── 1 ├── 2 ├── 3 ├── ptrace ├── sigtrap ├── static ├── fakemain ├── nostrings ├── stripped ├── instructions ├── Makefile ├── 1.c ├── 3.c ├── 2.c ├── ptrace.c ├── instructions.c ├── nostrings.c ├── sigtrap.c └── fakemain.c ├── other ├── 1 ├── 2 └── 3 ├── re.pdf ├── codes ├── if ├── args ├── if_32 ├── loop ├── stack ├── args_32 ├── function ├── loop_32 ├── sections ├── stack_32 ├── function_32 ├── sections_32 ├── function.c ├── stack.c ├── if.c ├── sections.c ├── Makefile ├── loop.c └── args.c ├── crackmes ├── r100 ├── re20 ├── re30 ├── re50 ├── bomblab ├── crackme ├── neophyte ├── re0x02 ├── re0x03 ├── crackme0x00 └── order.txt ├── LICENSE └── readme.md /anti/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/1 -------------------------------------------------------------------------------- /anti/2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/2 -------------------------------------------------------------------------------- /anti/3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/3 -------------------------------------------------------------------------------- /other/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/other/1 -------------------------------------------------------------------------------- /other/2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/other/2 -------------------------------------------------------------------------------- /other/3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/other/3 -------------------------------------------------------------------------------- /re.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/re.pdf -------------------------------------------------------------------------------- /codes/if: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/if -------------------------------------------------------------------------------- /anti/ptrace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/ptrace -------------------------------------------------------------------------------- /anti/sigtrap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/sigtrap -------------------------------------------------------------------------------- /anti/static: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/static -------------------------------------------------------------------------------- /codes/args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/args -------------------------------------------------------------------------------- /codes/if_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/if_32 -------------------------------------------------------------------------------- /codes/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/loop -------------------------------------------------------------------------------- /codes/stack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/stack -------------------------------------------------------------------------------- /anti/fakemain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/fakemain -------------------------------------------------------------------------------- /anti/nostrings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/nostrings -------------------------------------------------------------------------------- /anti/stripped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/stripped -------------------------------------------------------------------------------- /codes/args_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/args_32 -------------------------------------------------------------------------------- /codes/function: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/function -------------------------------------------------------------------------------- /codes/loop_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/loop_32 -------------------------------------------------------------------------------- /codes/sections: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/sections -------------------------------------------------------------------------------- /codes/stack_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/stack_32 -------------------------------------------------------------------------------- /crackmes/r100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/r100 -------------------------------------------------------------------------------- /crackmes/re20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/re20 -------------------------------------------------------------------------------- /crackmes/re30: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/re30 -------------------------------------------------------------------------------- /crackmes/re50: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/re50 -------------------------------------------------------------------------------- /anti/instructions: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/anti/instructions -------------------------------------------------------------------------------- /codes/function_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/function_32 -------------------------------------------------------------------------------- /codes/sections_32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/codes/sections_32 -------------------------------------------------------------------------------- /crackmes/bomblab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/bomblab -------------------------------------------------------------------------------- /crackmes/crackme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/crackme -------------------------------------------------------------------------------- /crackmes/neophyte: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/neophyte -------------------------------------------------------------------------------- /crackmes/re0x02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/re0x02 -------------------------------------------------------------------------------- /crackmes/re0x03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/re0x03 -------------------------------------------------------------------------------- /crackmes/crackme0x00: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lkw657/reversing_slides/HEAD/crackmes/crackme0x00 -------------------------------------------------------------------------------- /codes/function.c: -------------------------------------------------------------------------------- 1 | int addNums(int a, int b, int c) { 2 | int local1 = 2; 3 | int local2 = 3; 4 | return a+b+c + local1 + local2; 5 | } 6 | 7 | int main() { 8 | addNums(1,2,3); 9 | } 10 | -------------------------------------------------------------------------------- /codes/stack.c: -------------------------------------------------------------------------------- 1 | void test(int a, char b, long c) { 2 | long d; 3 | int e; 4 | char f; 5 | return; 6 | } 7 | 8 | int main(int argc, char** argv) { 9 | test(1234, 'a', 9876); 10 | } 11 | -------------------------------------------------------------------------------- /crackmes/order.txt: -------------------------------------------------------------------------------- 1 | From what I remember when I did them, I think this could be a good order to attempt them in 2 | 3 | crackme0x00 4 | re0x02 5 | re20 6 | re0x03 7 | re50 8 | re30 9 | r100 10 | neophite 11 | -------------------------------------------------------------------------------- /codes/if.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | int a = 1; 5 | int b = 2; 6 | 7 | if (a == b) { 8 | puts("true"); 9 | } 10 | 11 | if (a == b) { 12 | puts("true"); 13 | } 14 | else { 15 | puts("false"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codes/sections.c: -------------------------------------------------------------------------------- 1 | int a = 1; // data 2 | int b; // bss 3 | char str[5]; // bss 4 | 5 | int main(int argc, char **argv) { 6 | char str2[10]; // stack 7 | char str3[] = "abcdef"; // data or stack? 8 | int i = 0; // stack 9 | for (;i<4;i++) { 10 | char c = str3[i]; // stack 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /codes/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | sources = $(wildcard *.c) 4 | binaries = $(basename $(sources)) 5 | binaries32 = $(addsuffix _32, $(binaries)) 6 | 7 | all: $(binaries) $(binaries32) 8 | 9 | $(binaries): 10 | gcc $@.c -o $@ 11 | 12 | $(binaries32): 13 | gcc $(subst _32,,$@).c -m32 -o $@ 14 | 15 | .PHONY : clean 16 | clean: 17 | rm $(binaries) $(binaries32) 18 | -------------------------------------------------------------------------------- /anti/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | binaries = 1 2 3 fakemain stripped static nostrings ptrace sigtrap instructions 4 | 5 | all: $(binaries) 6 | 7 | instructions: 8 | gcc $@.c -masm=intel -o $@ 9 | 10 | 1 2 3 fakemain ptrace sigtrap: 11 | gcc $@.c -o $@ 12 | 13 | stripped: 14 | gcc -s -fvisibility=hidden 2.c -o $@ 15 | 16 | static: 17 | musl-gcc -static 2.c -o $@ 18 | 19 | staticStripped nostrings: 20 | musl-gcc -s -fvisibility=hidden -static 2.c -o $@ 21 | 22 | .PHONY : clean 23 | clean: 24 | rm $(binaries) 25 | -------------------------------------------------------------------------------- /codes/loop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | int arr[] = {1,2,3,4,5,6,7,8,9,10}; 5 | int len = sizeof(arr)/sizeof(int); 6 | for (int i=0; i < len; i++) { 7 | printf("%d ", arr[i]); 8 | } 9 | puts(""); 10 | // another way of looping, using pointer maths 11 | // Note: to the c comiler arrays aren't quite pointers 12 | // The main difference is that the an address stored in an array variable can't be changed 13 | for (int *a = arr; a < arr+len; a++) { 14 | printf("%d ", *a); 15 | } 16 | puts(""); 17 | } 18 | -------------------------------------------------------------------------------- /anti/1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | char password[] = "password"; 6 | 7 | bool testPassword(char* attempt) { 8 | return strcmp(attempt, password) == 0; 9 | } 10 | 11 | int main(int argc, char** argv) { 12 | printf("Enter password: "); 13 | 14 | char buff[200]; 15 | fgets(buff, sizeof(buff), stdin); // get input 16 | buff[strlen(buff) - 1] = '\0'; // remove the newline 17 | 18 | if (testPassword(buff)) { 19 | puts("You win!"); 20 | } 21 | else { 22 | puts("You fail"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /codes/args.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | char password[] = "password"; 7 | 8 | bool testPassword(char* attempt) { 9 | return strcmp(attempt, password) == 0; 10 | } 11 | 12 | int main(int argc, char** argv) { 13 | if (argc != 2) { 14 | puts("Give the password as a command line argument"); 15 | exit(EXIT_FAILURE); 16 | } 17 | if (testPassword(argv[1])) { // 0 is name of program/command 18 | puts("You win!"); 19 | } 20 | else { 21 | puts("You fail"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /anti/3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void decStr(char* str) { 6 | int len = strlen(str); 7 | for (int i=0; i 2 | #include 3 | #include 4 | 5 | bool testPassword(char* attempt) { 6 | if (strlen(attempt) != 8) 7 | return false; 8 | if (attempt[0] != 'p') 9 | return false; 10 | if (attempt[1] != 'a') 11 | return false; 12 | if (attempt[2] != 's') 13 | return false; 14 | if (attempt[3] != 's') 15 | return false; 16 | if (attempt[4] != 'w') 17 | return false; 18 | if (attempt[5] != 'o') 19 | return false; 20 | if (attempt[6] != 'r') 21 | return false; 22 | if (attempt[7] != 'd') 23 | return false; 24 | return true; 25 | } 26 | 27 | int main(int argc, char** argv) { 28 | printf("Enter password: "); 29 | fflush(stdout); 30 | 31 | char buff[200]; 32 | fgets(buff, sizeof(buff), stdin); // get input 33 | buff[strlen(buff) - 1] = '\0'; // remove the newline 34 | 35 | if (testPassword(buff)) { 36 | puts("You win!"); 37 | } 38 | else { 39 | puts("You fail"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /anti/ptrace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void decStr(char* str) { 8 | int len = strlen(str); 9 | for (int i=0; i 2 | #include 3 | #include 4 | 5 | void decStr(char* str) { 6 | int len = strlen(str); 7 | for (int i=0; i 2 | #include 3 | #include 4 | 5 | void decStr(char* str) { 6 | int len = strlen(str); 7 | for (int i=0; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void decStr(char* str) { 9 | int len = strlen(str); 10 | for (int i=0; i 2 | #include 3 | #include 4 | #include 5 | 6 | void decStr(char* str) { 7 | int len = strlen(str); 8 | for (int i=0; i=0) [here](https://leanpub.com/anti-reverse-engineering-linux) 28 | 29 | 30 | --------------------------------------------------------------------------------