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 9187037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:40:32+00:00 2026-06-17T19:40:32+00:00

Here are two lines of a binary I am debugging in gdb. This was

  • 0

Here are two lines of a binary I am debugging in gdb. This was C code compiled by gcc for an IA32:

8049345:    8b 45 08                mov    0x8(%ebp),%eax
8049348:    89 04 24                mov    %eax,(%esp)

I have a display $eax set up so it will show the value after each step. After the first line, the display says: 6: $eax = 134527652.

I can x 134527652 or x $eax and I see 0x804baa4 <input_strings+100>: "1 1 1 1 1 1" Why do display and x give me different results?

The next line I believe says to move eax into the address stored by esp? I had a display $esp setup and it says: 2: $esp = (void *) 0xffffd540.

Before the second mov, I x 0xffffd540 and see: 0xffffd540: "" after the mov I repeat and see:

0xffffd540:  "\244\272\004\bY\233\004\b\210\325\377\377\214\325\377\377\220\325\377\377\224\325\377\377\230\325\377\377\234\325\377\377\001"

I thought this line was going to mov eax into this address, but I am obviously not understanding something here? Let me know if you would like to see any other lines from the binary.

  • 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-06-17T19:40:33+00:00Added an answer on June 17, 2026 at 7:40 pm

    I think your confusion may be caused by the fact that the x command is printing the data at address 0xffffd540 as a string. Presumably before the store to that address, the first byte at 0xffffd540 is a 0 byte, treated as terminating a string, and thus you’re seeing "", the empty string. After writing the value 0x804baa4 to this address, you’re seeing its representation in bytes:

    \244\272\004\b
    

    where \244 (octal escape) is 0xa4, \272 is 0xba, \004 is 0x04, and \b (the escape for backspace character, U+0008) is 0x08.

    You see more junk after it in the string printed because there doesn’t happen to be a null terminator anymore.

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

Sidebar

Related Questions

Here's a simplified version of my code: - (IBAction)convert:(id)sender { /* these two lines
While trying to execute the following lines only the last two statements are displayed(Here
I have two lines of code I want explained a bit please. As much
Here are two snippets of code which I at first thought should be equivalent:
Here are two queries that return the same resultset, but which is the optimal
Here's two screen shots, showing the effect with a small viewport that has to
Here is two variants. First: int n = 42; int* some_function(int* input) { int*
Here is two my variants of method, which returns a string, associated with enum
I've got a test site here with two columns, both with absolute positioning. http://dl.dropbox.com/u/17844821/zeug/heighttest.html
Say I want to draw a Ball in the scene and here are two

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.