This commit is contained in:
2026-01-08 19:16:57 +00:00
parent 555b9062f3
commit 82e15702a7
22 changed files with 376 additions and 0 deletions

27
pa/lab7/04_match_value.c Normal file
View File

@@ -0,0 +1,27 @@
// gcc -m32 -Wall -Wextra -ggdb -no-pie
#include <stdio.h>
#include <unistd.h>
#include "get_flag.h"
#define BUFFER_LEN 128
unsigned int target = 0;
void vuln() {
char buffer[BUFFER_LEN] = {0};
read(0, buffer, BUFFER_LEN-1);
printf(buffer);
if (target == 327) {
printf("Success! You hit the target!\n");
printf("Here is your flag: %s\n", get_flag());
} else {
printf("Oops, not quite! The target was: 327\nCurrent value is %d.\n", target);
}
}
int main() {
vuln();
}