Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4056356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:49:01+00:00 2026-05-20T14:49:01+00:00

In my code I tried to print the address of printf() function. 22834: ./a.out

  • 0

In my code I tried to print the address of printf() function.

22834:   ./a.out
00250000   1372K r-x--  /lib/libc-2.12.1.so
003a7000      8K r----  /lib/libc-2.12.1.so
003a9000      4K rw---  /lib/libc-2.12.1.so
003aa000     12K rw---    [ anon ]
00a14000    112K r-x--  /lib/ld-2.12.1.so
00a30000      4K r----  /lib/ld-2.12.1.so
00a31000      4K rw---  /lib/ld-2.12.1.so
00fb9000      4K r-x--    [ anon ]
08048000      4K r-x--  /home/anirudh/Documents/DUMP/a.out
08049000      4K r----  /home/anirudh/Documents/DUMP/a.out
0804a000      4K rw---  /home/anirudh/Documents/DUMP/a.out
08068000    132K rw---    [ anon ]
b7898000      4K rw---    [ anon ]
b78ac000      8K rw---    [ anon ]
bfc9a000    132K rw---    [ stack ]
 total     1808K

Address of the function "printf()" in HEX = 8048408

I was expecting its address to be a part of

00250000 1372K r-x-- /lib/libc-2.12.1.so
rather than as shown that its code is in this section
08048000 4K r-x-- /home/anirudh/Documents/DUMP/a.out i.e code segment of my code.

I even tried printing the address of a few more functions like getpid() and scanf() but they were all shown to be part of my program’s code segment rather than the libc-2.12.1.so

What is the reason for this ?. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:49:02+00:00Added an answer on May 20, 2026 at 2:49 pm

    Look at the code that is at the printf address; it is probably just an indirect jump or call that calls into libc. Typically, calls to shared libraries are turned into references to a dispatch function that is patched with (or looks up) the actual address where printf was loaded. If you run readelf -a on your executable and look for the address where you found printf, it will probably be marked as a relocation to be pointed to the actual address in libc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen some code such as: out.println(print something); I tried import java.lang.System; but it's
this code gives an instant seg fault,I tried placing printf's all over, I even
Today out of curiosity, i tried something very weird: The Code : int num
When I tried to focus on compiler in code, I made break point on
through jquery code i tried to add a new attribute called delaySrc to img
In my code i tried to connect signal from QTrayIcon object and my form
I tried below code but as I run it gives a black screen image
I tried this code to open a file in Python: f = open("/Desktop/temp/myfile.txt","file1") It
My code that I tried is as follows: var dataO = new Object(); dataO.numberId
i have tried this code to redirect a php page.but it s not working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.