# Patches
## Task
This binary does nothing.
File: patches
## Solution
This is not the intended solution. I was supposed to patch the binary. What I did was this:
```nasmgdb-peda$ info functionsAll defined functions:
Non-debugging symbols:0x0000000000001000  _init0x0000000000001030  puts@plt0x0000000000001040  __stack_chk_fail@plt0x0000000000001050  _start0x0000000000001261  print_flag0x00000000000012d9  main0x00000000000012f0  __libc_csu_init0x0000000000001360  __libc_csu_fini0x0000000000001368  _finigdb-peda$ disass mainDump of assembler code for function main:   0x00000000000012d9 <+0>:     push   rbp   0x00000000000012da <+1>:     mov    rbp,rsp   0x00000000000012dd <+4>:     lea    rdi,[rip+0xeac]        # 0x2190   0x00000000000012e4 <+11>:    call   0x1030 <puts@plt>   0x00000000000012e9 <+16>:    mov    eax,0x0   0x00000000000012ee <+21>:    pop    rbp   0x00000000000012ef <+22>:    retEnd of assembler dump.```
Expecting `print_flag` to do what it's name suggests I just set a breakpoint at the `ret` instruction and modified `rip`.
```nasmgdb-peda$ disass mainDump of assembler code for function main:   0x00005555555552d9 <+0>:     push   rbp   0x00005555555552da <+1>:     mov    rbp,rsp   0x00005555555552dd <+4>:     lea    rdi,[rip+0xeac]        # 0x555555556190   0x00005555555552e4 <+11>:    call   0x555555555030 <puts@plt>   0x00005555555552e9 <+16>:    mov    eax,0x0   0x00005555555552ee <+21>:    pop    rbp   0x00005555555552ef <+22>:    retgdb-peda$ b *0x00005555555552efBreakpoint 1 at 0x5555555552efgdb-peda$ rStarting program: patchesGoodbye.Breakpoint 1, 0x00005555555552ef in main ()gdb-peda$ info functions print_flagAll functions matching regular expression "print_flag":
Non-debugging symbols:0x0000555555555261  print_flaggdb-peda$ set $rip = 0x0000555555555261gdb-peda$ s0x0000555555555262 in print_flag ()gdb-peda$ cContinuing.nactf{unl0ck_s3cr3t_funct10n4l1ty_w1th_b1n4ry_p4tch1ng_L9fcKhyPupGVfCMZ}```
Insert shrug here.