GDB baby step 2
*  
reverse  
picoctf

Can you figure out what is in the eax register at the end of the main function? Put your answer in the picoCTF flag format: picoCTF{n} where n is the contents of the eax register in the decimal number base. If the answer was 0x11 your flag would be picoCTF{17}.
(gdb) disas main
Dump of assembler code for function main:
   0x0000000000401106 <+0>: endbr64 
   0x000000000040110a <+4>: push   %rbp
   0x000000000040110b <+5>: mov    %rsp,%rbp
   0x000000000040110e <+8>: mov    %edi,-0x14(%rbp)
   0x0000000000401111 <+11>: mov    %rsi,-0x20(%rbp)
   0x0000000000401115 <+15>: movl   $0x1e0da,-0x4(%rbp)
   0x000000000040111c <+22>: movl   $0x25f,-0xc(%rbp)
   0x0000000000401123 <+29>: movl   $0x0,-0x8(%rbp)
   0x000000000040112a <+36>: jmp    0x401136 <main+48>
   0x000000000040112c <+38>: mov    -0x8(%rbp),%eax
   0x000000000040112f <+41>: add    %eax,-0x4(%rbp)
   0x0000000000401132 <+44>: addl   $0x1,-0x8(%rbp)
   0x0000000000401136 <+48>: mov    -0x8(%rbp),%eax
   0x0000000000401139 <+51>: cmp    -0xc(%rbp),%eax
   0x000000000040113c <+54>: jl     0x40112c <main+38>
   0x000000000040113e <+56>: mov    -0x4(%rbp),%eax
   0x0000000000401141 <+59>: pop    %rbp
   0x0000000000401142 <+60>: ret    


To get the flag:
-I put a breakpoint at the end of the main function
(gdb) b *(main+59)
-I started the program
(gdb) run
Starting program: /home/cheepsss/Downloads/debugger0_b 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".


-I checked the registers
(gdb) info registers
rax            0x4af4b             307019
rbx            0x0                 0
rcx            0x401150            4198736
rdx            0x7fffffffdf58      140737488346968
rsi            0x7fffffffdf48      140737488346952
rdi            0x1                 1
rbp            0x7fffffffde30      0x7fffffffde30
rsp            0x7fffffffde30      0x7fffffffde30
r8             0x7ffff7e1bf10      140737352154896

picoCTF{307019}