Home > database >  how to find address of string in binary in gdb?
how to find address of string in binary in gdb?

Time:09-17

So here is the source code of the binary:

#include<stdio.h>

int main(){
printf("Hello World\n");
return 0;
}

and below is the compilation of this source code:

@CTOS:/tmp/mytemp$ gcc helloWorld.c -o helloWorld

Now when I disassemble my binary in gdb as below:

Reading symbols from helloWorld...
(No debugging symbols found in helloWorld)
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000000000001149 < 0>:     endbr64 
   0x000000000000114d < 4>:     push   %rbp
   0x000000000000114e < 5>:     mov    %rsp,%rbp
   0x0000000000001151 < 8>:     lea    0xeac(%rip),%rax     
   0x0000000000001158 < 15>:    mov    %rax,%rdi
   0x000000000000115b < 18>:    call   0x1050 <puts@plt>
   0x0000000000001160 < 23>:    mov    $0x0,           
  • Related