MCPcopy Create free account
hub / github.com/Crypto-Cat/CTF / main

Function main

pwn/exploit_education/phoenix/stack/2-stack/stack_overwrite-env.c:21–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 "Welcome to stack-two brought to you by https://exploit.education"
20
21int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected