Add linux_intro presentation
This commit is contained in:
1
assets/bof/logic/.gitignore
vendored
Normal file
1
assets/bof/logic/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
logic
|
16
assets/bof/logic/Makefile
Normal file
16
assets/bof/logic/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
# use bash so process substutution is available
|
||||
CC = gcc
|
||||
CFLAGS = -fno-stack-protector -g
|
||||
SHELL = bash
|
||||
SRC = logic.c
|
||||
TARGET = $(SRC:%.c=%)
|
||||
|
||||
.PHONY: build
|
||||
build: $(TARGET)
|
||||
|
||||
%: %.c
|
||||
$(CC) ${CFLAGS} $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f logic
|
21
assets/bof/logic/logic.c
Normal file
21
assets/bof/logic/logic.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include<stdio.h>
|
||||
#include<string.h>
|
||||
|
||||
void foo(char *input) {
|
||||
int is_logged_in = 0;
|
||||
char buf[64];
|
||||
strcpy(buf, input);
|
||||
if (is_logged_in) {
|
||||
puts("logged in!!1!");
|
||||
} else {
|
||||
puts("not logged in");
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
return 1;
|
||||
}
|
||||
foo(argv[1]);
|
||||
return 0;
|
||||
}
|
8
assets/bof/logic/solution.md
Normal file
8
assets/bof/logic/solution.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Beispiel 1
|
||||
|
||||
* Debugger `gdb`
|
||||
* `list` für Code
|
||||
* `break <n>` für Breakpoint
|
||||
* `run $(python -c 'print("A"*77)')`
|
||||
* `show is_logged_in`
|
||||
* `continue`
|
Reference in New Issue
Block a user