목록hitcon_training (5)
ghkdtlwns987
#include #include #include #include #include using namespace std; char nameofzoo[100]; class Animal { public : Animal(){ memset(name,0,24); weight = 0; } virtual void speak(){;} virtual void info(){;} protected : char name[24]; int weight; }; class Dog : public Animal{ public : Dog(string str,int w){ strcpy(name,str.c_str()); weight = w ; } virtual void speak(){ cout
from pwn import* context(arch='amd64',os='linux') context.log_level = 'debug' context.terminal = ['tmux','splitw','-h'] r = process('./magicheap') elf = ELF('./magicheap') def info_log(): log.info('create_heap : main + 173') log.info('edit_heap : main + 185') log.info('delete_heap : main + 197') log.info('heaparray : 0x6020e0') pause() def create(size,content): log.info('create') r.sendlineafter..
#include #include #include void read_input(char *buf,size_t size){ int ret ; ret = read(0,buf,size); if(ret content = (char *)malloc(size); if(!heaparray[i]->content){ puts("Allocate Error"); exit(2); } heaparray[i]->size = size ; printf("Content of heap:"); read_input(heaparray[i]->content,size); puts("SuccessFul"); break ; } } } void edit_heap(){ int idx ; char buf[4]; printf("Index :"); read(..
#include #include #include #include #include #include #include #include #define TIMEOUT 60 struct flower{ int vaild ; char *name ; char color[24] ; }; struct flower* flowerlist[100] ; unsigned int flowercount = 0 ; void menu(){ puts(""); puts("☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ "); puts("☆ Baby Secret Garden ☆ "); puts("☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ "); puts(""); puts(" 1 . Raise a flower..
#include #include #include #include #include #include struct item{ int size ; char *name ; }; struct item itemlist[100] = {0}; int num ; void hello_message(){ puts("There is a box with magic"); puts("what do you want to do in the box"); } void goodbye_message(){ puts("See you next time"); puts("Thanks you"); } struct box{ void (*hello_message)(); void (*goodbye_message)(); }; void menu(){ puts("..