| 19 | "Welcome to stack-two brought to you by https://exploit.education" |
| 20 | |
| 21 | int main(int argc, char **argv) { |
| 22 | struct { |
| 23 | char buffer[64]; |
| 24 | volatile int changeme; |
| 25 | } locals; |
| 26 | |
| 27 | char *ptr; |
| 28 | |
| 29 | printf("%s\n", BANNER); |
| 30 | |
| 31 | ptr = getenv("ExploitEducation"); |
| 32 | if (ptr == NULL) { |
| 33 | errx(1, "please set the ExploitEducation environment variable"); |
| 34 | } |
| 35 | |
| 36 | locals.changeme = 0; |
| 37 | strcpy(locals.buffer, ptr); |
| 38 | |
| 39 | if (locals.changeme == 0x0d0a090a) { |
| 40 | puts("Well done, you have successfully set changeme to the correct value"); |
| 41 | } else { |
| 42 | printf("Almost! changeme is currently 0x%08x, we want 0x0d0a090a\n", |
| 43 | locals.changeme); |
| 44 | } |
| 45 | |
| 46 | exit(0); |
| 47 | } |
nothing calls this directly
no outgoing calls
no test coverage detected