GDB cannot access memory of the c library routine

-2

I have been trying to access the c library routine within memory but somehow, I'm restricted from reading the address at <main+84>

could someone tell me what is the problem?

here is my GDB command line

(gdb) disass main
Dump of assembler code for function main:
0x0000057d <+0>: lea 0x4(%esp),%ecx
0x00000581 <+4>: and $0xfffffff0,%esp
0x00000584 <+7>: pushl -0x4(%ecx)
0x00000587 <+10>: push %ebp
0x00000588 <+11>: mov %esp,%ebp
0x0000058a <+13>: push %ebx
0x0000058b <+14>: push %ecx
0x0000058c <+15>: sub $0x400,%esp
0x00000592 <+21>: call 0x480 <__x86.get_pc_thunk.bx>
0x00000597 <+26>: add $0x1a69,%ebx
0x0000059d <+32>: mov %ecx,%eax
0x0000059f <+34>: mov 0x4(%eax),%eax
0x000005a2 <+37>: add $0x4,%eax
0x000005a5 <+40>: mov (%eax),%eax
0x000005a7 <+42>: sub $0x8,%esp
0x000005aa <+45>: push %eax
0x000005ab <+46>: lea -0x408(%ebp),%eax
0x000005b1 <+52>: push %eax
0x000005b2 <+53>: call 0x400 <strcpy@plt>
0x000005b7 <+58>: add $0x10,%esp
0x000005ba <+61>: sub $0xc,%esp
0x000005bd <+64>: lea -0x408(%ebp),%eax
0x000005c3 <+70>: push %eax
0x000005c4 <+71>: call 0x3f0 <printf@plt>
0x000005c9 <+76>: add $0x10,%esp
0x000005cc <+79>: sub $0xc,%esp
0x000005cf <+82>: push $0xa
0x000005d1 <+84>: call 0x420 <putchar@plt>
0x000005d6 <+89>: add $0x10,%esp
0x000005d9 <+92>: mov $0x0,%eax
0x000005de <+97>: lea -0x8(%ebp),%esp
0x000005e1 <+100>: pop %ecx
0x000005e2 <+101>: pop %ebx
0x000005e3 <+102>: pop %ebp
0x000005e4 <+103>: lea -0x4(%ecx),%esp
0x000005e7 <+106>: ret 
End of assembler dump.
(gdb) x/1i 0x420
0x420 <putchar@plt>: jmp *0x18(%ebx)
(gdb) x/1x 0x18
0x18: Cannot access memory at address 0x18

Thank you!

c
debug
asked on Super User Sep 18, 2018 by (unknown user)

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0